:root {
  --navy: #071b33;
  --navy-2: #0d2b4c;
  --blue: #1378d4;
  --blue-soft: #e9f3fd;
  --red: #e12b2f;
  --ink: #182538;
  --muted: #637083;
  --line: #dce3eb;
  --surface: #ffffff;
  --canvas: #f4f7fa;
  --success: #15815d;
  --warning: #b86b12;
  --danger: #c83a3f;
  --shadow: 0 24px 70px rgba(7, 27, 51, 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: linear-gradient(150deg, #f8fafc 0%, #eef4f9 60%, #f6f8fb 100%); }
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }

.site-header {
  height: 84px;
  padding: 0 clamp(22px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(7,27,51,.08);
  position: relative;
  z-index: 3;
}

.brand { display: flex; gap: 13px; align-items: center; color: var(--navy); text-decoration: none; }
.brand-logo { display: block; width: 150px; height: 76px; object-fit: cover; object-position: center; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 14px; letter-spacing: .01em; }
.brand-copy small { color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.language-switch { display: flex; padding: 3px; background: #edf2f7; border-radius: 9px; }
.language-button { width: 36px; height: 34px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 850; }
.language-button.active { color: var(--navy); background: white; box-shadow: 0 2px 8px rgba(7,27,51,.1); }

.button {
  min-height: 46px; padding: 0 20px; border: 0; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center; gap: 9px; font-weight: 720; transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--blue); box-shadow: 0 8px 18px rgba(19,120,212,.22); }
.button-primary:hover { background: #096abd; box-shadow: 0 10px 24px rgba(19,120,212,.28); }
.button-secondary { color: var(--navy); background: white; border: 1px solid var(--line); }
.button-ghost { color: var(--navy); background: transparent; border: 1px solid var(--line); }
.full-button { width: 100%; }

.hero {
  min-height: calc(100vh - 140px);
  max-width: 1380px;
  padding: clamp(50px, 7vw, 96px) clamp(22px, 5vw, 72px);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(300px, .82fr) minmax(560px, 1.18fr);
  gap: clamp(44px, 7vw, 100px);
  align-items: start;
}
.hero-copy { padding-top: 34px; }
.eyebrow, .kicker { color: var(--blue); font-size: 12px; letter-spacing: .15em; text-transform: uppercase; font-style: normal; font-weight: 850; }
.hero h1, .admin-topbar h1 { margin: 16px 0 18px; color: var(--navy); font-size: clamp(38px, 5vw, 66px); line-height: .99; letter-spacing: -.045em; max-width: 690px; }
.hero-copy > p { max-width: 620px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.65; }
.hero-copy > p.hero-secondary { margin-top: 16px; font-size: 15px; line-height: 1.6; }
.benefit-row { margin: 34px 0; display: flex; flex-wrap: wrap; gap: 13px 24px; }
.benefit-row span { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--navy-2); font-weight: 650; }
.benefit-row b { color: var(--blue); font-size: 11px; }
.benefit-row em { font-style: normal; }
.support-card { margin-top: 28px; max-width: 580px; display: flex; gap: 14px; padding: 18px 20px; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 14px; }
.support-icon { flex: 0 0 auto; width: 27px; height: 27px; border-radius: 50%; background: var(--navy); color: white; display: grid; place-items: center; font-weight: 800; }
.support-card strong { font-size: 13px; color: var(--navy); }
.support-card p { font-size: 12px; color: var(--muted); margin: 5px 0 0; line-height: 1.5; }

.form-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); border: 1px solid rgba(7,27,51,.07); overflow: hidden; }
.step-indicator { display: flex; align-items: center; justify-content: center; padding: 24px 34px 20px; background: #f9fbfd; border-bottom: 1px solid var(--line); }
.step { display: flex; align-items: center; gap: 8px; color: #8a96a7; }
.step b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #e4e9ef; font-size: 12px; }
.step em { font-size: 12px; font-style: normal; font-weight: 720; }
.step.active { color: var(--navy); }
.step.active b { background: var(--blue); color: white; }
.step.complete b { background: var(--success); color: white; }
.step-line { width: clamp(25px, 4vw, 68px); height: 1px; background: var(--line); margin: 0 12px; }
.form-step { display: none; padding: 32px clamp(24px, 4vw, 44px) 38px; }
.form-step.active { display: block; animation: fade-in .25s ease; }
.form-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 26px; }
.form-heading h2, .success-state h2, dialog h2 { margin: 7px 0 0; color: var(--navy); font-size: 25px; letter-spacing: -.025em; }
.text-button { padding: 5px; border: 0; background: transparent; color: var(--blue); font-size: 12px; font-weight: 750; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 19px 18px; }
.field { display: grid; gap: 8px; }
.field.full, .check-field.full { grid-column: 1 / -1; }
.field > span { color: #29364a; font-size: 12px; font-weight: 740; }
.field i, .check-field i { color: var(--red); font-style: normal; }
input, textarea, select {
  width: 100%; border: 1px solid #ccd5df; border-radius: 9px; padding: 12px 13px; color: var(--ink); background: white; outline: 0; transition: .16s ease;
}
input { min-height: 46px; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(19,120,212,.11); }
input.invalid, textarea.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(200,58,63,.08); }
input.valid { border-color: var(--success); }
.field-message { min-height: 14px; color: var(--muted); font-size: 11px; }
.field-message.error { color: var(--danger); }
.field-message.success { color: var(--success); }
.input-with-status { position: relative; }
.input-with-status input { padding-right: 38px; }
#serialStatus { position: absolute; right: 13px; top: 12px; color: var(--success); font-weight: 900; }
.upload-field { position: relative; }
.upload-field > input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }
.upload-field:has(input:focus-visible) .upload-box { outline: 2px solid var(--blue); outline-offset: 2px; }
.remove-proof { justify-self: start; font-size: 14px; }
.remove-proof[hidden] { display: none; }
.upload-box { min-height: 46px; padding: 10px 13px; display: flex; align-items: center; gap: 9px; border: 1px dashed #aebbc9; border-radius: 9px; background: #f9fbfd; color: var(--blue); font-size: 12px; font-weight: 760; cursor: pointer; overflow: hidden; }
.upload-box b { width: 25px; height: 25px; border-radius: 7px; display: grid; place-items: center; background: var(--blue-soft); font-size: 15px; }
.upload-box span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-field > small { color: var(--muted); font-size: 10px; }
.choice-group { margin: 2px 0 0; padding: 0; border: 0; }
.choice-group.full { grid-column: 1 / -1; }
.choice-group legend { margin-bottom: 10px; color: #29364a; font-size: 12px; font-weight: 740; }
.choice-group legend i { color: var(--red); font-style: normal; }
.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card { position: relative; min-height: 68px; padding: 13px 15px; display: flex; gap: 11px; align-items: center; border: 1px solid #ccd5df; border-radius: 10px; cursor: pointer; transition: .16s ease; }
.choice-card:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 2px rgba(19,120,212,.08); }
.choice-card input { width: 16px; height: 16px; min-height: 0; margin: 0; flex: 0 0 auto; accent-color: var(--blue); }
.choice-card span { display: grid; gap: 2px; }
.choice-card b { color: var(--navy); font-size: 13px; }
.choice-card small { color: var(--muted); font-size: 10px; }
.choice-group.invalid .choice-card { border-color: var(--danger); }
.upload-field:has(input.invalid) .upload-box { border-color: var(--danger); color: var(--danger); }
.check-field { display: flex; align-items: flex-start; gap: 10px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.check-field input { width: 16px; height: 16px; min-height: 0; margin-top: 1px; flex: 0 0 auto; }
.legal-check a { color: var(--blue); font-weight: 700; }
.optional-check { padding-top: 4px; border-top: 1px solid #edf0f4; }
.data-notice { margin-top: 20px; padding: 12px 14px; display: flex; gap: 10px; border-radius: 10px; background: #f5f8fb; color: var(--muted); }
.data-notice > span { width: 21px; height: 21px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: white; font-size: 11px; font-weight: 800; }
.data-notice p { margin: 1px 0 0; font-size: 10px; line-height: 1.5; }
.data-notice a { color: var(--blue); font-weight: 700; }
.form-actions { display: flex; margin-top: 28px; }
.form-actions.right { justify-content: flex-end; }
.form-actions.split { justify-content: space-between; gap: 12px; }
.form-error { min-height: 18px; color: var(--danger); font-size: 12px; font-weight: 650; }

.success-state { padding: 52px clamp(28px, 5vw, 58px) 58px; text-align: center; animation: fade-in .25s ease; }
.success-icon { width: 62px; height: 62px; margin: 0 auto 24px; display: grid; place-items: center; background: #def5ec; color: var(--success); font-size: 29px; font-weight: 900; border-radius: 50%; }
.success-state > p { color: var(--muted); line-height: 1.6; }
.success-state > p.demo-email-note { margin: -10px 0 24px; padding: 10px 12px; border-radius: 8px; background: #f5f8fb; font-size: 10px; }
.receipt { margin: 28px 0; padding: 8px 22px; background: #f6f9fb; border-radius: 13px; text-align: left; }
.receipt div { display: flex; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.receipt div:last-child { border: 0; }
.receipt span { color: var(--muted); font-size: 12px; }
.receipt strong { color: var(--navy); font-size: 13px; text-align: right; }

.admin-view { max-width: 1380px; min-height: calc(100vh - 140px); padding: 54px clamp(22px, 5vw, 72px) 80px; margin: auto; }
.admin-topbar { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 32px; }
.admin-topbar h1 { font-size: clamp(35px, 4vw, 52px); margin: 10px 0 7px; }
.admin-topbar p { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.metric { padding: 21px 23px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 28px rgba(7,27,51,.05); }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 6px; color: var(--navy); font-size: 30px; letter-spacing: -.03em; }
.metric strong.warning { color: var(--warning); }
.metric strong.danger { color: var(--danger); }
.dashboard-card { background: white; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 12px 40px rgba(7,27,51,.06); }
.dashboard-toolbar { padding: 18px; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.search-field { position: relative; flex: 1; max-width: 480px; }
.search-field span { position: absolute; left: 14px; top: 10px; font-size: 22px; color: var(--muted); }
.search-field input { padding-left: 42px; }
.dashboard-toolbar select { width: auto; min-width: 190px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 860px; border-collapse: collapse; }
th, td { padding: 16px 20px; text-align: left; border-bottom: 1px solid #edf0f4; }
th { color: var(--muted); background: #fbfcfd; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; }
td { color: #364256; font-size: 12px; }
td strong { display: block; color: var(--navy); font-size: 13px; margin-bottom: 3px; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 99px; font-size: 10px; font-weight: 800; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--success); background: #e7f6f0; }
.status.upcoming { color: var(--warning); background: #fff3df; }
.status.overdue { color: var(--danger); background: #fdebed; }
.reminder-badge { display: inline-flex; padding: 5px 8px; border-radius: 99px; background: #e9f3fd; color: var(--blue); font-size: 10px; font-weight: 800; }
.reminder-badge.off { background: #f1f3f5; color: var(--muted); }
.empty-state { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.prototype-note { margin: 0; padding: 14px 20px; color: var(--muted); background: #fbfcfd; font-size: 10px; }

footer { min-height: 58px; padding: 16px clamp(22px, 5vw, 72px); display: flex; justify-content: space-between; align-items: center; gap: 20px; color: #788497; font-size: 10px; border-top: 1px solid rgba(7,27,51,.07); background: rgba(255,255,255,.45); }
dialog { width: min(430px, calc(100vw - 34px)); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 34px 100px rgba(7,27,51,.3); }
dialog::backdrop { background: rgba(4,16,31,.58); backdrop-filter: blur(3px); }
dialog form { position: relative; padding: 36px; }
dialog p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.dialog-close { position: absolute; right: 16px; top: 13px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f1f4f7; color: var(--muted); font-size: 22px; }
.pin-hint { padding: 9px 11px; background: var(--blue-soft); border-radius: 8px; color: var(--navy); }

@keyframes fade-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding-top: 36px; }
  .hero-copy { padding-top: 0; }
  .hero h1 { max-width: 720px; }
}
@media (max-width: 650px) {
  .site-header { height: 74px; }
  .brand-copy { display: none; }
  .header-actions { gap: 7px; }
  .language-button { width: 31px; }
  .button-ghost { padding: 0 14px; }
  .hero { padding: 35px 16px 60px; gap: 36px; }
  .hero h1 { font-size: 39px; }
  .hero-copy > p { font-size: 16px; }
  .step-indicator { padding-inline: 15px; }
  .step em { display: none; }
  .step-line { width: 34px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full, .check-field.full, .choice-group.full { grid-column: auto; }
  .choice-row { grid-template-columns: 1fr; }
  .form-heading { align-items: start; }
  .form-heading .text-button { max-width: 100px; text-align: right; }
  .form-actions.split { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .receipt div { align-items: start; }
  .admin-view { padding: 36px 16px 60px; }
  .admin-topbar { align-items: start; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .dashboard-toolbar { flex-direction: column; }
  .search-field, .dashboard-toolbar select { width: 100%; max-width: none; }
  footer { flex-direction: column; align-items: start; }
}

.example-notice { margin: 0 0 16px; padding: 12px 16px; border-radius: 8px; background: var(--blue-soft); color: var(--navy); font-size: 14px; }
.example-notice[hidden] { display: none; }

.reviews-dialog { width: min(620px, calc(100% - 32px)); max-height: 85vh; overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 14px; color: var(--navy); }
.reviews-dialog::backdrop { background: rgba(7,27,51,.5); }
.reviews-dialog form { display: grid; gap: 16px; margin: 20px 0; }
.reviews-dialog form[hidden] { display: none; }
.reviews-dialog textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; font: inherit; }
.review-entry { border-top: 1px solid var(--line); padding: 16px 0; }
.review-entry p { white-space: pre-wrap; overflow-wrap: anywhere; }
.review-entry small { overflow-wrap: anywhere; }

/* Public form and internal portal are separate documents. */
[hidden] { display: none !important; }
.hero { min-height: 100vh; padding-top: clamp(28px, 5vw, 64px); }
.form-column { min-width: 0; }
.form-language-toolbar, .portal-language-toolbar { display:flex; justify-content:flex-end; margin-bottom:14px; }
.language-switch { background:#e4edf7; border:1px solid #c6d7e8; padding:4px; }
.language-button { width:auto; min-width:88px; min-height:42px; padding:8px 14px; font-size:13px; }
.language-button:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
.reviews-dialog { position:fixed; padding-top:28px; }
.reviews-dialog > h2 { padding-right:44px; }
.reviews-dialog .dialog-close { top:14px; right:14px; min-height:36px; width:36px; height:36px; z-index:1; }
.reviews-dialog form { padding:0; }
#reviewNotice { white-space:pre-line; }
@media(max-width:650px){ .language-button { min-width:84px; } }

.table-button { min-height:38px; padding:9px 13px; font-size:12px; text-align:center; }
.record-actions { display:flex; flex-direction:column; align-items:flex-start; gap:9px; }
.button-danger { color:#fff; background:#b82330; }
.button-danger:hover { background:#961c27; }
.button:disabled { opacity:.5; cursor:not-allowed; transform:none; }
.delete-actions { display:flex; justify-content:flex-end; gap:12px; flex-wrap:wrap; }
.delete-dialog #deleteError { color:var(--danger); }
.admin-topbar { flex-wrap:wrap; }

/* Portal actions remain within the table's own scroll area at every viewport. */
.admin-view .dashboard-card { position:relative; isolation:isolate; }
.admin-view .table-wrap { position:relative; width:100%; overflow-x:auto; }
.admin-view .table-button, .admin-view .button-delete-record { position:relative; z-index:1; pointer-events:auto; touch-action:manipulation; }
.admin-view td { vertical-align:top; }
.status-reminders { display:block; margin-top:8px; color:var(--muted); font-size:11px; line-height:1.5; min-width:135px; }
.button-delete-record { display:inline-block; min-height:32px; padding:6px 9px; border:1px solid var(--line); border-radius:6px; background:transparent; color:var(--muted); font:inherit; font-size:11px; cursor:pointer; }
.button-delete-record:hover, .button-delete-record:focus-visible { color:var(--danger); border-color:var(--danger); background:#fff7f7; }
.delete-record-cell { text-align:right; }
