/* Provider Application Funnel — faithful port of the design package
   (_ds colors_and_type.css + Provider Onboarding.dc.html). Emerald #10B981. */
@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@600;700;800;900&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --font-display: 'Barlow', system-ui, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --accent: #10B981;
    --drive-blue: var(--accent);
    --drive-blue-600: color-mix(in srgb, var(--accent) 88%, #000);
    --drive-blue-700: color-mix(in srgb, var(--accent) 68%, #000);
    --drive-blue-50: color-mix(in srgb, var(--accent) 11%, #fff);
    --drive-blue-100: color-mix(in srgb, var(--accent) 26%, #fff);
    --ink-50: #F4F5F6;
    --ink-200: #E6E7E9;
    --ink-300: #D4D6D9;
    --ink-400: #767C84;
    --ink-500: #4B5158;
    --ink-700: #2A2D31;
    --ink-900: #0A0A0B;
    --drive-success: #0E9F6E;
    --drive-danger: #DC2626;
    --focus-ring: color-mix(in srgb, var(--accent) 28%, transparent);
    --shadow-brand: 0 12px 28px color-mix(in srgb, var(--accent) 30%, transparent);
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html, body.apply-body { margin: 0; background: var(--ink-50); font-family: var(--font-body); }
.apply-body { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding-bottom: 110px; }
input::placeholder, textarea::placeholder { color: var(--ink-400); }
::selection { background: var(--accent); color: #fff; }

/* ───────── Header ───────── */
.apply-header {
    position: sticky; top: 0; z-index: 10; width: 100%;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--ink-200); display: flex; align-items: center; justify-content: center;
}
.apply-header .inner { width: 100%; max-width: 620px; padding: 14px 20px; display: flex; align-items: center; gap: 10px; }
.apply-logo-box {
    display: inline-flex; width: 30px; height: 30px; border-radius: 8px; background: var(--accent);
    align-items: center; justify-content: center; flex-shrink: 0;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 32%, transparent);
}
.apply-logo-text { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: -0.03em; color: var(--ink-900); }
.apply-logo-text sup { font-size: 0.5em; font-weight: 700; vertical-align: 0.42em; line-height: 1; margin-left: 1px; }
.step-pill {
    margin-left: auto; font-size: 12px; font-weight: 600; color: var(--drive-blue-700);
    background: var(--drive-blue-50); border: 1px solid var(--drive-blue-100); padding: 5px 11px; border-radius: 999px;
}
.header-link { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ink-500); text-decoration: none; background: none; border: none; cursor: pointer; }

/* ───────── Layout ───────── */
.apply-wrap { width: 100%; max-width: 620px; padding: 0 20px; }
.apply-progress-wrap { padding: 22px 0 6px; }
.apply-progress { display: flex; gap: 6px; }
.apply-progress .seg { flex: 1; height: 5px; border-radius: 999px; background: var(--ink-200); transition: background .25s var(--ease-out); }
.apply-progress .seg.on { background: var(--accent); }
.apply-steptitle { font-family: var(--font-display); font-weight: 800; font-size: 21px; color: var(--ink-900); letter-spacing: -0.01em; margin-top: 11px; }
.apply-main { padding: 8px 0 24px; }
.step-intro { font-size: 14px; color: var(--ink-500); margin: 0 0 22px; line-height: 1.5; }

.apply-step { display: none; }
.apply-step.active { display: block; animation: applySlideUp .25s var(--ease-out); }

/* ───────── Fields ───────── */
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 18px; }
.apply-field { margin-bottom: 18px; }
.apply-field.last { margin-bottom: 0; }
.apply-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-900); margin-bottom: 7px; }
.apply-label .req { color: var(--drive-blue); }
.apply-label .opt { color: var(--ink-400); font-weight: 500; }
.apply-input, .apply-select {
    width: 100%; padding: 10px 14px; border: 1px solid var(--ink-200); border-radius: 8px;
    font-family: var(--font-body); font-size: 15px; line-height: 1.3; color: var(--ink-900); background: #fff; outline: none;
    transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.apply-input:focus, .apply-select:focus { border-color: var(--drive-blue); box-shadow: 0 0 0 3px var(--focus-ring); }
.apply-input.is-invalid, .apply-select.is-invalid { border-color: var(--drive-danger); }
.apply-select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238A9099' stroke-width='2'><path d='M4 6l4 4 4-4'/></svg>");
    background-repeat: no-repeat; background-position: right 14px center;
}
.field-error { color: var(--drive-danger); font-size: 13px; margin-top: 6px; display: none; }
.field-error.show { display: block; }
/* Links inside an error message (e.g. "already registered — log in or reset").
   Underlined and inheriting the error colour so they read as part of the
   sentence while still being obviously clickable. */
