/* Palette mirrors the landing page tokens (Figma: sure-product / preproduct-v1). */
:root {
  --sand: #f4f2ec;
  --shell: #e9e5d6;
  --ink: #06187e;
  --navy: #01147b;
  --muted: #5b6390;
  --line: #d7d2c1;
  --brand: #00543e;
  --brand-deep: #00543e;
  --brand-soft: #f4e860;
  --panel: #f4f2ec;
  --white: #ffffff;
  --yellow: #f4e860;
  --danger: #b42318;
  --radius-panel: 2rem;
  --radius-chip: 999px;
  --font-display: "LINE Seed Sans TH", "LINE Seed Sans TH App", "Noto Sans Thai", system-ui, sans-serif;
  --font-body: "LINE Seed Sans TH", "LINE Seed Sans TH App", "Noto Sans Thai", system-ui, sans-serif;
  --shadow: 0 24px 80px rgba(0, 40, 30, 0.22);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--brand);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(280px, 42%) 1fr;
}

.visual {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  color: white;
}

.visual__media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(8, 79, 61, 0.28), rgba(28, 26, 23, 0.18)),
    url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1600&q=80")
      center / cover no-repeat;
  transform: scale(1.02);
  transition: opacity 0.45s ease, transform 0.8s ease;
}

.visual__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.45));
}

.visual__top,
.visual__progress {
  position: relative;
  z-index: 2;
}

.visual__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0;
}

.brand {
  color: white;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* The tilted exclamation mark is part of the wordmark. */
.brand em {
  display: inline-block;
  font-style: normal;
  transform: rotate(15deg);
}

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  transition: background 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.icon-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.icon-btn--dark {
  color: var(--ink);
  background: rgba(6, 24, 126, 0.07);
}

.visual__progress {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-count {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 2.4rem;
}

.progress-track {
  flex: 1;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
}

.progress-track--dark {
  background: rgba(6, 24, 126, 0.12);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: white;
  transition: width 0.35s ease;
}

.progress-fill--brand {
  background: var(--brand);
}

.panel {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  box-shadow: var(--shadow);
}

.panel__mobile-bar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.5rem;
}

.mobile-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.panel__scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2.5rem 2.5rem 1.25rem;
}

/* Thai has no inter-word spaces, so long labels need an explicit break rule
   or they push past the panel. */
.step__title,
.step__subtitle,
.step__hint,
.section-label,
.chip,
.month-card,
.radio-card,
.service-card__label,
.field label {
  word-break: break-word;
}

.panel__footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2.5rem 1.75rem;
  border-top: 1px solid rgba(219, 209, 198, 0.7);
  background: linear-gradient(180deg, rgba(251, 248, 242, 0), var(--panel) 28%);
}

.step {
  animation: rise 0.35s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.step__title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.step__subtitle {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.45;
  max-width: 36rem;
}

.step__hint {
  margin: -0.9rem 0 1.4rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  max-width: 100%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-chip);
  background: var(--shell);
  color: var(--ink);
  border: 2px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.chip:hover {
  transform: translateY(-1px);
}

.chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--white);
}

.chip__icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.chip__icon svg {
  width: 1.15rem;
  height: 1.15rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.15rem;
}

.field label {
  font-size: 0.92rem;
  font-weight: 600;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1.5px solid var(--line);
  background: var(--white);
  border-radius: 1rem;
  padding: 0.95rem 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 84, 62, 0.14);
}

.field textarea {
  min-height: 7rem;
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.section-label {
  margin: 1.4rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.tabs {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.25rem;
  background: var(--shell);
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.tab {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  color: var(--muted);
}

.tab[aria-selected="true"] {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.08);
}

.duration-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.65rem;
}

.month-card {
  /* Not a fixed square: Thai month names are long and need room to wrap. */
  min-height: 6.5rem;
  padding: 0.5rem;
  border-radius: 0.85rem;
  background: rgba(239, 232, 220, 0.7);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.month-card strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.2;
  text-align: center;
}

.month-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.month-card[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--white);
}

.service-list {
  display: grid;
  gap: 0.75rem;
}

.service-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border-radius: 1.15rem;
  background: var(--shell);
  border: 2px solid transparent;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.service-card[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--white);
}

.service-card__icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
}

.service-card__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.service-card__label {
  font-weight: 600;
}

.badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  white-space: nowrap;
}

.badge--muted {
  background: #ece7df;
  color: var(--muted);
}

.radio-grid {
  display: grid;
  gap: 0.65rem;
}

.radio-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  border-radius: 1rem;
  background: var(--shell);
  border: 2px solid transparent;
  text-align: left;
}

.radio-card[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--white);
}

.radio-dot {
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  border: 2px solid var(--line);
  flex: 0 0 auto;
}

.radio-card[aria-pressed="true"] .radio-dot {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 3px var(--brand);
}

.btn-next {
  flex: 1;
  min-height: 3.4rem;
  border-radius: 1.15rem;
  background: var(--brand);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  transition: filter 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
}

.btn-next:hover:not(:disabled) {
  filter: brightness(1.2);
  transform: translateY(-1px);
}

.btn-next:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-back-text {
  color: var(--muted);
  font-weight: 600;
  padding: 0.5rem 0.25rem;
}

.prefix-input {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.35rem;
  border: 1.5px solid var(--line);
  background: var(--white);
  border-radius: 1rem;
  padding: 0 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.prefix-input:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 84, 62, 0.14);
}

.prefix-input span {
  color: var(--muted);
  font-weight: 600;
}

.prefix-input input {
  border: none; 
  background: transparent;
  padding: 0.95rem 0;
  outline: none;
  box-shadow: none;
  border-radius: 0;
}

.prefix-input input:focus {
  border: none;
  box-shadow: none;
}

.success {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    linear-gradient(160deg, rgba(0, 84, 62, 0.88), rgba(0, 44, 32, 0.82)),
    url("https://images.unsplash.com/photo-1469474968028-56623f02e42e?auto=format&fit=crop&w=1600&q=80")
      center / cover no-repeat;
}

.success[hidden] {
  display: none;
}

.success__card {
  width: min(100%, 28rem);
  background: var(--panel);
  border-radius: 1.75rem;
  padding: 2.25rem 1.75rem;
  text-align: center;
  box-shadow: var(--shadow);
  animation: rise 0.4s ease;
}

.success__eyebrow {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--brand);
}

.success__title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.15;
}

.success__body {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

@media (max-width: 900px) {
  .shell {
    display: block;
    min-height: 100dvh;
    background:
      linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.45)),
      url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1400&q=80")
        center top / cover no-repeat;
  }

  .visual {
    display: none;
  }

  .panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 72dvh;
    max-height: calc(100dvh - 5.5rem);
    border-radius: var(--radius-panel) var(--radius-panel) 0 0;
  }

  .panel__mobile-bar {
    display: flex;
  }

  .panel__scroll {
    padding: 1rem 1.25rem 0.75rem;
  }

  .panel__footer {
    padding: 0.85rem 1.25rem 1.25rem;
  }

  .btn-back-text {
    display: none;
  }

  .field-row {
    grid-template-columns: 1fr;
  }
}
