:root {
  --paper: #f2efe6;
  --paper-deep: #e6e0d2;
  --ink: #142b3a;
  --ink-muted: #4d626e;
  --blue: #075da8;
  --blue-deep: #073f72;
  --orange: #bd3513;
  --green: #13705f;
  --line: rgba(20, 43, 58, 0.25);
  --soft-line: rgba(20, 43, 58, 0.12);
  --white: #fffdf7;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Segoe UI", Tahoma, sans-serif;
  --thai: "Kanit", Tahoma, sans-serif;
  --max: 1180px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 4.7rem, rgba(7, 93, 168, .08) 4.7rem 4.8rem, transparent 4.8rem),
    var(--paper);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 31px, rgba(20,43,58,.032) 31px 32px);
  z-index: -1;
}

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .7rem 1rem; color: white; background: var(--blue-deep); }
.skip-link:focus { top: 1rem; }
a { color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-lang="th"] { display: none !important; }
html[lang="th"] [data-lang="en"] { display: none !important; }
html[lang="th"] [data-lang="th"] { display: revert !important; }
html[lang="th"] body { font-family: var(--thai); }

.site-header {
  width: min(calc(100% - 3rem), var(--max));
  margin: 0 auto;
  min-height: 86px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .75rem; font-family: var(--display); font-size: 1.25rem; font-weight: 800; letter-spacing: .01em; text-decoration: none; text-transform: uppercase; }
.brand-mark { width: 2.35rem; height: 2.35rem; display: grid; place-items: center; color: var(--orange); }
.brand-mark svg { width: 100%; height: 100%; stroke-width: 2.3; }
.site-header nav { display: flex; gap: 1.7rem; }
.site-header nav a { font-size: .9rem; font-weight: 600; text-decoration: none; border-bottom: 1px solid transparent; }
.site-header nav a:hover { border-color: var(--orange); }
.language-switch { border: 1px solid var(--ink); background: transparent; color: var(--ink); min-width: 74px; padding: .55rem .65rem; font: 700 .75rem/1 var(--body); cursor: pointer; }
.language-switch:hover, .language-switch:focus-visible { color: var(--white); background: var(--ink); }
.language-switch .language-active { color: var(--orange); }

main, footer { width: min(calc(100% - 3rem), var(--max)); margin-inline: auto; }
.error-page { min-height: 80vh; display: grid; place-items: center; }
.hero { min-height: 700px; display: grid; grid-template-columns: minmax(0, 1.13fr) minmax(340px, .72fr); gap: clamp(3rem, 8vw, 8rem); align-items: center; padding: 6.5rem 0 7.5rem; }
.location-line { display: flex; align-items: center; gap: .55rem; color: var(--blue-deep); font-size: .88rem; font-weight: 700; }
.location-line svg { width: 1.25rem; height: 1.25rem; color: var(--orange); }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 12ch; margin: 1.2rem 0 1.5rem; font-family: var(--display); font-size: clamp(4.15rem, 8vw, 6rem); line-height: .88; letter-spacing: -.025em; text-transform: uppercase; text-wrap: balance; }
h1 em { color: var(--blue); font-style: normal; }
.hero-lede { max-width: 63ch; color: var(--ink-muted); font-size: clamp(1.02rem, 1.6vw, 1.22rem); }
.hero-actions { display: flex; align-items: center; gap: 1.4rem; margin: 2rem 0 1.8rem; }
.primary-action { display: inline-flex; align-items: center; justify-content: space-between; gap: 1rem; min-width: 250px; padding: .95rem 1.1rem; color: var(--white); background: var(--blue); font-weight: 700; text-decoration: none; box-shadow: 0 8px 22px rgba(7,63,114,.18); transition: background .2s, box-shadow .2s, transform .2s var(--ease); }
.primary-action svg { width: 1.3rem; }
.primary-action:hover { background: var(--blue-deep); transform: translateY(-2px); box-shadow: 0 11px 28px rgba(7,63,114,.24); }
.text-action { font-size: .9rem; font-weight: 700; text-underline-offset: .25rem; }
.hero-assurances { display: flex; flex-wrap: wrap; gap: .7rem 1.25rem; padding: 0; margin: 0; list-style: none; font-size: .78rem; font-weight: 600; }
.hero-assurances li { display: flex; align-items: center; gap: .4rem; }
.tick { color: var(--green); font-weight: 800; }

