/* components.css — nav, hero, buttons, cards, stats, badges, pillars, chips, steps, accordion, form, footer, motion */

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: 44px; padding: 0.7em 1.4em; border-radius: var(--r-pill); font-weight: 700; text-decoration: none; border: 2px solid transparent; transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--c-amber); color: var(--c-on-amber); box-shadow: var(--shadow-1); }
.btn--primary:hover { background: var(--c-amber-400); color: var(--c-on-amber); box-shadow: var(--shadow-2); }
.btn--blue { background: var(--c-primary); color: #fff; }
.btn--blue:hover { background: var(--c-primary-700); color: #fff; }
.btn--ghost { background: transparent; color: var(--c-ink); border-color: var(--c-muted); }
.btn--ghost:hover { border-color: var(--c-primary); background: var(--c-primary-100); color: var(--c-ink); }
.band--navy .btn--ghost, .band--primary .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, 0.35); }
.band--navy .btn--ghost:hover, .band--primary .btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); color: #fff; }
.btn--sm { min-height: 44px; padding: 0.4em 1em; font-size: var(--step--1); }
.btn .ico { width: 1.1em; height: 1.1em; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 100; height: var(--nav-h); background: rgba(244, 247, 251, 0.85); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--c-line); }
.nav__inner { height: 100%; display: flex; align-items: center; gap: var(--s-5); }
.nav__brand { display: inline-flex; align-items: center; margin-right: auto; }
.nav__brand img, .nav__brand svg { height: 34px; width: auto; }
.nav__primary { display: flex; align-items: center; min-width: 0; }
.nav__links { display: flex; align-items: center; gap: var(--s-2); list-style: none; margin: 0; padding: 0; }
.nav__links li { margin: 0; }
.nav__links a.btn--blue, .nav__links a.btn--blue:hover { color: #fff; background: var(--c-primary); border-radius: var(--r-pill); }
.nav__links a.btn--blue:hover { background: var(--c-primary-700); }
.nav__links a { display: inline-block; white-space: nowrap; padding: 0.5em 0.8em; border-radius: var(--r-pill); color: var(--c-ink); text-decoration: none; font-weight: 600; font-size: var(--step--1); }
.nav__links a:hover, .nav__links a[aria-current="page"] { background: var(--c-primary-100); color: var(--c-primary-700); }
.nav__cta { margin-left: var(--s-2); }
/* language switch: EN | ไทย pill, plain links to the counterpart page (desktop: after the CTA; mobile: before the burger) */
.lang-switch { flex: none; display: inline-flex; align-items: center; padding: 0; border: 1px solid var(--c-line); border-radius: var(--r-pill); background: var(--c-surface); }
.lang-switch a { min-width: 44px; min-height: 44px; padding: 0 0.75em; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; font-family: var(--ff-en); font-weight: 700; font-size: var(--step--1); line-height: 1; color: var(--c-muted); text-decoration: none; }
.lang-switch a:hover { color: var(--c-primary-700); background: var(--c-primary-100); }
.lang-switch a[aria-current="true"] { background: var(--c-navy); color: #fff; }
.lang-switch a[lang="th"] { font-family: var(--ff-th); }
.lang-switch a:focus-visible { outline-offset: -2px; }
.nav__burger { flex: none; display: none; width: 44px; height: 44px; border: 0; background: transparent; border-radius: var(--r-sm); align-items: center; justify-content: center; }
.nav__burger svg { width: 26px; height: 26px; }
.nav__cta--desktop { flex: none; }
@media (min-width: 64.01rem) and (max-width: 75rem) { .nav__inner { gap: var(--s-3); } .nav__links { gap: 0; } .nav__links a { padding-inline: 0.6em; } }
.nav__scrim { position: fixed; inset: var(--nav-h) 0 0 0; z-index: 90; background: rgba(11, 27, 63, 0.45); }
@media (max-width: 64rem) {
  .nav__links { position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 101; height: calc(100dvh - var(--nav-h)); flex-direction: column; align-items: stretch; gap: 0; background: var(--c-surface); border-bottom: 1px solid var(--c-line); box-shadow: var(--shadow-3); padding: var(--s-3) var(--gutter) var(--s-5); max-height: calc(100dvh - var(--nav-h)); overflow: auto; display: none; }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 0.9em 0.8em; border-radius: var(--r-sm); font-size: var(--step-0); }
  .nav__links li { margin: 0; }
  .nav__cta { margin: var(--s-3) 0 0; }
  .nav__burger { display: inline-flex; }
  .nav__cta--desktop { display: none; }
  .nav__inner { gap: var(--s-3); }
  .lang-switch { order: 1; }
  .nav__burger { order: 2; }
}
@media (min-width: 64.01rem) { .nav__cta--mobile { display: none; } .nav__scrim { display: none; } }
@media (max-width: 64rem) {
  html:not(.js) .nav__links { display: flex; position: static; height: auto; box-shadow: none; border: 0; padding: 0; background: none; }
  html:not(.js) .nav { height: auto; position: static; }
  html:not(.js) .nav__inner { flex-wrap: wrap; padding-block: var(--s-3); }
  html:not(.js) .nav__burger { display: none; }
}

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(4rem, 10vw, 7.5rem); isolation: isolate; }
.hero__grid { display: grid; gap: var(--s-7); align-items: center; grid-template-columns: 1fr; }
@media (min-width: 56rem) { .hero__grid { grid-template-columns: 1.15fr 0.85fr; } }
.hero h1 { max-width: 18ch; margin-bottom: var(--s-5); }
/* Thai hero: Thai headline runs longer, so tighten top space and size so it doesn't feel top-heavy */
html[lang="th"] .hero { padding-block: clamp(2.5rem, 5vw, 4.5rem) clamp(3.5rem, 7vw, 6rem); }
html[lang="th"] .hero h1 { max-width: 22ch; font-size: clamp(2rem, 1.35rem + 2.3vw, 3.25rem); line-height: 1.35; }
.hero .lead { color: var(--c-muted); margin-bottom: var(--s-6); }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hero__art { position: relative; min-height: 260px; }
.hero__art svg { width: 100%; height: auto; }
.hero__mesh { position: absolute; inset: -20% -10% -20% -10%; z-index: -1; pointer-events: none; opacity: 0.9;
  background:
    radial-gradient(40% 50% at 80% 20%, rgba(31, 79, 224, 0.55), transparent 70%),
    radial-gradient(35% 45% at 15% 85%, rgba(245, 183, 0, 0.18), transparent 70%); }