.apply-err-link { color: inherit; text-decoration: underline; font-weight: 600; }
.apply-err-link:hover, .apply-err-link:focus { opacity: .8; }

/* "We already had an application on file" — shown when the funnel prefills the
   remaining steps from a record we hold. Informational, not an error: a form
   that fills itself in without explanation reads as a bug. */
.apply-resume-notice {
    display: flex; gap: 9px;
    padding: 12px 14px; margin-bottom: 18px;
    border-radius: 10px;
    background: rgba(16, 185, 129, .09);
    border: 1px solid rgba(16, 185, 129, .28);
    color: #0B7A50;
    font-size: 13.5px; line-height: 1.5;
}
.addr-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }

/* ───────── Option cards (radio-dot) ───────── */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.opt-grid.cols2 { grid-template-columns: 1fr 1fr; }
.opt-grid.days { grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); gap: 9px; }
.opt-input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.opt-card {
    display: flex; align-items: center; gap: 11px; padding: 13px 15px; border-radius: 8px; cursor: pointer;
    font-size: 14px; color: var(--ink-900); border: 1px solid var(--ink-200); background: #fff; transition: all .15s var(--ease-out);
}
.opt-card.day { gap: 8px; padding: 11px 12px; font-size: 13px; font-weight: 600; justify-content: flex-start; }
.opt-dot { width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid var(--ink-300); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.opt-card.day .opt-dot { width: 16px; height: 16px; }
.opt-input:checked + .opt-card { border: 1.5px solid var(--drive-blue); background: var(--drive-blue-50); }
.opt-input:checked + .opt-card .opt-dot { border-color: var(--drive-blue); }
.opt-input:checked + .opt-card .opt-dot::after { content: ''; width: 8px; height: 8px; border-radius: 999px; background: var(--drive-blue); }
.opt-input:focus-visible + .opt-card { box-shadow: 0 0 0 3px var(--focus-ring); }
.subhead { font-size: 15px; font-weight: 700; color: var(--ink-900); margin: 26px 0 14px; font-family: var(--font-display); }

/* ───────── Service area rows ───────── */
.area-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.area-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; background: #fff; border: 1px solid var(--ink-200); border-radius: 12px; padding: 14px; }
.area-row .mini-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-500); margin-bottom: 6px; }
.btn-remove { background: none; border: 1px solid var(--ink-200); border-radius: 8px; width: 42px; height: 42px; cursor: pointer; color: var(--ink-400); display: flex; align-items: center; justify-content: center; }
.btn-remove:hover { color: var(--drive-danger); border-color: var(--drive-danger); }
.btn-add { display: inline-flex; align-items: center; gap: 8px; background: var(--drive-blue); color: #fff; border: none; padding: 11px 18px; border-radius: 10px; font-family: var(--font-body); font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-brand); }
.btn-add:hover { background: var(--drive-blue-600); }
.area-hint { font-size: 13px; color: var(--ink-400); margin-left: 12px; }

/* ───────── Hours ───────── */
.row-toggle { display: flex; align-items: center; gap: 11px; padding: 15px 16px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--ink-900); border: 1px solid var(--ink-200); background: #fff; transition: all .15s var(--ease-out); }
.opt-input:checked + .row-toggle { border: 1.5px solid var(--drive-blue); background: var(--drive-blue-50); }
.opt-input:checked + .row-toggle .opt-dot { border-color: var(--drive-blue); }
.opt-input:checked + .row-toggle .opt-dot::after { content: ''; width: 8px; height: 8px; border-radius: 999px; background: var(--drive-blue); }
.row-toggle .muted { color: var(--ink-400); font-weight: 400; }
.hours-detail { transition: opacity .2s var(--ease-out); }
.hours-detail.disabled { opacity: .4; pointer-events: none; }

/* ───────── Service cards ───────── */
.svc-list { display: flex; flex-direction: column; gap: 11px; }
.svc-card { border-radius: 12px; padding: 15px 16px; border: 1px solid var(--ink-200); background: #fff; transition: all .15s var(--ease-out); }
.svc-card.selected { border: 1.5px solid var(--drive-blue); background: var(--drive-blue-50); }
.svc-head { display: flex; align-items: center; gap: 13px; cursor: pointer; }
.svc-card .opt-dot.lg { width: 18px; height: 18px; }
.svc-card.selected .opt-dot { border-color: var(--drive-blue); }
.svc-card.selected .opt-dot::after { content: ''; width: 8px; height: 8px; border-radius: 999px; background: var(--drive-blue); }
.svc-ico { width: 34px; height: 34px; border-radius: 8px; }
.svc-name { font-weight: 600; font-size: 15px; color: var(--ink-900); }
.svc-raterow { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding-top: 13px; border-top: 1px dashed var(--ink-200); flex-wrap: wrap; }
.svc-raterow .lbl { font-size: 13px; font-weight: 600; color: var(--ink-500); white-space: nowrap; }
.svc-raterow .per { font-size: 13px; color: var(--ink-400); }
.svc-rate { display: none; }
.svc-card.selected .svc-rate { display: flex; }
.rate-wrap { position: relative; flex: 1; max-width: 180px; }
.rate-wrap .dollar { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-400); font-size: 15px; }
.rate-wrap input { width: 100%; padding: 10px 12px 10px 24px; border: 1px solid var(--ink-200); border-radius: 8px; font-family: var(--font-body); font-size: 15px; color: var(--ink-900); background: #fff; outline: none; }
.rate-wrap input:focus { border-color: var(--drive-blue); box-shadow: 0 0 0 3px var(--focus-ring); }

/* terms */
.terms-row { margin-top: 18px; }
.terms-row a { color: var(--drive-blue-700); }

/* ───────── Error banner ───────── */
.alert-apply { display: flex; gap: 9px; align-items: center; background: #FDECEA; border: 1px solid #F5C6C2; color: #A12018; border-radius: 8px; padding: 11px 14px; font-size: 13px; font-weight: 500; margin-bottom: 18px; }
.alert-apply ul { margin: 4px 0 0; padding-left: 18px; }

/* ───────── Sticky nav ───────── */
.apply-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: rgba(255,255,255,0.94); backdrop-filter: blur(10px); border-top: 1px solid var(--ink-200); display: flex; justify-content: center; }
.apply-nav .inner { width: 100%; max-width: 620px; padding: 14px 20px; display: flex; align-items: center; gap: 12px; }
.btn-back { display: inline-flex; align-items: center; gap: 7px; background: none; border: 1px solid var(--ink-300); color: var(--ink-700); padding: 14px 20px; border-radius: 10px; font-family: var(--font-body); font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-back:hover { border-color: var(--ink-700); }
.btn-continue { margin-left: auto; flex: 1; max-width: 300px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--drive-blue); color: #fff; border: none; padding: 15px; border-radius: 10px; font-family: var(--font-body); font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-brand); }
.btn-continue:hover { background: var(--drive-blue-600); }
.btn-continue:disabled { opacity: .6; cursor: not-allowed; }
.btn-skip { margin-left: auto; background: none; border: none; color: var(--ink-500); padding: 14px 16px; font-family: var(--font-body); font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ───────── Submitted / under-review ───────── */
.apply-center { text-align: center; padding: 24px 0 12px; }
.hero-check { width: 74px; height: 74px; border-radius: 999px; background: var(--drive-blue); display: flex; align-items: center; justify-content: center; margin: 0 auto 22px; box-shadow: var(--shadow-brand); animation: applyPopIn .35s var(--ease-out); }
.hero-check.danger { background: #FDECEA; }
.apply-h2 { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--ink-900); margin: 0 0 8px; }
.apply-lead { font-size: 15px; color: var(--ink-500); line-height: 1.55; margin: 0 auto 24px; max-width: 420px; }
.status-badge { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 700; }
.status-badge.expedited { background: #E7F7EF; color: var(--drive-success); border: 1px solid #BCE8D3; }
.status-badge.standard { background: var(--drive-blue-50); color: var(--drive-blue-700); border: 1px solid var(--drive-blue-100); }
.status-badge.rejected { background: #FDECEA; color: var(--drive-danger); border: 1px solid #F5C6C2; }
.next-card { text-align: left; background: #fff; border: 1px solid var(--ink-200); border-radius: 14px; padding: 20px; margin: 26px 0 0; }
.next-card .kicker { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--drive-blue-700); margin-bottom: 14px; }
.next-item { display: flex; gap: 12px; margin-bottom: 14px; }
.next-item:last-child { margin-bottom: 0; }
.next-num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 999px; background: var(--drive-blue-50); color: var(--drive-blue-700); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.next-item .t { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.next-item .d { font-size: 13px; color: var(--ink-500); }

/* expedite (documents) */
.exp-pill { display: inline-flex; align-items: center; gap: 7px; background: #E7F7EF; color: var(--drive-success); border: 1px solid #BCE8D3; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 14px; }
.exp-callout { display: flex; gap: 13px; align-items: flex-start; background: var(--drive-blue-50); border: 1px solid var(--drive-blue-100); border-radius: 14px; padding: 16px 18px; margin-bottom: 26px; }
.exp-callout .ico { flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px; background: var(--drive-blue); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-brand); }
.exp-callout .h { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--ink-900); margin-bottom: 3px; }
.exp-callout .p { font-size: 13.5px; color: var(--ink-500); line-height: 1.5; margin: 0; }
.drop-area { display: flex; flex-direction: column; align-items: center; gap: 7px; border: 1.5px dashed var(--ink-300); border-radius: 12px; padding: 24px; cursor: pointer; background: #fff; text-align: center; }
.drop-area:hover { border-color: var(--drive-blue); background: var(--drive-blue-50); }
.drop-area .up { font-size: 14px; font-weight: 600; color: var(--drive-blue-700); }
.drop-area .sm { font-size: 12px; color: var(--ink-400); }
/* Upload rejected (wrong file type, too large). Previously the applicant was told
   nothing at all and just saw the page reload — the real cause of the "I can't
   upload my W-9" reports. */
.upload-error { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 14px 16px;
    border: 1px solid var(--drive-danger); border-radius: 12px;
    background: color-mix(in srgb, var(--drive-danger) 6%, #fff); color: var(--drive-danger); }
.upload-error strong { display: block; font-size: 14px; font-weight: 700; }
.upload-error ul { margin: 6px 0 0; padding-left: 18px; }
.upload-error li { font-size: 13.5px; line-height: 1.5; }
.upload-error .hint { display: block; margin-top: 8px; font-size: 12.5px; color: var(--ink-500); }
.upload-error svg { flex-shrink: 0; margin-top: 1px; }

.file-item { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--ink-200); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.file-item .nm { font-size: 13.5px; font-weight: 600; color: var(--ink-900); }
.w9-link { display: flex; align-items: center; gap: 12px; background: var(--drive-blue-50); border: 1px solid var(--drive-blue-100); border-radius: 12px; padding: 14px 16px; text-decoration: none; margin-bottom: 12px; }
.w9-link .ico { flex-shrink: 0; width: 38px; height: 38px; border-radius: 9px; background: var(--drive-blue); display: flex; align-items: center; justify-content: center; }
.w9-link .t { font-size: 14px; font-weight: 700; color: var(--drive-blue-700); }
.w9-link .d { font-size: 12px; color: var(--ink-500); }
.doc-section-label { font-size: 14px; font-weight: 700; color: var(--ink-900); }
.doc-section-hint { font-size: 12.5px; color: var(--ink-400); margin: 0 0 11px; }

@keyframes applySlideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes applyPopIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 520px) {
    .addr-grid { grid-template-columns: 1fr 1fr; }
    .apply-logo-text { font-size: 19px; }
}

/* ── Password show/hide toggle ─────────────────────────────────────────
   Mirrors the .pw-wrap/.pw-toggle pattern in dispatchdesign.css so the apply
   funnel's password fields behave like the sign-in page's. */
/* .apply-input already declares width:100%, so wrapping it doesn't collapse the
   field the way it did on .ua-input — but the wrapper is still made a full-width
   block so both stylesheets behave identically. */
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap .apply-input { width: 100%; box-sizing: border-box; padding-right: 42px; }
.pw-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; padding: 0; border: 0; background: none;
    cursor: pointer; color: #6B7280; opacity: .75; transition: opacity .15s;
}
.pw-toggle:hover, .pw-toggle:focus-visible { opacity: 1; }