.work-order { position: relative; padding: 2.4rem 2.2rem 2rem; background: var(--white); border: 1px solid rgba(20,43,58,.2); box-shadow: 0 18px 50px rgba(20,43,58,.16); transform: rotate(1.1deg); }
.work-order::after { content: ""; position: absolute; inset: 9px; border: 1px solid var(--soft-line); pointer-events: none; }
.clip { position: absolute; top: -17px; left: 50%; width: 108px; height: 34px; transform: translateX(-50%); background: #8f9da2; border-radius: 8px 8px 3px 3px; box-shadow: 0 5px 10px rgba(20,43,58,.22); }
.ticket-head { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1.1rem; border-bottom: 2px solid var(--ink); }
.ticket-head > div:first-child { display: grid; }
.ticket-head span, .ticket-business span { color: var(--ink-muted); font-size: .68rem; font-weight: 700; letter-spacing: .12em; }
.ticket-head strong { font: 800 1.9rem/1 var(--display); letter-spacing: .03em; }
.status-stamp { align-self: start; padding: .4rem .55rem; color: var(--orange); border: 2px solid var(--orange); font: 800 1rem/1 var(--display); text-align: center; transform: rotate(-5deg); }
.ticket-business { display: grid; gap: .25rem; padding: 1.25rem 0; border-bottom: 1px dashed var(--line); }
.ticket-business strong { font-size: 1rem; }
.inspection-list { list-style: none; padding: 0; margin: .4rem 0 1.3rem; }
.inspection-list li { display: grid; grid-template-columns: 2.5rem 1fr; gap: .75rem; padding: .9rem 0; border-bottom: 1px solid var(--soft-line); }
.inspection-list li > span { display: grid; place-items: center; align-self: start; width: 2rem; height: 2rem; color: var(--blue); border: 1px solid var(--blue); font: 700 .8rem/1 var(--display); }
.inspection-list li.done > span { color: white; background: var(--green); border-color: var(--green); }
.inspection-list div { display: grid; gap: .1rem; }
.inspection-list strong { font-size: .88rem; }
.inspection-list small { color: var(--ink-muted); font-size: .7rem; }
.ticket-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding-top: .9rem; border-top: 2px solid var(--ink); }
.ticket-foot span { color: var(--ink-muted); font: 600 .75rem/1 var(--display); }
.ticket-foot strong { color: var(--orange); font: 800 1.1rem/1 var(--display); }