@supports (animation-timeline: scroll()) {
  .hero__mesh { animation: meshShift linear both; animation-timeline: scroll(); animation-range: 0 60vh; }
  @keyframes meshShift { to { transform: translateY(-8%); } }
}
@media (max-width: 40rem) {
  .hero { padding-block: 2.5rem; }
  .hero h1 { font-size: var(--step-3); margin-bottom: var(--s-4); }
  .hero__grid > div:first-child { display: flex; flex-direction: column; align-items: flex-start; }
  .hero__actions { order: 1; margin-bottom: var(--s-5); }
  .hero .lead { order: 2; font-size: var(--step-0); margin-bottom: 0; }
  .hero__art { display: none; }
}
/* pause control for looping hero art (WCAG 2.2.2) — injected by core.js */
.hero--paused .hero__art, .hero--paused .hero__art *, .hero--paused .hero__mesh { animation-play-state: paused !important; }
/* --- hero text entrance (staggered) --- */
html.js .hero-in { opacity: 0; transform: translateY(18px); animation: heroIn 0.8s var(--ease) forwards; animation-delay: calc(0.12s + var(--i, 0) * 0.14s); }
@keyframes heroIn { to { opacity: 1; transform: none; } }

/* --- hero network art --- */
.hero__art { animation: artIn 1.2s var(--ease) both; animation-delay: 0.3s; }
@keyframes artIn { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
.net-node { fill: var(--c-amber); }
.net-node--blue { fill: var(--c-primary-300); }
.hub { filter: drop-shadow(0 0 8px rgba(245, 183, 0, 0.8)); animation: hubBeat 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes hubBeat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.hub-glow { animation: glowBreath 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes glowBreath { 0%, 100% { opacity: 0.6; transform: scale(1); } 50% { opacity: 1; transform: scale(1.25); } }
.hub-halo { fill: none; stroke: var(--c-amber); stroke-width: 1.5; opacity: 0; animation: halo 3.6s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.hub-halo--2 { animation-delay: 1.8s; }
@keyframes halo { 0% { opacity: 0.7; transform: scale(0.6); } 100% { opacity: 0; transform: scale(3.2); } }
.pulse { animation: nodePulse 2.8s ease-in-out infinite; animation-delay: var(--d, 0s); transform-box: fill-box; transform-origin: center; }
@keyframes nodePulse { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.35); opacity: 1; } }
.net-edge { fill: none; stroke: rgba(255, 255, 255, 0.3); stroke-width: 1.2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawIn 1.6s var(--ease) forwards; animation-delay: 0.5s; }
.net-edges .net-edge:nth-child(2n) { animation-delay: 0.8s; }
.net-edges .net-edge:nth-child(3n) { animation-delay: 1.1s; }
@keyframes drawIn { to { stroke-dashoffset: 0; } }
.net-packet { fill: #9DB4FF; filter: drop-shadow(0 0 4px rgba(157, 180, 255, 0.9)); opacity: 0; animation: packetIn 0.6s linear forwards; animation-delay: 2s; }
.net-packet--amber { fill: var(--c-amber); filter: drop-shadow(0 0 4px rgba(245, 183, 0, 0.9)); }
@keyframes packetIn { to { opacity: 0.95; } }
.orbit { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 1; transform-box: fill-box; transform-origin: center; }
.orbit--1 { stroke-dasharray: 6 10; animation: spin 40s linear infinite; }
.orbit--2 { stroke-dasharray: 2 14; animation: spin 70s linear infinite reverse; }
.orbit--3 { stroke-dasharray: 10 18; animation: spin 110s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.particle { fill: #9DB4FF; opacity: 0.55; animation: float var(--dur, 16s) ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
.particle--amber { fill: var(--c-amber); }
@keyframes float { from { transform: translate(0, 0); } to { transform: translate(14px, -22px); } }
.net-drift { animation: drift 24s ease-in-out infinite alternate; transform-origin: center; }
.net-drift--2 { animation-duration: 31s; animation-direction: alternate-reverse; }
.net-drift--3 { animation-duration: 38s; }
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(-10px, 8px); } }
.hero__mesh { animation: meshBreath 18s ease-in-out infinite alternate; }
@keyframes meshBreath { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-2%, -3%, 0) scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  html.js .hero-in, .hero__art, .hub, .hub-glow, .pulse, .net-edge, .orbit, .particle, .net-drift, .hero__mesh { animation: none !important; opacity: 1; transform: none; }
  .net-edge { stroke-dashoffset: 0; }
  .hub-halo, .net-packets { display: none; }
}

/* ---------- stat tiles ---------- */
.stat { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c-amber); }
.stat__value { font-size: var(--step-3); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; color: var(--c-primary); font-variant-numeric: tabular-nums; }
.band--navy .stat__value { color: var(--c-amber); }
.stat__unit { font-size: 0.6em; font-weight: 700; margin-left: 0.12em; color: inherit; }
.stat__label { margin-top: var(--s-2); font-size: var(--step--1); color: var(--c-muted); line-height: 1.4; }
.stat--sm .stat__value { font-size: var(--step-2); }
.stat__value--text { font-size: var(--step-1); }
@media (max-width: 40rem) { .stat { padding: var(--s-4); } }

/* Thai pages: digits stay Inter; Thai unit words (ล้าน, วินาที, พันล้านบาท) fall through to IBM Plex Sans Thai */
:lang(th) .stat__value, :lang(th) .card__num, :lang(th) .flagship__nums b, :lang(th) .pillar__n, :lang(th) .stat__unit { font-family: "Inter", "IBM Plex Sans Thai", system-ui, sans-serif; }
:lang(th) .stat__unit { margin-left: 0.25em; display: inline-block; }
:lang(th) .stat__value .th-nw { white-space: normal; }
/* ---------- cards ---------- */
.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: var(--s-3); transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease); position: relative; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.card h3 { margin: 0; font-size: var(--step-1); }
.card p { font-size: var(--step--1); color: var(--c-muted); max-width: none; }
.card__ico { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--c-primary-100); color: var(--c-primary); display: inline-flex; align-items: center; justify-content: center; }
.card__ico svg { width: 24px; height: 24px; }
.band--navy .card__ico { background: rgba(255, 255, 255, 0.08); color: var(--c-amber); }
.card__meta { font-size: var(--step--1); color: var(--c-muted); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); }
.card__num { font-size: var(--step-3); font-weight: 800; color: var(--c-primary); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.band--navy .card__num { color: var(--c-amber); }
.card__link { margin-top: auto; font-weight: 700; font-size: var(--step--1); text-decoration: none; display: inline-flex; align-items: center; gap: 0.3em; }
.card__link::after { content: "\2192"; transition: transform var(--dur-fast) var(--ease); }
.card:hover .card__link::after { transform: translateX(3px); }
.card--link { text-decoration: none; color: inherit; }
.card--link:hover { color: inherit; }
.card--stretch::after { content: ""; position: absolute; inset: 0; }
.card--system { gap: var(--s-2); }
.card--system .card__scale { font-size: var(--step--1); font-weight: 600; color: var(--c-ink); }
.card--system .chips { margin-top: var(--s-2); }

/* ---------- chips / badges ---------- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; margin: 0; padding: 0; }
.chip { display: inline-block; padding: 0.3em 0.75em; border-radius: var(--r-pill); font-size: var(--step--1); font-weight: 600; background: var(--c-primary-100); color: var(--c-primary-700); border: 1px solid transparent; }
.band--navy .chip { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.12); }
.chip--outline { background: transparent; border-color: var(--c-line); color: var(--c-muted); }
.chip--amber { background: var(--c-amber-100); color: var(--c-on-amber); }
.badge-sector { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--s-5); border-radius: var(--r-md); background: var(--c-surface); border: 1px solid var(--c-line); font-weight: 700; }
.badge-sector svg { width: 28px; height: 28px; color: var(--c-primary); flex: none; }
a.badge-sector { color: var(--c-ink); text-decoration: none; transition: border-color .2s, box-shadow .2s; }
a.badge-sector:hover { border-color: var(--c-primary); box-shadow: var(--shadow-1); }
.badge-sector small { display: block; font-weight: 500; color: var(--c-muted); }
.iso-badge { display: inline-flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); border: 1px solid var(--c-line); background: var(--c-surface); font-weight: 700; font-size: var(--step--1); }
.iso-badge svg { width: 28px; height: 28px; color: var(--c-primary); flex: none; }
.band--navy .iso-badge svg { color: var(--c-amber); }
.iso-badge small { display: block; font-weight: 500; color: var(--c-muted); }

/* ---------- pillars ---------- */
.pillar { display: grid; grid-template-columns: 3rem 1fr; gap: var(--s-4); padding: var(--s-5) 0; border-top: 1px solid var(--c-line); }
.pillar__n { font-size: var(--step-2); font-weight: 800; color: var(--c-primary); line-height: 1; }
.band--navy .pillar__n { color: var(--c-amber); }
.pillar h3 { margin-bottom: var(--s-2); }
.pillar p { max-width: 70ch; }

/* ---------- flagship ---------- */
.flagships { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.flagship { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-5); }
/* each card is a 4-row subgrid so title, numbers, text and link line up across cards */
@supports (grid-template-rows: subgrid) {
  .flagships { grid-template-rows: auto auto 1fr auto; }
  .flagship { display: grid; grid-row: span 4; grid-template-rows: subgrid; row-gap: var(--s-5); }
}
.flagship h3 { margin: 0; }
.flagship p { margin: 0; color: var(--c-muted); font-size: var(--step--1); line-height: 1.6; }
.flagship__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); padding-block: var(--s-4); border-block: 1px solid var(--c-line); }
.flagship__nums b { display: block; font-size: clamp(1.25rem, 0.8rem + 0.85vw, 1.75rem); line-height: 1.1; color: var(--c-amber); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.flagship__nums span { margin-top: var(--s-1); font-size: 0.82rem; color: var(--c-muted); line-height: 1.35; display: block; }
.flagship .card__link { align-self: end; justify-self: start; }
/* Thai units ("ล้าน", "วินาที") make values wide: scale with the row width so columns never collide. */
.flagship__nums { container-type: inline-size; }
:lang(th) .flagship__nums b { font-size: clamp(1.05rem, 6.2cqi, 1.75rem); }

/* ---------- steps / timeline ---------- */
.steps { counter-reset: step; display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-top: var(--s-6); }
.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; top: 0; left: 0; font-weight: 800; color: var(--c-primary); font-size: var(--step--1); letter-spacing: 0.1em; }
.steps li::after { content: ""; position: absolute; top: 0.9rem; left: 2.6rem; right: 0; border-top: 2px dotted var(--c-line); }
.steps h3 { font-size: var(--step-0); margin-bottom: var(--s-2); }
.steps p { font-size: var(--step--1); color: var(--c-muted); }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--c-line); }
.timeline li { position: relative; padding: 0 0 var(--s-5) var(--s-6); }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 0.45em; width: 12px; height: 12px; border-radius: 50%; background: var(--c-amber); box-shadow: 0 0 0 3px var(--c-bg); }
.timeline b { color: var(--c-primary); margin-right: var(--s-2); }

