:root {
  --navy: #006331;
  --navy-2: #004d26;
  --gold: #78a98b;
  --gold-dark: #2f7d4f;
  --blue-soft: #eaf5ef;
  --ink: #14221a;
  --muted: #5c6c62;
  --line: #d8e5dc;
  --surface: #ffffff;
  --bg: #f4f7f2;
  --danger: #a93226;
  --success: #167346;
  --warning: #7a5b13;
  --shadow: 0 18px 50px rgba(0, 99, 49, 0.14);
  --radius: 18px;
  --cream: #fffdf6;
  --green-soft: #eff7f2;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(145deg, #eef5f0 0%, #fffdf8 52%, #edf5ef 100%);
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  padding: .75rem 1rem;
  z-index: 999;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 3vw, 2.25rem);
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid rgba(0,99,49,.12);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.brand img { width: 104px; max-width: 34vw; height: auto; object-fit: contain; }
.brand-copy { border-left: 1px solid var(--line); padding-left: 1rem; }
.brand-copy strong { display: block; font-size: .95rem; }
.brand-copy span { color: var(--muted); font-size: .78rem; }
.top-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; }

.btn {
  border: 0;
  border-radius: 12px;
  min-height: 46px;
  padding: .72rem 1rem;
  font-weight: 750;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 4px solid rgba(47,125,79,.28); outline-offset: 2px; }
