:root {
  color-scheme: light;
  --navy: #082b55;
  --navy-2: #0d3c70;
  --blue: #0a69a8;
  --blue-soft: #eaf5fb;
  --cyan: #12a8c4;
  --orange: #f47721;
  --orange-soft: #fff3e9;
  --ink: #17283d;
  --muted: #69798d;
  --paper: #f5f8fb;
  --white: #fff;
  --line: #dce5ed;
  --line-strong: #c8d6e2;
  --success: #168263;
  --success-soft: #e8f7f1;
  --danger: #b42318;
  --danger-soft: #fff0ef;
  --warning: #9a5a00;
  --shadow: 0 18px 55px rgba(8, 43, 85, .10);
  --shadow-soft: 0 7px 24px rgba(8, 43, 85, .07);
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header {
  position: sticky; top: 0; z-index: 30; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 14px clamp(20px, 5vw, 76px); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; min-width: 0; }
.brand-mark { width: 46px; height: 46px; display: grid; place-items: center; flex: none; border-radius: 13px; background: linear-gradient(145deg, var(--navy), var(--blue)); color: #fff; font-size: 13px; font-weight: 900; letter-spacing: -.03em; box-shadow: 0 8px 20px rgba(8,43,85,.2); }
.brand strong, .brand small { display: block; }
.brand strong { color: var(--navy); font-size: 15px; }
.brand small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.header-link { color: var(--blue); font-size: 13px; font-weight: 800; text-decoration: none; }
.header-link:hover { color: var(--orange); }
.header-actions { display: flex; align-items: center; gap: 16px; }

.form-hero { max-width: 1320px; margin: 0 auto; padding: 64px clamp(20px, 5vw, 76px) 42px; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
.form-hero > div:first-child { max-width: 760px; }
.eyebrow { display: block; margin-bottom: 10px; color: var(--orange); font-size: 11px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.form-hero h1 { margin: 0; color: var(--navy); font-size: clamp(34px, 5vw, 62px); line-height: 1.04; letter-spacing: -.045em; }
.form-hero p { max-width: 660px; margin: 22px 0 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.hero-meta { display: flex; gap: 10px; flex: none; }
.hero-meta div { min-width: 96px; padding: 18px 16px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.65); text-align: center; }
.hero-meta strong, .hero-meta span { display: block; }
.hero-meta strong { color: var(--navy); font-size: 22px; }
.hero-meta span { margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.form-layout { max-width: 1320px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 76px) 80px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 26px; align-items: start; }
.step-panel { position: sticky; top: 100px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow-soft); }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 12px; font-weight: 800; }
.progress-label strong { color: var(--blue); }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e7edf3; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); transition: width .25s ease; }
.step-nav { display: grid; gap: 7px; margin-top: 24px; }
.step-button { width: 100%; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; padding: 10px; border: 0; border-radius: 11px; background: transparent; cursor: pointer; text-align: left; }
.step-button:hover { background: var(--paper); }
.step-button.is-active { background: var(--blue-soft); color: var(--blue); }
.step-number { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 900; }
.step-button.is-active .step-number { border-color: var(--blue); background: var(--blue); color: #fff; }
.step-button.is-complete .step-number { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.step-copy strong, .step-copy span { display: block; }
.step-copy strong { font-size: 12px; }
.step-copy span { color: var(--muted); font-size: 10px; }
.save-note { display: flex; gap: 9px; margin-top: 24px; padding: 13px; border-radius: 11px; background: var(--success-soft); color: var(--success); }
.save-note > span { font-weight: 900; }
.save-note p { margin: 0; color: #387663; font-size: 10px; line-height: 1.5; }

.form-shell { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--white); box-shadow: var(--shadow); }
#registrationForm { padding: clamp(24px, 4vw, 48px); }
.form-section { display: none; animation: enter .28s ease both; }
.form-section.is-active { display: block; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.section-intro { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 34px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.section-index { width: 45px; height: 45px; display: grid; place-items: center; flex: none; border-radius: 14px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 900; }
.section-intro h2 { margin: 0 0 6px; color: var(--navy); font-size: 26px; letter-spacing: -.02em; }
.section-intro p { margin: 0; color: var(--muted); font-size: 14px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px 22px; }
.field { min-width: 0; }
.field.field-wide { grid-column: 1 / -1; }
.field-label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 850; }
.required { color: var(--orange); }
.field-help { display: block; margin: -3px 0 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.text-input, .select-input, .text-area {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 11px; background: #fbfdff; color: var(--ink); outline: 0; transition: border-color .15s, box-shadow .15s, background .15s;
}
.text-input, .select-input { height: 48px; padding: 0 14px; }
.text-area { min-height: 124px; resize: vertical; padding: 13px 14px; line-height: 1.6; }
.text-area.tall { min-height: 190px; }
.text-input:focus, .select-input:focus, .text-area:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(10,105,168,.11); }
.field.has-error .text-input, .field.has-error .select-input, .field.has-error .text-area, .field.has-error .choice-grid, .field.has-error .upload-box { border-color: var(--danger); }
.field-error { display: none; margin-top: 6px; color: var(--danger); font-size: 11px; font-weight: 700; }
.field.has-error .field-error { display: block; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 9px; border: 1px solid transparent; border-radius: 13px; }
.choice-grid.choice-list { grid-template-columns: 1fr; }
.choice { position: relative; display: flex; gap: 9px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 12px; font-weight: 650; line-height: 1.4; }
.choice:hover { border-color: var(--blue); background: var(--blue-soft); }
.choice input { margin: 2px 0 0; accent-color: var(--blue); }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); color: var(--navy); }
.other-input { margin-top: 9px; }
.conditional-field { padding: 16px; border-radius: 12px; background: var(--orange-soft); }
.upload-box { padding: 18px; border: 1px dashed var(--line-strong); border-radius: 13px; background: #fbfdff; }
.upload-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.upload-row p { margin: 0; color: var(--muted); font-size: 11px; }
.file-picker { position: relative; flex: none; overflow: hidden; }
.file-picker input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.file-list { display: grid; gap: 8px; margin-top: 13px; }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 9px; background: var(--blue-soft); color: var(--navy); font-size: 11px; }
.file-chip strong { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip span { color: var(--muted); }
.file-chip button { border: 0; background: transparent; color: var(--danger); cursor: pointer; font-weight: 900; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 17px; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 850; font-size: 12px; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button-primary { background: linear-gradient(135deg, var(--blue), var(--navy-2)); color: #fff; box-shadow: 0 7px 16px rgba(10,105,168,.18); }
.button-secondary { border-color: var(--line-strong); background: #fff; color: var(--navy); }
.button-ghost { background: transparent; color: var(--muted); }
.button-small { min-height: 36px; padding: 7px 12px; }
.button-full { width: 100%; }
.alert { margin: 22px 0 0; padding: 13px 15px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.alert-error { border: 1px solid #f3c0bc; background: var(--danger-soft); color: var(--danger); }
.upload-progress-card, .success-panel { min-height: 540px; display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 50px; text-align: center; }
.upload-progress-card { flex-direction: row; gap: 18px; }
.upload-progress-card h2 { margin: 0 0 5px; color: var(--navy); }
.upload-progress-card p { margin: 0; color: var(--muted); }
.spinner { width: 42px; height: 42px; flex: none; border: 4px solid var(--blue-soft); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.success-icon { width: 68px; height: 68px; display: grid; place-items: center; margin-bottom: 22px; border-radius: 50%; background: var(--success-soft); color: var(--success); font-size: 30px; font-weight: 900; }
.success-panel h2 { max-width: 620px; margin: 0; color: var(--navy); font-size: 32px; }
.success-panel p { color: var(--muted); }
.success-panel code { margin: 4px 0 26px; padding: 11px 15px; border-radius: 9px; background: var(--paper); color: var(--navy); font-weight: 900; }
.site-footer { padding: 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; text-align: center; }

/* Admin */
.admin-page { overflow: hidden; background: #edf3f8; }
.admin-header { position: relative; height: 76px; }
.login-panel { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 30px; background: radial-gradient(circle at 25% 25%, #e5f5fb 0, transparent 36%), var(--paper); }
.login-card { width: min(430px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 8px; color: var(--navy); font-size: 32px; }
.login-card > p { margin: 0 0 25px; color: var(--muted); font-size: 13px; }
.login-card .field-label { margin-top: 15px; }
.login-card .button { margin-top: 20px; }
.admin-app { height: calc(100vh - 76px); display: grid; grid-template-columns: 390px minmax(0, 1fr); }
.submission-sidebar { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fff; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; padding: 25px 24px 16px; }
.sidebar-heading .eyebrow { margin-bottom: 3px; }
.sidebar-heading h1 { margin: 0; color: var(--navy); font-size: 25px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--blue); cursor: pointer; font-size: 20px; }
.filter-stack { padding: 0 20px 18px; border-bottom: 1px solid var(--line); }
.search-field { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); }
.search-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,105,168,.1); }
.search-field input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.filter-tabs { display: flex; gap: 5px; margin-top: 11px; overflow-x: auto; }
.filter-tabs button { padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 850; white-space: nowrap; }
.filter-tabs button.is-active { background: var(--blue-soft); color: var(--blue); }
.submission-list { min-height: 0; flex: 1; overflow-y: auto; }
.submission-card { width: 100%; display: block; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; }
.submission-card:hover, .submission-card.is-active { background: #f3f9fc; }
.submission-card.is-active { box-shadow: inset 4px 0 var(--blue); }
.submission-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.submission-card h3 { margin: 0; overflow: hidden; color: var(--navy); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.submission-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.submission-card small { display: block; margin-top: 7px; color: #8a98a8; font-size: 9px; }
.status-badge { flex: none; padding: 4px 7px; border-radius: 999px; font-size: 8px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.status-badge.new { background: #e9f3ff; color: #1168a8; }
.status-badge.processing { background: #fff2dd; color: #966000; }
.status-badge.completed { background: var(--success-soft); color: var(--success); }
.list-message { padding: 28px; color: var(--muted); font-size: 12px; text-align: center; }
.submission-detail { min-width: 0; overflow-y: auto; padding: 30px clamp(24px, 4vw, 58px) 70px; }
.empty-state { min-height: 65vh; display: grid; place-items: center; align-content: center; color: var(--muted); text-align: center; }
.empty-state > span { width: 70px; height: 70px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 20px; background: #fff; color: var(--blue); box-shadow: var(--shadow-soft); font-size: 22px; font-weight: 900; }
.empty-state h2 { margin: 0 0 6px; color: var(--navy); }
.empty-state p { margin: 0; font-size: 13px; }
.detail-header { padding: 24px 26px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: var(--shadow-soft); }
.detail-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.detail-header h1 { margin: 0 0 8px; color: var(--navy); font-size: clamp(22px, 3vw, 34px); line-height: 1.15; }
.detail-header p { margin: 0; color: var(--muted); font-size: 12px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 12px 18px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.detail-meta strong { color: var(--ink); }
.detail-toolbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(245,248,251,.93); backdrop-filter: blur(12px); }
.status-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.status-control select { height: 38px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; color: var(--ink); padding: 0 10px; font-size: 11px; font-weight: 800; text-transform: none; }
.detail-sections { display: grid; gap: 14px; }
.admin-section { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow-soft); }
.admin-section-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: #f9fbfd; }
.admin-section-header h2 { margin: 0; color: var(--navy); font-size: 14px; }
.copy-section { border: 0; background: transparent; color: var(--blue); cursor: pointer; font-size: 10px; font-weight: 900; }
.copy-row { display: grid; grid-template-columns: minmax(140px, .38fr) minmax(0, 1fr) 72px; align-items: stretch; border-bottom: 1px solid #edf1f5; }
.copy-row:last-child { border-bottom: 0; }
.copy-label { padding: 15px 16px; color: var(--muted); font-size: 10px; font-weight: 800; }
.copy-value { min-width: 0; padding: 14px 16px; background: #f5f8fb; color: var(--ink); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-button { align-self: center; justify-self: center; padding: 7px 10px; border: 0; border-radius: 8px; background: var(--blue-soft); color: var(--blue); cursor: pointer; font-size: 10px; font-weight: 900; }
.copy-button:hover { background: #d9edf8; }
.file-row .copy-value { background: #fff; }
.download-link { display: inline-flex; align-items: center; gap: 7px; color: var(--blue); font-weight: 800; text-decoration: none; }
.download-link:hover { text-decoration: underline; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 100; padding: 12px 16px; border-radius: 10px; background: var(--navy); color: #fff; box-shadow: var(--shadow); font-size: 11px; font-weight: 800; }

@media (max-width: 980px) {
  .form-hero { align-items: flex-start; flex-direction: column; }
  .form-layout { grid-template-columns: 1fr; }
  .step-panel { position: static; }
  .step-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .step-button { display: block; padding: 7px; text-align: center; }
  .step-number { margin: 0 auto; }
  .step-copy { display: none; }
  .save-note { display: none; }
  .admin-app { grid-template-columns: 330px minmax(0,1fr); }
}

@media (max-width: 760px) {
  .site-header { min-height: 66px; padding: 10px 16px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand strong { font-size: 13px; }
  .brand small { font-size: 9px; }
  .form-hero { padding: 42px 18px 28px; }
  .form-hero h1 { font-size: 38px; }
  .form-hero p { font-size: 15px; }
  .hero-meta { width: 100%; }
  .hero-meta div { min-width: 0; flex: 1; padding: 14px 8px; }
  .form-layout { padding: 0 12px 50px; gap: 12px; }
  .step-panel { padding: 14px; border-radius: 14px; }
  #registrationForm { padding: 24px 18px; }
  .section-intro h2 { font-size: 22px; }
  .field-grid, .choice-grid { grid-template-columns: 1fr; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .button { flex: 1; }
  #clearButton { order: 3; flex-basis: 100%; }
  .upload-row { align-items: flex-start; flex-direction: column; }
  .admin-page { overflow: auto; }
  .admin-header .brand small { display: none; }
  .header-actions .header-link { display: none; }
  .admin-app { height: auto; min-height: calc(100vh - 66px); grid-template-columns: 1fr; }
  .submission-sidebar { max-height: 46vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .submission-detail { overflow: visible; padding: 18px 12px 50px; }
  .detail-toolbar { top: 0; }
  .copy-row { grid-template-columns: 1fr 62px; }
  .copy-label { grid-column: 1 / -1; padding: 11px 13px 3px; }
  .copy-value { padding: 10px 13px 13px; }
  .login-card { padding: 28px 22px; }
}

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