section { scroll-margin-top: 2rem; }
.section-rule { padding: 7rem 0; border-top: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: 1.1fr .7fr; gap: 4rem; align-items: end; margin-bottom: 3.2rem; }
.section-heading h2, .protocol h2, .questions h2, .contact h2 { margin: 0; font-family: var(--display); font-size: clamp(2.8rem, 5vw, 4.5rem); line-height: .96; letter-spacing: -.02em; text-transform: uppercase; text-wrap: balance; }
.section-heading p, .protocol-copy > p { margin: 0; color: var(--ink-muted); max-width: 56ch; }
.repair-register { border-top: 2px solid var(--ink); }
.repair-register article { display: grid; grid-template-columns: 6rem 1fr auto; gap: 2rem; align-items: center; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.repair-register article:hover { background: rgba(255,253,247,.5); }
.repair-code { align-self: start; color: var(--blue); font: 700 .82rem/1 var(--display); letter-spacing: .08em; }
.repair-register h3 { margin: 0 0 .25rem; font: 700 1.45rem/1.15 var(--display); text-transform: uppercase; }
.repair-register p { margin: 0; color: var(--ink-muted); font-size: .9rem; }
.repair-state { padding: .35rem .65rem; color: var(--green); border: 1px solid var(--green); font-size: .72rem; font-weight: 700; text-transform: uppercase; }

.protocol { display: grid; grid-template-columns: .78fr 1.22fr; gap: clamp(3rem, 9vw, 8rem); padding: 7rem 0; }
.protocol-copy { position: sticky; top: 2rem; align-self: start; }
.protocol-copy > p { margin-top: 1.5rem; }
.protocol-board { border-top: 2px solid var(--blue-deep); }
.protocol-row { display: grid; grid-template-columns: 3.3rem 1fr; gap: 1.2rem; padding: 1.65rem 0; border-bottom: 1px solid var(--line); }
.protocol-check { display: grid; place-items: center; align-self: start; width: 2.8rem; height: 2.8rem; color: var(--white); background: var(--blue); font: 800 1.2rem/1 var(--display); }
.protocol-row strong { display: block; font: 700 1.35rem/1.2 var(--display); text-transform: uppercase; }
.protocol-row p { margin: .35rem 0 0; color: var(--ink-muted); font-size: .9rem; }

.section-heading.compact { margin-bottom: 2.4rem; }
.price-sheet { border-top: 2px solid var(--ink); }
.price-sheet > div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2rem; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.price-sheet > div > span { font: 700 clamp(1.25rem, 2.2vw, 1.65rem)/1.1 var(--display); text-transform: uppercase; }
.price-sheet strong { color: var(--blue-deep); font: 800 clamp(2rem, 4vw, 3.4rem)/1 var(--display); white-space: nowrap; }
.price-sheet small { color: var(--ink-muted); font: 600 .7rem/1 var(--body); text-transform: uppercase; }
.tax-note { max-width: 70ch; margin: 1.2rem 0 0 auto; color: var(--ink-muted); font-size: .75rem; text-align: right; }

.questions { display: grid; grid-template-columns: .65fr 1fr; gap: clamp(3rem, 10vw, 9rem); padding: 7rem 0; border-top: 1px solid var(--line); }
.faq-list { border-top: 2px solid var(--ink); }
details { border-bottom: 1px solid var(--line); }
summary { position: relative; padding: 1.4rem 2.5rem 1.4rem 0; font-weight: 700; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: .2rem; top: 1.15rem; color: var(--blue); font: 700 1.7rem/1 var(--display); }
details[open] summary::after { content: "–"; }
details p { max-width: 68ch; padding: 0 2.5rem 1.4rem 0; margin: 0; color: var(--ink-muted); font-size: .9rem; }

.contact { display: grid; grid-template-columns: .72fr 1.15fr; align-items: start; gap: clamp(3rem, 7vw, 6rem); margin-bottom: 4rem; padding: clamp(2.5rem, 5vw, 4rem); color: var(--white); background: var(--blue-deep); box-shadow: 0 16px 42px rgba(7,63,114,.2); }
.contact h2 { max-width: 12ch; }
.contact-intro > p { max-width: 55ch; margin: 1rem 0 0; color: #d8e8f4; }
.privacy-note { display: flex; align-items: flex-start; gap: .65rem; margin-top: 2rem; color: #d8e8f4; font-size: .76rem; line-height: 1.45; }
.privacy-note svg { flex: 0 0 1.15rem; width: 1.15rem; margin-top: .1rem; }
.repair-form { position: relative; padding: clamp(1.5rem, 3vw, 2.4rem); color: var(--ink); background: var(--white); box-shadow: 0 12px 30px rgba(0,25,50,.2); }
.repair-form::before { content: attr(data-label-en); display: block; margin-bottom: 1.6rem; padding-bottom: .7rem; border-bottom: 2px solid var(--ink); color: var(--blue-deep); font: 800 .82rem/1 var(--display); letter-spacing: .12em; }
html[lang="th"] .repair-form::before { content: attr(data-label-th); font-family: var(--thai); letter-spacing: 0; }
.trap-field { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.form-field { display: grid; align-content: start; gap: .42rem; }
.form-wide { grid-column: 1 / -1; }
.form-field label { font-size: .74rem; font-weight: 700; }
.optional { color: var(--ink-muted); font-size: .65rem; font-weight: 500; }
.form-field input, .form-field textarea { width: 100%; border: 1px solid rgba(20,43,58,.38); border-radius: 0; padding: .75rem .8rem; color: var(--ink); background: #fffefa; font: 500 .9rem/1.4 var(--body); transition: border-color .18s, box-shadow .18s; }
html[lang="th"] .form-field input, html[lang="th"] .form-field textarea { font-family: var(--thai); }
.form-field textarea { min-height: 9rem; resize: vertical; }
.form-field input:hover, .form-field textarea:hover { border-color: var(--blue); }
.form-field input:focus, .form-field textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(7,93,168,.16); }
.form-field input[aria-invalid="true"], .form-field textarea[aria-invalid="true"] { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(189,53,19,.13); }
.field-error { min-height: 1.1em; color: #a62d0e; font-size: .68rem; }
.field-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--ink-muted); font-size: .68rem; }
.field-meta .field-error { flex: 1; }
.form-submit-row { margin-top: 1.4rem; }
.form-submit { display: inline-flex; align-items: center; justify-content: space-between; gap: 1rem; min-width: 225px; padding: .9rem 1rem; border: 0; color: var(--white); background: var(--blue); font: 700 .82rem/1.2 var(--body); cursor: pointer; box-shadow: 0 7px 18px rgba(7,63,114,.17); transition: background .18s, transform .18s var(--ease); }
html[lang="th"] .form-submit { font-family: var(--thai); }
.form-submit:hover { background: var(--blue-deep); transform: translateY(-1px); }
.form-submit:disabled { color: #c9d7e2; background: #496a83; cursor: wait; transform: none; box-shadow: none; }
.form-submit svg { width: 1.15rem; }
.form-status { min-height: 1.4rem; margin: .75rem 0 0; color: var(--ink-muted); font-size: .75rem; }
.repair-form.is-success { outline: 3px solid var(--green); outline-offset: -3px; }
.repair-form.is-success .form-status { color: var(--green); font-weight: 700; }
.repair-form.is-error .form-status { color: #a62d0e; font-weight: 700; }

footer { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 2rem; min-height: 120px; border-top: 1px solid var(--line); font-size: .78rem; }
footer p { margin: 0; color: var(--ink-muted); }
.footer-brand { font-size: 1rem; }

.back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .65rem .8rem;
  border: 1px solid var(--blue-deep);
  color: var(--white);
  background: var(--blue-deep);
  font: 700 .72rem/1 var(--body);
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(20,43,58,.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(.75rem);
  pointer-events: none;
  transition: opacity .18s, visibility .18s, transform .18s var(--ease), background .18s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--blue); }
.back-to-top svg { width: 1rem; height: 1rem; }
html[lang="th"] .back-to-top { font-family: var(--thai); text-transform: none; }

html[lang="th"] h1,
html[lang="th"] .section-heading h2,
html[lang="th"] .protocol h2,
html[lang="th"] .questions h2,
html[lang="th"] .contact h2,
html[lang="th"] .repair-register h3,
html[lang="th"] .protocol-row strong,
html[lang="th"] .price-sheet > div > span {
  font-family: var(--thai);
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: none;
}
html[lang="th"] h1 { max-width: 13ch; font-weight: 700; }

@media (prefers-reduced-motion: no-preference) {
  .work-order {
    animation: work-order-arrival .8s var(--ease) both;
  }
  .status-stamp {
    animation: stamp-check .55s .48s var(--ease) both;
  }
}
@keyframes work-order-arrival {
  from { transform: translateY(22px) rotate(1.1deg); filter: blur(2px); box-shadow: 0 5px 18px rgba(20,43,58,.08); }
  to { transform: translateY(0) rotate(1.1deg); filter: blur(0); box-shadow: 0 18px 50px rgba(20,43,58,.16); }
}
@keyframes stamp-check {
  from { transform: scale(1.18) rotate(-9deg); filter: blur(1px); }
  to { transform: scale(1) rotate(-5deg); filter: blur(0); }
}

:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; } }

@media (max-width: 900px) {
  body { background: var(--paper); }
  .site-header { grid-template-columns: 1fr auto; min-height: 76px; }
  .site-header nav { display: none; }
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 5rem; padding: 5rem 0 6rem; }
  .hero-copy { max-width: 760px; }
  h1 { max-width: 11ch; }
  .work-order { width: min(100%, 520px); justify-self: center; }
  .section-heading, .protocol, .questions { grid-template-columns: 1fr; gap: 2.5rem; }
  .protocol-copy { position: static; }
  .contact { grid-template-columns: 1fr; }
  .contact-intro { max-width: 680px; }
  footer { grid-template-columns: 1fr auto; }
  footer p { display: none !important; }
}

@media (max-width: 620px) {
  .site-header, main, footer { width: min(calc(100% - 2rem), var(--max)); }
  .brand { font-size: 1rem; }
  .brand-mark { width: 2rem; height: 2rem; }
  .language-switch { min-width: 66px; }
  .hero { padding-top: 3.7rem; }
  h1 { font-size: clamp(3.45rem, 17vw, 4.7rem); }
  .hero-lede { font-size: 1rem; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .primary-action { min-width: 0; width: 100%; }
  .text-action { align-self: flex-start; }
  .hero-assurances { display: grid; }
  .work-order { padding: 2rem 1.25rem 1.4rem; }
  .ticket-head strong { font-size: 1.6rem; }
  .status-stamp { font-size: .85rem; }
  .section-rule, .protocol, .questions { padding: 5rem 0; }
  .section-heading { gap: 1.2rem; }
  .section-heading h2, .protocol h2, .questions h2, .contact h2 { font-size: 3rem; }
  .repair-register article { grid-template-columns: 4.2rem 1fr; gap: 1rem; }
  .repair-state { grid-column: 2; justify-self: start; }
  .price-sheet > div { grid-template-columns: 1fr; gap: .65rem; padding: 1.25rem 0; }
  .price-sheet strong { font-size: 2.6rem; }
  .tax-note { text-align: left; }
  .contact { margin-inline: -1rem; padding: 3rem 1rem; box-shadow: none; }
  .form-grid { grid-template-columns: 1fr; }
  .form-wide { grid-column: auto; }
  .repair-form { padding: 1.25rem; }
  .form-submit { width: 100%; }
  footer { grid-template-columns: 1fr; gap: .5rem; padding: 2rem 0; }
}