.btn-primary { background: var(--navy); color: white; box-shadow: 0 8px 20px rgba(0,99,49,.20); }
.btn-primary:hover { background: var(--navy-2); }
.btn-gold { background: var(--gold-dark); color: white; box-shadow: 0 8px 20px rgba(0,99,49,.22); }
.btn-gold:hover { background: var(--navy); }
.btn-secondary { background: var(--blue-soft); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }
.btn-danger { background: #fff1f0; color: var(--danger); }
.btn-small { min-height: 38px; padding: .55rem .75rem; font-size: .88rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.main { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; flex: 1; padding: clamp(1.2rem, 3vw, 2.5rem) 0 3rem; }
.hero {
  background: radial-gradient(circle at 85% 10%, rgba(255,255,255,.18), transparent 28%), linear-gradient(135deg, #003d20, #006331 58%, #2f7d4f);
  color: white;
  border-radius: 28px;
  padding: clamp(1.7rem, 5vw, 4rem);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  right: -90px;
  bottom: -145px;
}
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 800; color: #b9dfc7; }
.card .eyebrow, .success-screen .eyebrow { color: var(--navy); }
.hero h1 { font-size: clamp(2.1rem, 5vw, 4.1rem); line-height: 1.02; max-width: 760px; margin: .55rem 0 1rem; }
.hero p { max-width: 700px; color: #e8f4ec; font-size: clamp(1rem, 2vw, 1.2rem); line-height: 1.6; }
.hero-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.action-card {
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: white;
  border-radius: 18px;
  padding: 1.3rem;
  min-height: 158px;
  text-align: left;
  backdrop-filter: blur(8px);
  text-decoration: none;
  display: block;
}
.action-card:hover { background: rgba(255,255,255,.14); }
.action-card strong { display: block; font-size: 1.12rem; margin: .8rem 0 .35rem; }
.action-card span { color: #d8e8f0; font-size: .92rem; line-height: 1.45; }
.action-icon { font-size: 1.6rem; }

.info-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.25rem 0; }
.info-item { background: rgba(255,255,255,.86); border: 1px solid var(--line); border-radius: 16px; padding: 1rem; }
.info-item strong { display: block; color: var(--navy); margin-bottom: .3rem; }
.info-item span { color: var(--muted); font-size: .9rem; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(11,47,73,.06); }
.wizard-card { overflow: hidden; }
.wizard-header { display: grid; grid-template-columns: 280px 1fr; border-bottom: 1px solid var(--line); }
.wizard-title { background: var(--navy); color: white; padding: 1.4rem; }
.wizard-title h2 { margin: .2rem 0 .4rem; }
.wizard-title p { margin: 0; color: #cfe1ea; font-size: .9rem; }
.progress-wrap { padding: 1.4rem; display: flex; align-items: center; }
.progress-track { width: 100%; background: #e6edf2; border-radius: 999px; height: 12px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--navy), #74ae8b); width: 14%; transition: width .25s ease; }
.progress-label { margin-left: .8rem; min-width: 72px; color: var(--muted); font-size: .86rem; font-weight: 700; }
.wizard-body { display: grid; grid-template-columns: 250px 1fr; min-height: 570px; }
.step-nav { border-right: 1px solid var(--line); padding: 1rem; background: #fbfdfe; }
.step-nav button { width: 100%; border: 0; background: transparent; text-align: left; border-radius: 12px; padding: .85rem; color: var(--muted); font-weight: 700; margin-bottom: .35rem; display: flex; align-items: center; gap: .7rem; }
.step-nav button.active { background: var(--blue-soft); color: var(--navy); box-shadow: inset 4px 0 0 var(--navy); }
.step-nav button.complete::before { content: "✓"; background: #dff3e8; color: var(--success); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; }
.step-nav button:not(.complete)::before { content: attr(data-step); background: #edf2f5; color: var(--navy); border-radius: 50%; width: 24px; height: 24px; display: grid; place-items: center; font-size: .78rem; }
.step-content { padding: clamp(1.2rem, 4vw, 2.2rem); }
.step-panel { display: none; animation: fade .2s ease; }
.step-panel.active { display: block; }
@keyframes fade { from { opacity: .3; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.step-panel h2 { margin: 0 0 .4rem; font-size: 1.65rem; color: var(--navy); }
.step-intro { margin: 0 0 1.5rem; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.form-group { display: flex; flex-direction: column; gap: .38rem; min-width: 0; }
.form-group.full { grid-column: 1 / -1; }
label, .group-label { font-weight: 750; font-size: .92rem; color: #203847; }
.required::after { content: " *"; color: var(--danger); }
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd8e0;
  border-radius: 11px;
  padding: .82rem .86rem;
  background: white;
  min-height: 48px;
  color: var(--ink);
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(47,125,79,.20); border-color: var(--gold-dark); }
.field-hint { color: var(--muted); font-size: .78rem; line-height: 1.4; }
.field-error { color: var(--danger); font-size: .78rem; font-weight: 700; min-height: 1em; }
.invalid { border-color: var(--danger) !important; background: #fff8f7; }

.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .75rem; }
.choice {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .85rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  background: #fff;
}
.choice:has(input:checked) { border-color: var(--gold-dark); background: var(--green-soft); }
.choice input { width: 20px; min-height: 20px; margin: .1rem 0 0; accent-color: var(--navy); }
.choice span { line-height: 1.35; }

.repeat-card { border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; background: #fcfdfe; }
.repeat-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.repeat-card-header strong { color: var(--navy); }

.upload-zone { border: 2px dashed #b8cad5; border-radius: 15px; padding: 1.6rem; text-align: center; background: #f8fbfd; }
.upload-zone.dragging { border-color: var(--gold-dark); background: var(--green-soft); }
.upload-zone input { border: 0; padding: .5rem; }
.file-list { margin-top: 1rem; display: grid; gap: .55rem; }
.file-item { border: 1px solid var(--line); border-radius: 10px; padding: .65rem .8rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; background: white; }
.file-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.signature-box { border: 1px solid var(--line); border-radius: 14px; padding: 1rem; background: #fbfdfe; }
.signature-preview { font-family: "Brush Script MT", cursive; font-size: 2rem; color: var(--navy); border-bottom: 1px solid #90a4b0; min-height: 62px; padding: .7rem; }
.review-section { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.review-section:last-child { border-bottom: 0; }
.review-section h3 { color: var(--navy); margin: 0 0 .6rem; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem 1rem; }
.review-row { font-size: .9rem; }
.review-row span { display: block; color: var(--muted); font-size: .78rem; }

.wizard-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem clamp(1.2rem,4vw,2.2rem); border-top: 1px solid var(--line); background: #fbfdfe; }

.alert { border-radius: 12px; padding: .85rem 1rem; margin: 1rem 0; line-height: 1.45; }
.alert-info { background: #eaf5ef; color: #164d2f; }
.alert-warning { background: #fff7df; color: var(--warning); }
.alert-danger { background: #fff0ef; color: var(--danger); }
.alert-success { background: #eaf8ef; color: var(--success); }
.hidden { display: none !important; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(5,20,30,.66); display: grid; place-items: center; z-index: 100; padding: 1rem; }
.modal { width: min(620px, 100%); max-height: 90vh; overflow: auto; background: white; border-radius: 20px; box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1.15rem 1.3rem; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; color: var(--navy); }
.modal-body { padding: 1.3rem; }
.modal-footer { padding: 1rem 1.3rem; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: .7rem; }
.close-btn { border: 0; background: #eef3f6; border-radius: 50%; width: 38px; height: 38px; font-size: 1.2rem; }

.success-screen { text-align: center; padding: clamp(2rem,6vw,5rem); }
.success-icon { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 1.2rem; background: #e7f8ee; color: var(--success); font-size: 3rem; }
.confirmation-code { display: inline-block; background: linear-gradient(135deg,var(--navy-2),var(--navy)); color: white; border-radius: 12px; padding: .8rem 1rem; font-size: 1.15rem; letter-spacing: .08em; font-weight: 800; }

/* Staff dashboard */
.dashboard-shell { min-height: 100vh; background: #eef5f0; }
.dashboard-header { background: var(--navy); color: white; padding: 1rem clamp(1rem,3vw,2rem); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.dashboard-header img { width: 90px; background: white; border-radius: 10px; padding: .25rem; }
.dashboard-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.dashboard-main { width: min(1400px, calc(100% - 2rem)); margin: 0 auto; padding: 1.5rem 0 3rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.2rem; }
.stat-card { padding: 1.1rem; background: white; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 25px rgba(11,47,73,.06); }
.stat-card span { color: var(--muted); font-size: .82rem; }
.stat-card strong { display: block; font-size: 2rem; color: var(--navy); margin-top: .3rem; }
.toolbar { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 1rem; display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input { flex: 1; min-width: 220px; }
.toolbar select { width: auto; min-width: 170px; }
.table-card { background: white; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .9rem; border-bottom: 1px solid #e7edf1; text-align: left; font-size: .88rem; vertical-align: middle; }
th { background: #f7fafc; color: var(--navy); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
tr:hover td { background: #fbfdfe; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: .32rem .58rem; font-size: .75rem; font-weight: 800; background: #edf3f6; color: var(--navy); }
.status-new { background: #eaf4fa; color: #15577f; }
.status-qualified { background: #e7f8ee; color: var(--success); }
.status-inactive { background: #f0f0f0; color: #666; }
.status-onboarding { background: #fff6da; color: var(--warning); }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.detail-box { border: 1px solid var(--line); border-radius: 12px; padding: .9rem; }
.detail-box span { display: block; color: var(--muted); font-size: .78rem; margin-bottom: .2rem; }
.notes-list { display: grid; gap: .55rem; margin-top: .6rem; }
.note { border-left: 4px solid var(--gold-dark); background: var(--green-soft); padding: .65rem .8rem; font-size: .86rem; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: radial-gradient(circle at 75% 20%, rgba(255,255,255,.14), transparent 25%), linear-gradient(135deg, #003d20, #006331); }
.login-card { width: min(430px, 100%); background: white; border-radius: 22px; padding: 2rem; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.login-card img { width: 120px; display: block; margin: 0 auto 1.2rem; }
.login-card h1 { margin: 0 0 .4rem; color: var(--navy); text-align: center; }
.login-card p { color: var(--muted); text-align: center; }

.footer { text-align: center; color: var(--muted); font-size: .78rem; padding: 1rem; }

@media (max-width: 900px) {
  .hero-actions, .info-strip, .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .wizard-header { grid-template-columns: 1fr; }
  .wizard-body { grid-template-columns: 1fr; }
  .step-nav { border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; }
  .step-nav button { min-width: 160px; margin: 0 .3rem 0 0; }
  .choice-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 640px) {
  .brand-copy { display: none; }
  .hero-actions, .info-strip, .stats-grid, .form-grid, .form-grid.three, .choice-grid, .review-grid, .detail-grid { grid-template-columns: 1fr; }
  .hero { border-radius: 20px; }
  .topbar { align-items: flex-start; }
  .top-actions .btn span { display: none; }
  .wizard-footer { position: sticky; bottom: 0; z-index: 10; }
  .dashboard-header { align-items: flex-start; }
  .toolbar { align-items: stretch; }
  .toolbar input, .toolbar select, .toolbar .btn { width: 100%; }
}

@media print {
  .topbar, .dashboard-header, .toolbar, .wizard-footer, .btn, .step-nav { display: none !important; }
  body { background: white; }
  .main, .dashboard-main { width: 100%; padding: 0; }
  .card, .table-card { box-shadow: none; border: 0; }
}


/* Huff Phase 2 modular document and onboarding components */
.choice-row { display: flex; flex-wrap: wrap; gap: .55rem; }
.choice.compact { padding: .58rem .7rem; min-width: 74px; justify-content: center; }
.document-version { display: inline-flex; padding: .35rem .65rem; border-radius: 999px; background: var(--green-soft); color: var(--navy); font-size: .78rem; font-weight: 800; margin-bottom: .9rem; }
.legal-copy { border: 1px solid var(--line); border-left: 5px solid var(--navy); background: var(--cream); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; line-height: 1.55; }
.legal-copy p:first-child { margin-top: 0; }
.legal-copy p:last-child { margin-bottom: 0; }
.policy-stack { display: grid; gap: .9rem; }
.policy-card { border: 1px solid var(--line); border-radius: 14px; background: white; overflow: hidden; }
.policy-card summary { cursor: pointer; padding: 1rem; font-weight: 800; color: var(--navy); background: var(--green-soft); }
.policy-body { padding: 1rem 1.1rem; line-height: 1.55; }
.policy-body ul { margin: .2rem 0 1rem; padding-left: 1.25rem; }
.policy-body li { margin-bottom: .55rem; }
.policy-ack { border-top: 1px solid var(--line); padding-top: .8rem; }
.restricted-banner { border: 1px solid #d8c896; border-left: 5px solid #8b6b14; background: #fffaf0; border-radius: 12px; padding: 1rem; }
.kiosk-path { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 1rem 0; }
.kiosk-path > div { border: 1px solid var(--line); background: white; border-radius: 12px; padding: .9rem; }
.kiosk-path strong { display: block; color: var(--navy); margin-bottom: .25rem; }
.dashboard-tabs { display: flex; gap: .55rem; flex-wrap: wrap; margin: 0 0 1rem; }
.dashboard-tab.active { background: var(--navy); color: white; }
.record-type { display: inline-flex; padding: .28rem .55rem; border-radius: 999px; background: var(--green-soft); color: var(--navy); font-size: .72rem; font-weight: 800; }
.integration-status { display: inline-flex; gap: .4rem; align-items: center; font-size: .78rem; color: var(--muted); }
.integration-status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #b98d22; }
.footer a { color: var(--navy); font-weight: 750; }
.footer span { display: inline-block; margin-top: .25rem; }

@media (max-width: 1100px) {
  .hero-actions { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .kiosk-path { grid-template-columns: 1fr; }
}
.kiosk-path > div { color: var(--ink); }
.kiosk-path span { color: var(--muted); font-size: .86rem; line-height: 1.4; }
.onboarding-actions { grid-template-columns: repeat(2, minmax(0,1fr)); max-width: 540px; }
@media (max-width: 640px) { .onboarding-actions { grid-template-columns: 1fr; max-width: none; } }
