:root {
  --bg: #eef6f4;
  --ink: #14302b;
  --muted: #5a726c;
  --line: rgba(20, 48, 43, .12);
  --panel: rgba(255, 255, 255, .88);
  --accent: #0f766e;
  --accent-deep: #0a5c56;
  --accent-soft: #d8f3ef;
  --warm: #e07a3d;
  --warm-soft: #fff1e8;
  --danger: #c2410c;
  --star: #e8a317;
  --shadow: 0 18px 50px rgba(20, 48, 43, .10);
  --radius: 22px;
  --font-display: "Bai Jamjuree", sans-serif;
  --font-body: "Bai Jamjuree", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 8% -10%, rgba(15, 118, 110, .22), transparent 55%),
    radial-gradient(ellipse 55% 45% at 92% 8%, rgba(224, 122, 61, .16), transparent 50%),
    radial-gradient(ellipse 40% 35% at 70% 90%, rgba(56, 189, 248, .12), transparent 45%),
    linear-gradient(165deg, #f3faf8 0%, #e8f2ef 45%, #f7f3ee 100%);
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .35;
  background-image:
    linear-gradient(rgba(20, 48, 43, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 48, 43, .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 75%);
}

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

.hero {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(48px, 8vh, 88px) 0 28px;
  text-align: center;
  animation: rise .7s ease both;
}

.brand-mark {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 5.2vw, 46px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -.02em;
  color: var(--ink);
}

.hero-lead {
  max-width: 520px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 17px);
  line-height: 1.65;
}

.shell {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto 64px;
}

.view[hidden] { display: none !important; }

.view.active:not([hidden]) {
  animation: rise .55s ease both;
}

.menu-loading {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 18px;
  border: 1px dashed rgba(20, 48, 43, .18);
  border-radius: 16px;
  background: rgba(255, 255, 255, .7);
  color: var(--muted);
  text-align: center;
  font-size: 15px;
}

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

.menu-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 28px 24px 24px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  text-align: left;
  color: inherit;
  transition:
    transform .28s cubic-bezier(.22, 1, .36, 1),
    box-shadow .28s ease,
    border-color .28s ease,
    background .28s ease;
  animation: rise .65s ease both;
  animation-delay: var(--delay, 0ms);
}

.menu-card:hover,
.menu-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(15, 118, 110, .35);
  box-shadow: 0 24px 56px rgba(15, 118, 110, .16);
  outline: none;
  background: #fff;
}

.menu-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .25), 0 24px 56px rgba(15, 118, 110, .16);
}

.menu-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  color: var(--accent);
  background: linear-gradient(145deg, var(--accent-soft), #fff);
  margin-bottom: 6px;
  transition: transform .28s ease, background .28s ease;
}

.menu-card:hover .menu-icon {
  transform: scale(1.06) rotate(-3deg);
  background: linear-gradient(145deg, #c5ebe5, #fff);
}

.menu-icon svg { width: 28px; height: 28px; }

.menu-num {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  color: var(--warm);
}

.menu-card h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.menu-card p {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.menu-cta {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  transition: transform .25s ease, color .25s ease;
}

.menu-card:hover .menu-cta {
  transform: translateX(4px);
  color: var(--accent-deep);
}

.back-btn {
  margin-bottom: 18px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  transition: color .2s ease, transform .2s ease;
}

.back-btn:hover {
  color: var(--accent);
  transform: translateX(-3px);
}

.form-panel,
.success-panel {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 32px 28px 28px;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: calc(var(--radius) + 4px);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.form-head { margin-bottom: 28px; }

.form-eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--warm);
}

.form-head h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 30px);
  letter-spacing: -.02em;
}

.form-head p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.criteria-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}

.rating-legend {
  width: fit-content;
  max-width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(224, 122, 61, .22);
  border-radius: 16px;
  background: linear-gradient(135deg, #fff8f2, #fff);
}

.rating-legend-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.rating-legend-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rating-legend-list li {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(20, 48, 43, .06);
  text-align: left;
  white-space: nowrap;
}

.legend-stars {
  min-width: 5.2em;
  color: var(--star);
  font-size: 12px;
  letter-spacing: 1px;
  line-height: 1.2;
}

.legend-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.legend-text strong {
  display: inline;
  color: var(--ink);
  font-size: 13px;
  margin: 0 2px 0 0;
}

.rating-field {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #f7fcfb, #fff);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.criteria-item:hover {
  border-color: rgba(15, 118, 110, .28);
  box-shadow: 0 8px 24px rgba(15, 118, 110, .06);
}

.rating-field legend {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 100%;
  padding: 0 6px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
}

.criteria-num {
  flex: 0 0 auto;
  margin-top: 1px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--warm);
}

.req { color: var(--warm); }

.stars {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.star {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 52px;
  height: 56px;
  border: 0;
  border-radius: 14px;
  background: #f1f5f4;
  color: #b7c4c0;
  line-height: 1;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}

.star-icon { font-size: 22px; }
.star-label {
  font-size: 11px;
  font-weight: 700;
  color: inherit;
  opacity: .85;
}

.star:hover,
.star.is-hover {
  transform: translateY(-2px) scale(1.05);
  background: var(--warm-soft);
  color: var(--star);
}

.star.is-active {
  background: linear-gradient(145deg, #fff4d6, #ffe8a8);
  color: var(--star);
  transform: scale(1.04);
}

.rating-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.full-field { margin-bottom: 8px; }

input,
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fff;
  font-weight: 400;
  transition: border-color .2s ease, box-shadow .2s ease;
}

textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder { color: #8aa09a; }

input:focus,
textarea:focus {
  border-color: rgba(15, 118, 110, .55);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, .12);
}

.form-error {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 500;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 22px;
}

.submit-btn {
  min-width: 180px;
  padding: 14px 22px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #14968c, #0f766e 55%, #0a5c56);
  box-shadow: 0 12px 28px rgba(15, 118, 110, .28);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(15, 118, 110, .34);
  filter: brightness(1.05);
}

.submit-btn:disabled {
  opacity: .65;
  cursor: wait;
}

.success-panel {
  text-align: center;
  padding: 48px 28px;
  animation: pop .55s cubic-bezier(.22, 1, .36, 1) both;
}

.success-check {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(145deg, #1aa896, #0f766e);
  box-shadow: 0 14px 32px rgba(15, 118, 110, .28);
  animation: pop .6s .1s cubic-bezier(.22, 1, .36, 1) both;
}

.success-panel h2 {
  margin: 0 0 10px;
  font-size: 28px;
  letter-spacing: -.02em;
}

.success-panel p {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: 320px;
  padding: 13px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 16px 40px rgba(20, 48, 43, .28);
  animation: rise .35s ease both;
}

.toast[hidden] { display: none !important; }

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

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 860px) {
  .menu-grid { grid-template-columns: 1fr; }
  .menu-card { padding: 24px; }
}

@media (max-width: 560px) {
  .hero { padding-top: 36px; }
  .field-row { grid-template-columns: 1fr; }
  .form-panel { padding: 24px 18px; }
  .rating-legend { width: 100%; }
  .rating-legend-list li { white-space: normal; }
  .star { width: 44px; height: 52px; }
  .star-icon { font-size: 20px; }
  .form-actions { justify-content: stretch; }
  .submit-btn { width: 100%; }
}
