/* Momo Kids Lab registration — soft pastel, rounded, family-friendly */

@font-face {
  font-family: 'Fredoka';
  src: url('fonts/Fredoka.ttf') format('truetype');
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: 'Noto Sans Thai';
  src: url('fonts/NotoSansThai.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --cream: #fff8f0;
  --peach: #ffe3cc;
  --peach-strong: #ffb27a;
  --orange: #ff9f5a;
  --orange-ink: #a63d0b;
  --sky: #dff1ff;
  --sky-strong: #8fcdf5;
  --lavender: #efe6ff;
  --lavender-strong: #c9b3f2;
  --mint: #dcf6e8;
  --pink: #ffe1ea;
  --ink: #3b2f4a;
  --ink-soft: #5e5070;
  --line: #eadcf2;
  --error: #b42318;
  --error-bg: #fff1f0;
  --ok: #1f7a4d;
  --radius: 24px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(92, 64, 120, 0.12);
  --font: 'Fredoka', 'Noto Sans Thai', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', 'Noto Sans Thai', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', Roboto, sans-serif;
}

:lang(th) { --font: 'Noto Sans Thai', 'Fredoka', system-ui, sans-serif; --font-body: 'Noto Sans Thai', system-ui, sans-serif; }
:lang(zh-CN) { --font: 'Fredoka', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', 'Hiragino Sans GB', sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
}
:lang(th) body, body:lang(th) { line-height: 1.8; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--orange-ink); text-underline-offset: 3px; }
h1, h2, h3, .logo, .btn, .eyebrow, legend, summary { font-family: var(--font); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); font-weight: 650; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid #7c4dff; outline-offset: 3px; border-radius: 8px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 248, 240, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 16px;
}
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 1.35rem; }
.logo-mark { color: var(--orange); font-size: 1.2em; }
.logo-text span { color: var(--orange-ink); font-weight: 500; }
.main-nav { display: flex; gap: 6px; margin-left: auto; align-items: center; }
.main-nav a {
  text-decoration: none; color: var(--ink); font-family: var(--font); font-weight: 500;
  padding: 8px 14px; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center;
}
.main-nav a:hover { background: var(--peach); }
.main-nav .nav-cta { background: var(--orange); color: var(--ink); font-weight: 600; }
.main-nav .nav-cta:hover { background: var(--peach-strong); }

