:root {
  --green-950: #0c3b2b;
  --green-900: #124c37;
  --green-800: #176044;
  --green-700: #1d7651;
  --green-600: #278d5f;
  --lime: #91c73e;
  --blue: #178ba8;
  --blue-soft: #e8f7fb;
  --cream: #f7f5ec;
  --white: #fff;
  --ink: #183128;
  --muted: #64766f;
  --line: #dce7e1;
  --danger: #c5413a;
  --warning: #b56f12;
  --shadow: 0 18px 60px rgba(14, 65, 46, .13);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: var(--cream); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 86% 8%, rgba(23, 139, 168, .13), transparent 23rem),
    radial-gradient(circle at 7% 86%, rgba(145, 199, 62, .16), transparent 24rem),
    var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.shell {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img { display: block; width: min(330px, 64vw); height: auto; }

.kiosk-page { overflow-x: hidden; }

.kiosk-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 118px;
  gap: 24px;
}

.date-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border: 1px solid rgba(23, 96, 68, .13);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 8px 28px rgba(14, 65, 46, .07);
  backdrop-filter: blur(12px);
}

.date-chip .clock {
  color: var(--green-800);
  font-size: 1.45rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.date-chip .date { max-width: 210px; color: var(--muted); font-size: .86rem; line-height: 1.35; }

.welcome-grid {
  min-height: calc(100vh - 190px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  align-items: center;
  gap: clamp(44px, 8vw, 120px);
  padding: 34px 0 70px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--green-700);
  font-size: .84rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.eyebrow::before { content: ""; width: 34px; height: 3px; border-radius: 99px; background: var(--lime); }

.welcome-title {
  max-width: 900px;
  margin: 0;
  color: var(--green-950);
  font-size: clamp(3.1rem, 6vw, 6.8rem);
  letter-spacing: -.065em;
  line-height: .94;
}

.welcome-title span { display: block; color: var(--blue); }

.welcome-copy {
  max-width: 680px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.65;
}

.start-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 82px;
  margin-top: 38px;
  padding: 0 34px;
  gap: 18px;
  border-radius: 22px;
  color: var(--white);
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  box-shadow: 0 16px 34px rgba(29, 118, 81, .27);
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
}

.start-button:hover, .start-button:focus-visible { transform: translateY(-2px); box-shadow: 0 20px 40px rgba(29, 118, 81, .34); }
.start-button .arrow { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: rgba(255, 255, 255, .15); font-size: 1.4rem; }

.visitor-card {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  padding: 38px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: var(--radius-xl);
  color: var(--white);
  background: linear-gradient(155deg, var(--green-950), #16684d 62%, #197f89);
  box-shadow: var(--shadow);
}

.visitor-card::before,
.visitor-card::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 50%;
}
.visitor-card::before { width: 310px; height: 310px; right: -130px; top: -80px; }
.visitor-card::after { width: 190px; height: 190px; right: -60px; top: -24px; }

.visitor-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 20px; background: rgba(255,255,255,.13); font-size: 1.9rem; }
.visitor-label { margin: 54px 0 10px; color: rgba(255,255,255,.72); font-size: .92rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.visitor-count { margin: 0; font-size: clamp(4.5rem, 8vw, 7.5rem); font-weight: 800; line-height: 1; letter-spacing: -.06em; }
.visitor-unit { margin: 8px 0 0; color: rgba(255,255,255,.75); font-size: 1.08rem; }
.service-note { position: absolute; bottom: 34px; left: 38px; right: 38px; display: flex; align-items: center; gap: 12px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.16); color: rgba(255,255,255,.78); font-size: .92rem; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #b9e65e; box-shadow: 0 0 0 7px rgba(185,230,94,.1); }

.admin-link { position: fixed; right: 22px; bottom: 18px; color: #73877e; font-size: .82rem; text-decoration: none; opacity: .7; }
.admin-link:hover { opacity: 1; }

.form-page { padding-bottom: 40px; }
.form-header { display: flex; align-items: center; justify-content: space-between; min-height: 104px; gap: 22px; }
.back-link { display: inline-flex; align-items: center; min-height: 50px; padding: 0 18px; border: 1px solid var(--line); border-radius: 14px; color: var(--green-800); background: rgba(255,255,255,.78); font-weight: 700; text-decoration: none; }

.form-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start; gap: 28px; }
.step-sidebar { position: sticky; top: 24px; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255,255,255,.76); box-shadow: 0 14px 40px rgba(14,65,46,.07); }
.step-sidebar h2 { margin: 0 0 8px; color: var(--green-950); font-size: 1.3rem; }
.step-sidebar > p { margin: 0 0 26px; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.step-item { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; min-height: 62px; padding: 8px; border-radius: 14px; color: #71827b; transition: .2s ease; }
.step-number { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid #ccdcd4; border-radius: 13px; background: #fff; font-weight: 800; }
.step-item strong { display: block; font-size: .93rem; }
.step-item small { font-size: .76rem; }
.step-item.active { color: var(--green-900); background: #edf7ef; }
.step-item.active .step-number, .step-item.done .step-number { color: #fff; border-color: var(--green-700); background: var(--green-700); }
.step-item.done .step-number { font-size: 0; }
.step-item.done .step-number::after { content: "✓"; font-size: 1rem; }

.form-card { min-height: 660px; padding: clamp(26px, 4vw, 48px); border: 1px solid var(--line); border-radius: var(--radius-xl); background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.form-step { display: none; animation: fade-up .28s ease both; }
.form-step.active { display: block; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.section-kicker { margin: 0 0 8px; color: var(--green-700); font-size: .8rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.section-title { margin: 0; color: var(--green-950); font-size: clamp(1.8rem, 3vw, 2.65rem); letter-spacing: -.035em; }
.section-description { max-width: 720px; margin: 12px 0 34px; color: var(--muted); line-height: 1.6; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.field-group { display: grid; gap: 9px; }
.field-group.full { grid-column: 1 / -1; }
.field-label { color: var(--ink); font-size: .94rem; font-weight: 750; }
.field-label .required { color: var(--danger); }
.field-hint { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.input, .select, .textarea {
  width: 100%; min-height: 60px; padding: 0 17px;
  border: 1.5px solid #cbdad3; border-radius: 15px;
  color: var(--ink); background: #fbfdfc; outline: 0;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.textarea { min-height: 112px; padding-top: 15px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green-600); background: #fff; box-shadow: 0 0 0 4px rgba(39,141,95,.12); }
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(197,65,58,.08); }
.error-text { display: none; color: var(--danger); font-size: .78rem; }
.invalid + .error-text { display: block; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-card { position: relative; display: flex; align-items: center; min-height: 68px; padding: 14px 16px; gap: 13px; border: 1.5px solid var(--line); border-radius: 16px; background: #fbfdfc; cursor: pointer; transition: .16s ease; }
.choice-card:hover { border-color: #94bfa7; background: #f6fbf7; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-mark { display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 auto; border: 2px solid #aebfb7; border-radius: 50%; }
.choice-card input:checked + .choice-mark { border-color: var(--green-700); box-shadow: inset 0 0 0 6px var(--green-700); }
.choice-card:has(input:checked) { border-color: var(--green-600); background: #eff8f1; }
.choice-grid.invalid { padding: 7px; border: 1.5px solid var(--danger); border-radius: 18px; background: #fff5f4; }
.choice-card span:last-child { font-size: .92rem; font-weight: 700; line-height: 1.3; }

.capture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.capture-card { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: #f8fbf9; }
.capture-card h3 { margin: 0 0 6px; color: var(--green-950); font-size: 1.15rem; }
.capture-card > p { min-height: 42px; margin: 0 0 16px; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.camera-frame { position: relative; overflow: hidden; display: grid; place-items: center; aspect-ratio: 4/3; border-radius: 17px; background: #dbe9e2; }
.camera-frame video, .camera-frame img { width: 100%; height: 100%; object-fit: cover; }
.camera-placeholder { display: grid; place-items: center; gap: 8px; color: #70867c; text-align: center; }
.camera-placeholder span { font-size: 2.2rem; }
.camera-frame.active .camera-placeholder { display: none; }
.camera-frame:not(.active) video { display: none; }
.camera-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.mini-btn { min-height: 46px; padding: 0 15px; border: 1px solid #bdd0c6; border-radius: 12px; color: var(--green-800); background: #fff; font-weight: 750; cursor: pointer; }
.mini-btn.primary { color: #fff; border-color: var(--green-700); background: var(--green-700); }
.mini-btn.danger { color: var(--danger); }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.signature-wrap { position: relative; overflow: hidden; height: 240px; border: 2px dashed #adc2b7; border-radius: 17px; background: #fff; touch-action: none; }
.signature-wrap canvas { width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.signature-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #98aaa1; pointer-events: none; }
.signature-wrap.signed .signature-placeholder { display: none; }

.consent-box { display: flex; align-items: flex-start; gap: 12px; margin-top: 18px; padding: 15px; border-radius: 14px; background: #edf4f0; color: #465d52; font-size: .83rem; line-height: 1.5; }
.consent-box input { width: 21px; height: 21px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--green-700); }
.consent-box.hidden { display: none; }

.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.summary-item { min-height: 78px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 15px; background: #f9fbfa; }
.summary-item.full { grid-column: 1 / -1; }
.summary-item small { display: block; margin-bottom: 5px; color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.summary-item strong { display: block; color: var(--green-950); line-height: 1.4; word-break: break-word; }
.privacy-final { margin-top: 20px; }

.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 60px; padding: 0 24px; border: 0; border-radius: 15px; font-weight: 800; cursor: pointer; text-decoration: none; transition: .16s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-secondary { color: var(--green-800); background: #eaf3ee; }
.btn-primary { color: #fff; background: var(--green-700); box-shadow: 0 10px 24px rgba(29,118,81,.2); }
.btn-primary:disabled { cursor: wait; opacity: .7; transform: none; }
.global-error { display: none; margin: 18px 0; padding: 15px 17px; border: 1px solid #ebbbb8; border-radius: 14px; color: #8a2924; background: #fff1f0; font-size: .9rem; }
.global-error.visible { display: block; }

.success-page { display: grid; place-items: center; min-height: 100vh; padding: 32px; }
.success-card { width: min(680px, 100%); padding: clamp(34px, 6vw, 68px); border: 1px solid var(--line); border-radius: 34px; background: rgba(255,255,255,.95); box-shadow: var(--shadow); text-align: center; }
.success-check { display: grid; place-items: center; width: 100px; height: 100px; margin: 0 auto 26px; border-radius: 32px; color: #fff; background: linear-gradient(145deg, var(--green-600), var(--blue)); box-shadow: 0 16px 32px rgba(23,139,168,.2); font-size: 3rem; font-weight: 800; }
.success-card h1 { margin: 0; color: var(--green-950); font-size: clamp(2rem, 5vw, 3.3rem); letter-spacing: -.045em; }
.success-card > p { margin: 16px auto 28px; color: var(--muted); font-size: 1.04rem; line-height: 1.65; }
.visit-code { margin: 0 0 28px; padding: 18px; border: 1px dashed #9abbaa; border-radius: 16px; background: #f2f8f4; }
.visit-code small { display: block; color: var(--muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.visit-code strong { display: block; margin-top: 5px; color: var(--green-800); font-size: 1.4rem; letter-spacing: .04em; }
.countdown { margin-top: 20px; color: #819188; font-size: .82rem; }

.noscript { margin: 20px; padding: 20px; border-radius: 14px; color: #7a2621; background: #fff1ef; }
.system-alert { margin: 16px 0; padding: 15px 18px; border: 1px solid #ecd2ad; border-radius: 14px; color: #7b4a0d; background: #fff7e9; }
.sr-only { position: absolute; overflow: hidden; width: 1px; height: 1px; padding: 0; border: 0; margin: -1px; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 980px) {
  .welcome-grid { grid-template-columns: 1fr; gap: 36px; padding-top: 60px; }
  .visitor-card { min-height: 330px; }
  .form-layout { grid-template-columns: 1fr; }
  .step-sidebar { position: static; padding: 15px; }
  .step-sidebar h2, .step-sidebar > p, .step-item small { display: none; }
  .steps { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .step-item { display: flex; justify-content: center; min-height: auto; padding: 5px; }
  .step-item strong { display: none; }
  .capture-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1400px); }
  .kiosk-topbar, .form-header { min-height: 86px; }
  .date-chip .date { display: none; }
  .date-chip { padding: 10px 13px; }
  .date-chip .clock { font-size: 1rem; }
  .welcome-grid { min-height: calc(100vh - 110px); padding: 22px 0 72px; }
  .welcome-title { font-size: clamp(3rem, 16vw, 4.8rem); }
  .visitor-card { min-height: 310px; padding: 28px; }
  .service-note { left: 28px; right: 28px; bottom: 27px; }
  .field-grid, .choice-grid, .summary-grid { grid-template-columns: 1fr; }
  .field-group.full, .summary-item.full { grid-column: auto; }
  .form-card { min-height: auto; padding: 24px 18px; border-radius: 22px; }
  .form-actions { flex-wrap: wrap-reverse; }
  .form-actions .btn { flex: 1; min-width: 140px; }
  .brand img { width: 220px; }
  .back-link { min-height: 46px; padding: 0 14px; font-size: .85rem; }
}

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