* {
  box-sizing: border-box;
}

:root {
  font-family: "Noto Sans Thai", sans-serif;
  color: #172033;
  background: #f4f7fb;
}

body {
  margin: 0;
  min-height: 100vh;
}

.container {
  width: min(1050px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

.card {
  background: white;
  border: 1px solid #e5eaf2;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 18px 50px rgba(22, 38, 74, 0.08);
}

.header {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #4967d8;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.2;
}

.subtitle {
  margin: 12px 0 0;
  color: #667085;
}

.status {
  margin-bottom: 24px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #eef3ff;
  color: #334ea0;
  font-size: 14px;
}

.status.success {
  background: #ecfdf3;
  color: #067647;
}

.status.error {
  background: #fef3f2;
  color: #b42318;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 14px;
  font-weight: 600;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  padding: 0 14px;
  font: inherit;
  background: white;
  color: #000;
  outline: none;
}

select option {
  color: #fff;
  background: #172033;
}

textarea {
  width: 100%;
  min-height: 180px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: white;
  color: #172033;
  outline: none;
  resize: vertical;
}

select:focus,
textarea:focus {
  border-color: #6172f3;
  box-shadow: 0 0 0 4px rgba(97, 114, 243, 0.12);
}

select:disabled {
  background: #f2f4f7;
  color: #000;
  -webkit-text-fill-color: #000;
  opacity: 1;
}

.sub-district-list-field {
  margin-top: 18px;
}

.sub-district-list-field textarea {
  min-height: 150px;
}

.map-section {
  min-width: 0;
  margin-top: 24px;
}

.map-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.map-header h2 {
  margin: 0;
  font-size: 20px;
}

.map-header p {
  margin: 0;
  color: #667085;
  font-size: 14px;
}

#map {
  position: relative;
  width: 100%;
  height: 560px;
  min-height: 560px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  overflow: hidden;
}

.result {
  margin-top: 32px;
  border-top: 1px solid #eaecf0;
  padding-top: 28px;
}

.result h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.result-grid > div {
  background: #f8fafc;
  border: 1px solid #edf0f5;
  border-radius: 14px;
  padding: 16px;
}

.result-grid span,
.code-box span {
  display: block;
  color: #667085;
  font-size: 13px;
  margin-bottom: 4px;
}

.result-grid strong {
  font-size: 16px;
}

.code-box {
  margin-top: 18px;
  background: #101828;
  color: #f9fafb;
  border-radius: 14px;
  padding: 18px;
}

.code-box span {
  color: #98a2b3;
}

pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, monospace;
  font-size: 13px;
}

.hidden {
  display: none;
}

@media (max-width: 760px) {
  .container {
    padding: 24px 0;
  }

  .card {
    padding: 24px;
  }

  .form-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .sub-district-list-field {
    margin-top: 18px;
  }

  .sub-district-list-field textarea {
    min-height: 160px;
  }

  .map-header {
    align-items: start;
    flex-direction: column;
  }

  #map {
    height: 420px;
    min-height: 420px;
  }
}