.lang-picker {
  position: relative; display: flex; align-items: center;
  background: #fff; border: 2px solid var(--line); border-radius: 999px; padding-left: 12px;
}
.lang-picker:focus-within { border-color: #7c4dff; }
.lang-icon { font-size: 1rem; }
.lang-picker select {
  appearance: none; -webkit-appearance: none; border: 0; background: transparent;
  font: 600 1rem var(--font); color: var(--ink); padding: 9px 34px 9px 8px; min-height: 44px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.lang-picker select:focus { outline: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 12px 26px; border-radius: 999px; border: 0;
  font-size: 1.1rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: var(--orange); color: var(--ink); box-shadow: 0 6px 0 #e37f37; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #e37f37; }
.btn-primary:active { transform: translateY(3px); box-shadow: 0 3px 0 #e37f37; }
.btn-primary[disabled] { opacity: .7; cursor: progress; transform: none; }
.btn-soft { background: #fff; color: var(--ink); border: 2px solid var(--lavender-strong); }
.btn-soft:hover { background: var(--lavender); }
.btn-large { width: 100%; font-size: 1.25rem; min-height: 60px; }

.eyebrow {
  display: inline-block; font-size: .95rem; font-weight: 600; letter-spacing: .04em;
  color: var(--orange-ink); background: var(--peach); padding: 4px 14px; border-radius: 999px; margin-bottom: 14px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: min(calc(100vh - 68px), 880px);
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 20px 0;
  background: #cfe9ff url('images/background.webp') center bottom / cover no-repeat;
}
.hero::after { /* soft fade into the page */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60px;
  background: linear-gradient(to bottom, rgba(255, 248, 240, 0), var(--cream));
  pointer-events: none;
}
.hero-copy {
  position: relative; z-index: 2; text-align: center; max-width: 760px;
  background: rgba(255, 255, 255, 0.86); border-radius: 32px; padding: 20px 30px 16px;
  box-shadow: var(--shadow); backdrop-filter: blur(4px);
}
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); font-weight: 700; margin-bottom: .3em; }
.hero h1 span { display: block; }
.hero h1 .accent { color: var(--orange-ink); }
.hero-text { font-size: 1.12rem; color: var(--ink-soft); max-width: 640px; margin: 0 auto .8em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 6px 0 12px; }
.hero-note { font-size: .95rem; color: var(--ink-soft); margin: 0; }

.hero-stage {
  position: relative; z-index: 1; flex: 1; width: 100%; max-width: 900px;
  display: flex; align-items: flex-end; justify-content: center;
  min-height: 280px; margin-top: 4px; padding-bottom: clamp(26px, 5vh, 56px);
}
.momo {
  position: relative; z-index: 2;
  width: clamp(180px, 19vw, 270px);
  filter: drop-shadow(0 10px 14px rgba(60, 90, 40, .25));
  animation: bob 4s ease-in-out infinite;
  transform-origin: 50% 100%;
}
.momo-shadow {
  position: absolute; z-index: 1; left: 50%; bottom: clamp(18px, 4.4vh, 48px);
  width: clamp(130px, 17vw, 220px); height: 26px; transform: translateX(-46%);
  background: radial-gradient(ellipse at center, rgba(40, 70, 20, .38), rgba(40, 70, 20, 0) 70%);
  border-radius: 50%;
}
.speech {
  position: absolute; z-index: 3; left: calc(50% + clamp(90px, 12vw, 160px)); top: 18%;
  max-width: 230px; background: #fff; color: var(--ink); font-family: var(--font); font-weight: 500;
  padding: 12px 16px; border-radius: 20px; box-shadow: var(--shadow); font-size: 1rem; line-height: 1.4;
}
.speech::before {
  content: ''; position: absolute; left: -10px; bottom: 18px;
  border: 10px solid transparent; border-right-color: #fff; border-left: 0;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Sections ---------- */
.section { max-width: 1180px; margin: 0 auto; padding: clamp(48px, 7vw, 88px) 20px; text-align: center; }
.section-tint { max-width: none; background: linear-gradient(180deg, var(--lavender), #f7f1ff); }
.section-tint > * { max-width: 1140px; margin-left: auto; margin-right: auto; }
.section-intro { max-width: 720px; margin: 0 auto 32px; color: var(--ink-soft); }

.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; text-align: left; }
.game-card { border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); background: #fff; border: 3px solid transparent; }
.game-math { background: linear-gradient(160deg, var(--sky), #fff 70%); border-color: var(--sky-strong); }
.game-puzzle { background: linear-gradient(160deg, var(--pink), #fff 70%); border-color: #f6b5c8; }
.game-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 10px; }
.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .9rem; }

.skills-title { margin-top: 40px; }
.skills { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.skills li {
  display: inline-flex; align-items: center; gap: 8px; background: var(--mint); border-radius: 999px;
  padding: 10px 18px; font-family: var(--font); font-weight: 500;
}

.steps { list-style: none; padding: 0; margin: 24px auto 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; text-align: left; }
.steps li { background: #fff; border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); position: relative; }
.step-num {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: var(--orange); font: 700 1.3rem var(--font); margin-bottom: 10px;
}

/* ---------- Notice + form ---------- */
#register { max-width: 860px; }
#register:focus { outline: none; }
.notice {
  display: flex; gap: 16px; align-items: flex-start; text-align: left;
  background: var(--sky); border: 2px solid var(--sky-strong); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 28px;
}
.notice h3 { margin-bottom: .25em; }
.notice p { margin: 0; }
.notice-icon { font-size: 2rem; line-height: 1; }

.form-card { background: #fff; border-radius: 32px; box-shadow: var(--shadow); padding: clamp(24px, 5vw, 44px); text-align: left; border: 3px solid var(--peach); }
.form-card > div > .eyebrow { margin-bottom: 8px; }
.form-intro { color: var(--ink-soft); }
.required-note { font-size: .95rem; color: var(--ink-soft); }
.req { color: var(--error); }

.field { margin: 0 0 26px; padding: 0; border: 0; min-width: 0; }
.field > label, legend { display: block; font-weight: 600; font-size: 1.15rem; margin-bottom: 4px; padding: 0; }
.help { font-size: 1rem; color: var(--ink-soft); margin: 0 0 10px; }
input[type="email"] {
  width: 100%; font: inherit; font-size: 1.15rem; color: var(--ink);
  padding: 14px 18px; border: 2px solid #d9c9e6; border-radius: var(--radius-sm); background: #fffdfb; min-height: 56px;
}
input[type="email"]:focus { border-color: #7c4dff; outline: 3px solid rgba(124, 77, 255, .25); outline-offset: 0; }
.has-error input[type="email"] { border-color: var(--error); background: var(--error-bg); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip, .choice { position: relative; cursor: pointer; }
.chip input, .choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; min-height: 50px; padding: 10px 22px;
  border: 2px solid var(--line); border-radius: 999px; background: #fff; font-family: var(--font); font-weight: 500; font-size: 1.1rem;
  transition: background .15s, border-color .15s;
}
.chip span::before { content: '＋'; margin-right: 8px; color: var(--ink-soft); font-size: .9em; }
.chip input:checked + span { background: var(--peach); border-color: var(--orange); }
.chip input:checked + span::before { content: '✓'; color: var(--orange-ink); font-weight: 700; }
.chip input:focus-visible + span, .choice input:focus-visible ~ span:last-child { outline: 3px solid #7c4dff; outline-offset: 3px; }
.chip:hover span { border-color: var(--peach-strong); }

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choice {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 108px; padding: 14px; border: 2px solid var(--line); border-radius: 20px; background: #fff;
  font-family: var(--font); font-weight: 500; font-size: 1.08rem; transition: background .15s, border-color .15s;
}
.choice-icon { font-size: 1.8rem; line-height: 1; }
.choice:has(input:checked) { background: var(--lavender); border-color: #9a7ae0; box-shadow: inset 0 0 0 2px #9a7ae0; }
.choice:has(input:focus-visible) { outline: 3px solid #7c4dff; outline-offset: 3px; }
.choice:hover { border-color: var(--lavender-strong); }
.has-error .chip span, .has-error .choice { border-color: #f1a7a1; }

.ack { background: var(--cream); border: 2px solid var(--peach); border-radius: 22px; padding: 20px 22px; }
.ack-list { margin: 0 0 8px; padding-left: 1.25em; font-size: 1.02rem; }
.ack-list li { margin-bottom: 6px; }
.ack-link { margin: 0 0 12px; font-size: 1rem; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-weight: 600; }
.check input { width: 28px; height: 28px; margin: 2px 0 0; flex: none; accent-color: var(--orange-ink); cursor: pointer; }
.has-error.ack { border-color: var(--error); background: var(--error-bg); }

.error { color: var(--error); font-weight: 600; font-size: 1rem; margin: 8px 0 0; }
.error::before { content: '⚠ '; }
.error-summary { scroll-margin-top: 96px; border: 2px solid var(--error); background: var(--error-bg); border-radius: 18px; padding: 14px 18px; margin-bottom: 22px; }
.error-summary p { font-weight: 700; margin: 0 0 6px; color: var(--error); }
.error-summary ul { margin: 0; padding-left: 1.2em; }
.error-summary a { color: var(--error); }
.form-status { border-radius: 16px; padding: 14px 18px; margin-bottom: 16px; background: #fff7e0; border: 2px solid #f3c76b; }
.form-status p { margin: 0; }
.footnote { text-align: center; font-size: .95rem; color: var(--ink-soft); margin: 12px 0 0; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile { margin: 0 0 16px; min-height: 0; }

/* ---------- Confirmation ---------- */
.confirm { text-align: center; }
.confirm h2:focus { outline: none; }
.confirm-momo { width: 150px; margin: 0 auto 8px; animation: bob 4s ease-in-out infinite; }
.confirm-text { font-size: 1.2rem; max-width: 620px; margin-inline: auto; }
.confirm-note { color: var(--ok); font-weight: 600; }
.confirm-warn { text-align: left; background: #fff7e0; border: 2px solid #f3c76b; border-radius: 18px; padding: 16px 18px; margin: 18px 0; }
.confirm-warn .btn { margin-top: 4px; }
#retry-status { margin: 10px 0 0; font-weight: 600; }
#retry-status:empty { display: none; }
.confirm-summary { text-align: left; background: var(--cream); border-radius: 18px; padding: 16px 20px; margin: 18px auto; max-width: 520px; }
.confirm-summary h3 { font-size: 1.1rem; }
.confirm-summary dl { margin: 0; }
.confirm-summary dl > div { display: grid; grid-template-columns: 9em 1fr; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); }
.confirm-summary dt { font-weight: 600; color: var(--ink-soft); }
.confirm-summary dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin: 24px auto 0; text-align: left; display: grid; gap: 12px; }
.faq details { background: #fff; border-radius: 20px; box-shadow: var(--shadow); padding: 4px 22px; }
.faq summary {
  cursor: pointer; font-weight: 600; font-size: 1.15rem; padding: 14px 30px 14px 0; list-style: none; position: relative; min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; position: absolute; right: 0; top: 10px; font-size: 1.5rem; color: var(--orange-ink); }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 0 0 16px; color: var(--ink-soft); }

/* ---------- Privacy ---------- */
.privacy { text-align: left; }
.privacy:focus { outline: none; }
.privacy > .eyebrow, .privacy > h2 { display: table; }
.privacy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 20px; }
.privacy-grid > div { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); font-size: 1.02rem; }
.privacy-grid h3 { font-size: 1.15rem; margin-top: .4em; }
.privacy-grid ul { padding-left: 1.2em; margin: 0 0 1em; }
.privacy-strong { font-weight: 600; background: var(--mint); border-radius: 12px; padding: 10px 12px; }
.mail { display: inline-block; font-weight: 600; }
.muted { color: var(--ink-soft); font-size: .98rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--peach); padding: 36px 20px; text-align: center; }
.footer-inner { max-width: 900px; margin: 0 auto; }
.site-footer p { margin: 8px 0; }
.copyright { font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .main-nav a:not(.nav-cta) { display: none; }
  .steps, .privacy-grid { grid-template-columns: 1fr; }
  .speech { display: none; }
}
@media (max-width: 680px) {
  body { font-size: 1.06rem; }
  .header-inner { padding: 8px 12px; gap: 8px; }
  .logo { font-size: 1.1rem; }
  .logo-text span { display: none; }
  .main-nav .nav-cta { padding: 8px 12px; }
  .lang-picker { padding-left: 8px; }
  .lang-picker select { padding-right: 28px; font-size: .95rem; }
  .hero { padding: 18px 14px 0; min-height: auto; }
  .hero-copy { padding: 20px 18px 16px; border-radius: 26px; }
  .hero-actions .btn { width: 100%; }
  .hero-stage { min-height: 250px; }
  .game-grid, .choices { grid-template-columns: 1fr; }
  .choice { flex-direction: row; justify-content: flex-start; min-height: 64px; text-align: left; }
  .confirm-summary dl > div { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 380px) {
  .logo-text { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