/* ---------- accordion ---------- */
.acc { border-top: 1px solid var(--c-line); }
.acc details { border-bottom: 1px solid var(--c-line); }
.acc summary { cursor: pointer; list-style: none; padding: var(--s-4) 0; font-weight: 700; display: flex; justify-content: space-between; gap: var(--s-4); align-items: center; min-height: 44px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; font-size: 1.4em; color: var(--c-primary); flex: none; width: 1em; text-align: center; transition: transform var(--dur-fast) var(--ease); }
.acc details[open] summary::after { content: "\2212"; }
.acc details > :not(summary) { padding-bottom: var(--s-4); color: var(--c-muted); }

/* ---------- case-study specifics ---------- */
.cs-meta { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.cs-block { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: var(--s-6); }
.cs-block h2, .cs-block h3, .h-sm { font-size: var(--step-1); margin-bottom: var(--s-3); }
.cs-result { margin-top: var(--s-4); max-width: 62ch; font-size: var(--step-0); font-weight: 600; color: var(--c-ink); }
.cs-rail-cta { margin-top: var(--s-4); }
.cs-block ul { margin-bottom: 0; }
.diagram { background: var(--c-navy); border-radius: var(--r-lg); padding: var(--s-5); overflow: auto; overscroll-behavior-x: contain; }
.diagram svg { width: 100%; height: auto; display: block; }
@media (max-width: 48rem) {
  .diagram svg { min-width: 900px; }
  .diagram::before { content: "Scroll \2192"; position: sticky; left: 0; display: block; width: max-content; margin-bottom: var(--s-3); padding: 0.2em 0.7em; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.1); color: #fff; font-size: var(--step--1); font-weight: 600; }
}
.dg-box { fill: #13265A; stroke: rgba(255, 255, 255, 0.25); }
.dg-box--hi { fill: #1F4FE0; stroke: var(--c-primary-300); }
.dg-box--ext { fill: rgba(245, 183, 0, 0.12); stroke: #F5B700; stroke-dasharray: 4 3; }
.dg-txt { fill: #fff; font-family: var(--ff-en); font-size: 12px; font-weight: 600; }
.dg-sub { fill: #DCE4FF; font-family: var(--ff-en); font-size: 10px; }
.dg-line { stroke: rgba(255, 255, 255, 0.45); stroke-width: 1.4; fill: none; marker-end: url(#arr); }

/* ---------- filter bar ---------- */
.filterbar { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-6); }
.filterbar button { min-height: 40px; padding: 0 1em; border-radius: var(--r-pill); border: 1px solid var(--c-line); background: var(--c-surface); font-weight: 600; font-size: var(--step--1); }
.filterbar button[aria-pressed="true"] { background: var(--c-navy); color: #fff; border-color: var(--c-navy); }
[hidden] { display: none !important; }

/* ---------- form ---------- */
.form { display: grid; gap: var(--s-4); }
.form__row { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.field { display: grid; gap: var(--s-2); }
.field label { font-weight: 700; font-size: var(--step--1); }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 0.7em 0.9em; border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-100); }
.field [aria-invalid="true"] { border-color: var(--c-danger); }
.field__err { color: var(--c-danger); font-size: var(--step--1); min-height: 1.2em; }
.field--check { grid-template-columns: auto 1fr; align-items: start; gap: var(--s-3); }
.field--check input { width: 22px; height: 22px; min-height: 0; margin-top: 0.2em; }
.field--check label { font-weight: 500; }
.form__status { padding: var(--s-4); border-radius: var(--r-md); font-weight: 600; }
.form__status--ok { background: #E6F4EC; color: var(--c-success); }
.form__status--err { background: #FDECEA; color: var(--c-danger); }
.form__status--info { background: var(--c-primary-100); color: var(--c-primary-700); }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- footer ---------- */
.footer { padding-block: var(--s-8) var(--s-6); font-size: var(--step--1); }
.footer__grid { display: grid; gap: var(--s-6); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); margin-bottom: var(--s-6); }
.footer h2 { color: #fff; margin-bottom: var(--s-3); font-size: var(--step--1); line-height: var(--lh-tight); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.footer__nav { display: contents; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: var(--s-2); }
.footer a { text-decoration: none; color: var(--c-muted); display: inline-block; padding-block: 0.35em; }
.footer li { margin-bottom: 0; }
.footer a:hover { color: #fff; }
.footer__brand img { height: 40px; width: auto; margin-bottom: var(--s-3); }
.footer__bottom { border-top: 1px solid var(--c-line); padding-top: var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); justify-content: space-between; color: var(--c-muted); }

/* ---------- toast (i18n fallback notice) ---------- */
.toast { position: fixed; left: 50%; bottom: var(--s-5); z-index: 200; transform: translateX(-50%); max-width: calc(100% - 2 * var(--gutter)); padding: var(--s-3) var(--s-5); border-radius: var(--r-md); background: var(--c-navy); color: #fff; box-shadow: var(--shadow-3); font-size: var(--step--1); font-weight: 600; }

/* ---------- motion: reveal ---------- */
html.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); transition-delay: var(--delay, 0ms); }
html.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html.js .reveal { opacity: 1; transform: none; }
}

/* ---------- breadcrumb ---------- */
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); list-style: none; margin: 0 0 var(--s-4); padding: 0; font-size: var(--step--1); color: var(--c-muted); }
.breadcrumb li { margin: 0; display: inline-flex; align-items: center; gap: var(--s-2); min-width: 0; }
.breadcrumb li + li::before { content: "›"; content: "›" / ""; color: var(--c-muted); }
.breadcrumb a { color: var(--c-muted); text-decoration: underline; text-underline-offset: 0.2em; display: inline-block; padding-block: 0.35em; }
.breadcrumb a:hover { color: var(--c-primary); }
.band--navy .breadcrumb a:hover { color: #fff; }
.breadcrumb [aria-current="page"] { color: var(--c-ink); font-weight: 600; }
.band--navy .breadcrumb [aria-current="page"] { color: #fff; }

/* very small phones: long button labels wrap instead of overflowing */
@media (max-width: 22.5rem) { .btn { white-space: normal; text-align: center; max-width: 100%; } }

/* Thai card numbers ("21,030 ล้านบาท") are wide: size to the card so they never spill out */
:lang(th) .card:has(> .card__num) { container-type: inline-size; }
:lang(th) .card__num { font-size: min(var(--step-3), 12cqi); }
