/* CHANGE LOG
 * File: public/css/driver-application-wizard.css
 * Purpose: Driver application wizard presentation (driver layout only).
 * How it works: hides inactive steps visually; inputs stay enabled in the DOM.
 * Version History:
 *   2026-11-02 - Progress is a plain rounded bar, not a battery (no end nub): the battery was a
 *                metaphor, not a picture to copy (Michael).
 *   2026-11-02 - Photo slots are small optional buttons under the main upload (Michael).
 *   2026-11-02 - Storyboard: things-left line, saved toast, needed tag, Yes/No question, photo slots.
 *   2026-11-02 - One title per screen (the Step line under the Menu is hidden); employment screen:
 *                folded legal text (.dw-legal), one-line jobs (.dw-job), plain lead (.dw-emp-lead).
 *   2026-11-02 - Progress is green (battery, Next line, marked field), apart from the navy Menu (Michael).
 *   2026-11-02 - Progress battery beside the Menu (.dw-topline, .dw-battery-*); banner reduced to the next step.
 *   2026-11-01 - One bar only: the step bar is hidden; "Step N of M" stays as text and the
 *                "% done" bar above is the only bar (Michael: everything synced).
 *   2026-11-01 - "You're X% done" banner styles (.dw-done-*), Michael.
 */
/*
 * Driver Application Wizard — Presentation layer only.
 * Loaded ONLY from resources/views/layouts/driver-wizard.blade.php.
 * Never included in app.css, layouts.app, recruiter, or carrier views.
 *
 * Rule: hidden wizard sections stay in the DOM with all inputs ENABLED
 * (so the full POST includes every field). CSS hides them visually only.
 *
 * Version History:
 *   2026-11-01 v1.3 — "You're X% done" banner (.dw-done-*), Michael.
 *   2026-09-02 v1.0 — Bite 4C initial.
 *   2026-09-03 v1.1 — Make active/inactive step rules outrank canonical collapse rules.
 *   2026-09-23 v1.2 — Phone jump bar (R104); one-row slim save bar on phones.
 *   2026-09-23 v1.4 — Jump menu sheet replaces picker + Documents button; consent
 *                     reminder styled as guidance, not an error.
 *   2026-09-23 v1.3 — Documents: 'Add photos or files' stays visible after the first upload.
 */

/* ── Top bar ─────────────────────────────────────────── */
.dw-top-bar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
}
.dw-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1d4ed8;
    text-decoration: none;
}

/* ── Wizard shell ─────────────────────────────────────── */
.dw-shell {
    box-sizing: border-box;
    max-width: 1020px;
    margin: 0 auto;
    padding: 1.25rem 1rem 4rem;
}

/* ── Job context header ──────────────────────────────── */
.dw-job-header {
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    color: #1e3a5f;
}
.dw-job-header strong {
    display: block;
    font-size: 1rem;
}
.dw-job-title {
    color: #475569;
    display: block;
    font-size: 0.88rem;
    margin-bottom: 0.55rem;
}
.dw-application-context {
    color: #1d2733;
    margin-bottom: 1rem;
}
.dw-application-context > strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}
.dw-application-context > p {
    color: #475569;
    font-size: 0.88rem;
    margin: 0.55rem 0 0;
}

/* ── Existing parser entry point ────────────────────── */
.dw-resume-upload {
    border-top: 1px solid #d6e6d9;
    margin-top: 0.9rem;
    padding-top: 0.9rem;
}
.dw-resume-upload label {
    color: #1d2733;
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.dw-resume-upload label span {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 400;
    margin-left: 0.35rem;
}
.dw-resume-upload-controls {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}
.dw-resume-upload-controls input[type="file"] {
    color: #374151;
    flex: 1 1 260px;
    max-width: 100%;
}
.dw-resume-upload-controls button {
    background: #2563eb;
    border: 0;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    padding: 0.65rem 1rem;
}
.dw-resume-upload-controls button:hover {
    background: #1d4ed8;
}
/* ── Progress bar ────────────────────────────────────── */
.dw-progress {
    margin-bottom: 1.25rem;
}
.dw-progress-label {
    font-size: 0.82rem;
    color: #6b7280;
    margin-bottom: 0.35rem;
}
.dw-progress-bar-outer {
    background: #e5e7eb;
    border-radius: 99px;
    height: 6px;
    overflow: hidden;
}
.dw-progress-bar-inner {
    background: #2563eb;
    height: 100%;
    border-radius: 99px;
    transition: width 0.3s ease;
}

/* ── Clickable section breadcrumb ───────────────────── */
.dw-step-nav {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin: 0.75rem auto 1.25rem;
    max-width: 1020px;
    position: relative;
    width: 100%;
}

/* Desktop section rail: keep every step visible beside the form. */
@media (min-width: 1250px) {
    .dw-shell {
        max-width: 1280px;
        padding-right: 250px;
    }
    .dw-step-nav {
        align-items: stretch;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: flex-start;
        left: calc(50% + 410px);
        margin: 0;
        max-height: calc(100vh - 12rem);
        overflow-y: auto;
        position: fixed;
        top: 10rem;
        width: 210px;
        z-index: 15;
    }
    .dw-step-link {
        border-radius: 7px;
        text-align: left;
        width: 100%;
    }
}
.dw-step-link {
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #475569;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    white-space: nowrap;
}
.dw-step-link:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}
.dw-step-link-active {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    font-weight: 600;
}

/* ── Section card ────────────────────────────────────── */
.dw-section-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.5rem 1.25rem;
    margin-bottom: 1rem;
}
.dw-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
    color: #111827;
}

/* ── Canonical accordion — driver mode ───────────────── */
/*
 * In driver mode the entire #accordionExample is mounted (for full
 * POST), but we render it flat — no Bootstrap accordion chevrons,
 * no collapse animation. The wizard JS controls visibility instead.
 */
body.dw-mode #accordionExample {
    border: none;
    background: none;
}
body.dw-mode #accordionExample .card {
    border: none;
    box-shadow: none;
    margin: 0;
}
body.dw-mode #accordionExample .card-header {
    display: none;   /* wizard navigation replaces accordion headers */
}
body.dw-mode #accordionExample .collapse,
body.dw-mode #accordionExample .collapse.show {
    /* All sections visible to the DOM so inputs are never disabled.
       Wizard JS then hides all but the active section. */
    display: block !important;
}
/* Hidden sections: visually gone, still in DOM, inputs still enabled */
body.dw-mode #accordionExample .collapse.dw-step-hidden,
body.dw-mode #dw-gap-review.dw-step-hidden {
    display: none !important;
}
/* Active section: shown */
body.dw-mode #accordionExample .collapse.dw-step-visible,
body.dw-mode #dw-gap-review.dw-step-visible {
    display: block !important;
}

/* Staff-only card (interviewQuestions): always hidden in driver mode */
body.dw-mode #interviewQuestions {
    display: none !important;
}

/* ── Navigation controls ─────────────────────────────── */
.dw-nav {
    background: #f8fafc;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    bottom: 0.5rem;
    box-shadow: 0 -3px 14px rgba(15, 23, 42, 0.09);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem auto 0;
    max-width: 600px;
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    width: calc(100% - 2rem);
    position: sticky;
    z-index: 20;
}
.dw-btn-back {
    min-width: 100px;
    padding: 0.65rem 1.25rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 0.95rem;
    cursor: pointer;
}
.dw-btn-back:hover { background: #f9fafb; }
.dw-btn-continue {
    min-width: 140px;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.dw-btn-continue:hover { background: #1d4ed8; }
.dw-btn-save-exit {
    margin-left: auto;
    padding: 0.55rem 1rem;
    border: none;
    background: none;
    color: #6b7280;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: underline;
}
.dw-btn-save-exit:hover { color: #374151; }

/* ── Save confirmation flash ─────────────────────────── */
.dw-save-flash {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    background: #065f46;
    color: #fff;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 9999;
}
.dw-save-flash.dw-flash-show {
    opacity: 1;
}
.dw-save-flash.dw-flash-error {
    background: #991b1b;
}
#dw-gap-form textarea[aria-invalid="true"] {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 1px #dc2626;
}

/* ── Explicit save-for-later confirmation ───────────── */
.dw-saved-panel {
    display: none;
    max-width: 560px;
    margin: 3rem auto;
    padding: 2rem;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    background: #f0fdf4;
    color: #166534;
    text-align: center;
}
.dw-saved-panel h2 { color: #14532d; font-size: 1.35rem; }
.dw-shell.dw-paused .dw-saved-panel { display: block; }
.dw-shell.dw-paused .dw-progress,
.dw-shell.dw-paused .dw-welcome,
.dw-shell.dw-paused .dw-section-card,
.dw-shell.dw-paused #dw-gap-review,
.dw-shell.dw-paused .dw-nav { display: none !important; }

/* ── Recruiter-parser wait screen ───────────────────── */
.dw-processing-card {
    width: calc(100% - 2rem);
    max-width: 520px;
    margin: 8vh auto;
    padding: 2.25rem 2rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
}
.dw-processing-card h1 { font-size: 1.4rem; color: #111827; }
.dw-processing-card p { color: #4b5563; line-height: 1.55; }
.dw-processing-spinner {
    width: 42px;
    height: 42px;
    margin: 0 auto 1.25rem;
    border: 4px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: dw-spin 1s linear infinite;
}
.dw-processing-link { display: block; margin-top: 1.25rem; }
@keyframes dw-spin { to { transform: rotate(360deg); } }

/* ── Documents: keep the add button after files are added ─── */
/* Dropzone hides its message once any file is queued, which left drivers
   with thumbnails and no visible way to add the next photo. */
.dw-shell #my-dropzone.dz-started .dz-message {
    display: block !important;
    order: 99;
    width: 100%;
}
.dw-shell #my-dropzone { display: flex; flex-wrap: wrap; justify-content: center; }
.dw-shell #my-dropzone .dz-multi-hint { color: #4b5563; font-size: 14px; margin-top: 0.6rem; }

/* ── Jump menu: phones and tablets (R104) ─────────────── */
.dw-jump { margin: 0 auto 0.75rem; max-width: 1020px; }
.dw-menu-btn {
    align-items: center; background: #1e3a8a; border: 0; border-radius: 10px; color: #fff;
    display: flex; gap: 0.75rem; min-height: 56px; padding: 0.6rem 1rem; text-align: left; width: 100%;
}
.dw-menu-icon { font-size: 26px; line-height: 1; }
.dw-menu-text strong { display: block; font-size: 18px; }
.dw-menu-text span { font-size: 14px; opacity: 0.9; }
.dw-menu-sheet {
    background: rgba(15, 23, 42, 0.55); inset: 0; position: fixed; z-index: 1000;
    display: flex; align-items: flex-end; justify-content: center;
}
.dw-menu-sheet[hidden] { display: none; }
.dw-menu-panel {
    background: #fff; border-radius: 16px 16px 0 0; max-height: 85vh; overflow-y: auto;
    padding: 0.75rem 0.9rem calc(1rem + env(safe-area-inset-bottom, 0px)); width: 100%; max-width: 640px;
}
.dw-menu-head { align-items: center; display: flex; justify-content: space-between; font-size: 18px; padding: 0.25rem 0.25rem 0.6rem; }
.dw-menu-close { background: none; border: 0; font-size: 32px; line-height: 1; color: #374151; padding: 0 0.4rem; }
.dw-menu-item {
    align-items: center; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; color: #111827;
    display: flex; font-size: 17px; justify-content: space-between; margin-bottom: 0.45rem;
    min-height: 52px; padding: 0.6rem 0.9rem; text-align: left; width: 100%;
}
.dw-menu-item-active { background: #dbeafe; border-color: #2563eb; font-weight: 700; }
@media (min-width: 1250px) {
    .dw-jump { display: none; }
}

/* Consent checkboxes: guidance, not an error. Saving never requires them. */
.dw-shell #alert-container.alert-danger { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }

/* ── Mobile spacing ──────────────────────────────────── */
@media (max-width: 600px) {
    .dw-shell { padding: 0.75rem 0.5rem 5rem; }
    .dw-section-card { padding: 1rem 0.85rem; }
    .dw-btn-continue, .dw-btn-back { width: 100%; text-align: center; }
    /* One slim row (R104): the old stacked bar was 182px and covered the fields. */
    .dw-nav { flex-direction: row; flex-wrap: nowrap; gap: 0.5rem; padding: 0.5rem 0.6rem; width: calc(100% - 1rem); }
    .dw-nav .dw-btn-back { width: auto; min-width: 0; flex: 0 0 auto; padding: 0.6rem 0.8rem; }
    .dw-nav .dw-btn-back.dw-btn-back-first { display: none; }
    .dw-nav .dw-btn-continue { width: auto; min-width: 0; flex: 1 1 auto; padding: 0.7rem 0.5rem; }
    .dw-btn-save-exit { margin-left: 0; flex: 0 0 auto; padding: 0.4rem 0.2rem; font-size: 0.8rem; }
    .dw-step-nav { display: none; }
    .dw-step-nav {
        flex-wrap: nowrap;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        overflow-x: auto;
        padding: 0 0.5rem 0.5rem;
    }
}

/* ── Suppress canonical form submit buttons in driver mode ─────────── */
/* The wizard Continue button handles submission. In-section Submit
   buttons (.btnsubmit, #submit-driver-form, #submit-carrier-form,
   #submit-driver-form-second) are hidden only in driver mode. They
   remain in the DOM for the full POST. Never hidden globally. */
.dw-shell .btnsubmit,
.dw-shell #submit-driver-form,
.dw-shell #submit-carrier-form,
.dw-shell #submit-driver-form-second {
    display: none !important;
}

/* ── Wizard padding inside section card ────────────────────────────── */
/* The accordion .card inside dw-section-card has its own border/shadow
   suppressed globally. Add some breathing room between field groups. */
.dw-shell #accordionExample .card-body {
    padding: 0.25rem 0;
}

.dw-shell [style*="width: 400px"] {
    width: 100% !important;
    max-width: 400px;
}
.dw-shell .table-responsive,
.dw-shell table {
    max-width: 100%;
}

/* One-time résumé page (applicant/resume-page, 2026-10-03): Skip is a plain text link. */
.dw-resume-skip { background: none; border: 0; padding: 0; margin-top: 12px; color: #555; text-decoration: underline; cursor: pointer; }
.dw-resume-error { color: #b00020; font-weight: 600; }

/* 2026-11-02: progress "battery" beside the Menu (ApplicantProgress). Green = progress and the next
   step (battery, "Next:" line, marked field), so they stand apart from the navy Menu (Michael). Stays visible on the desktop rail, where the Menu button is hidden. */
.dw-topline { display: flex; align-items: center; gap: 0.6rem; max-width: 1020px; margin: 0 auto 0.75rem; }
.dw-topline .dw-jump { flex: 1 1 auto; margin: 0; }
.dw-battery { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; white-space: nowrap; }
.dw-battery-cell { position: relative; width: 64px; height: 14px; border: 2px solid #15803d; border-radius: 99px;
    padding: 2px; box-sizing: border-box; }
.dw-battery-fill { display: block; height: 100%; background: #16a34a; border-radius: 99px; }
.dw-battery-pct { font-size: 1.15rem; font-weight: 700; color: #15803d; }
.dw-battery-gain { font-size: 0.85rem; font-weight: 700; color: #065f46; animation: dw-gain 2.5s ease-out 1 both; }
@keyframes dw-gain { 0% { opacity: 0; transform: translateY(4px); } 15% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0.55; } }
.dw-done-banner { display: block; }
.dw-done-next { display: block; margin-top: 0.35rem; padding: 0.55rem 0.75rem; border-left: 4px solid #16a34a;
    background: #f0fdf4; color: #14532d; font-weight: 600; text-decoration: none; border-radius: 4px; }
.dw-done-banner { margin-bottom: 0.75rem; }
/* The one field the "Next:" line points to, on its own screen. */
.dw-next-field { outline: 3px solid #16a34a; outline-offset: 4px; border-radius: 6px; scroll-margin-bottom: 140px; }

/* 2026-11-01: one bar on the page. The step position stays as text ("Step 3 of 11 - ...");
   the "% done" bar is the only bar, so two bars never show two different numbers. */
.dw-progress .dw-progress-bar-outer { display: none; }

/* 2026-11-02: one title per screen. The Menu button says "Step N of M"; the card says the screen
   name. The separate Step line is hidden (kept in the page for the wizard script). */
.dw-shell .dw-progress { display: none; }

/* Employment screen, driver view (compactEmployment in the wizard script). */
.dw-emp-lead { font-weight: 600; margin: 0 0 0.5rem; }
.dw-legal { margin: 0 0 1rem; }
.dw-legal > summary { cursor: pointer; color: #1e3a8a; font-weight: 600; }
.dw-legal > p { margin-top: 0.5rem; }
.dw-job { border: 1px solid #d1d5db; border-radius: 8px; margin: 0 0 0.6rem; background: #fff; }
.dw-job > summary { cursor: pointer; padding: 0.75rem 0.9rem; font-weight: 600; list-style-position: inside; }
.dw-job[open] > summary { border-bottom: 1px solid #e5e7eb; }
.dw-job > section { padding: 0.5rem 0.75rem; }

/* 2026-11-02 storyboard */
.dw-left { border-left: 4px solid #16a34a; background: #f0fdf4; color: #14532d; font-weight: 600; margin-bottom: 0.75rem; }
.dw-left a { color: #15803d; }
.dw-left-final { color: #14532d; }
.dw-toast { position: fixed; left: 1rem; right: 1rem; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 30;
    background: #111827; color: #fff; border-radius: 8px; padding: 0.55rem 0.8rem; font-size: 0.92rem;
    animation: dw-toast 3.5s ease-out 1 both; pointer-events: none; }
@keyframes dw-toast { 0% { opacity: 0; transform: translateY(6px); } 8% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.dw-needed-tag { color: #15803d; font-weight: 700; }
.dw-ask { margin: 0 0 0.75rem; }
.dw-ask-q { font-weight: 700; margin-bottom: 0.4rem; }
.dw-ask-choices { display: flex; gap: 0.6rem; }
.dw-ask-choices button { flex: 1; padding: 0.8rem; border: 2px solid #d1d5db; border-radius: 10px; background: #fff; font-weight: 700; }
.dw-ask-choices button.dw-ask-on { border-color: #16a34a; background: #f0fdf4; color: #14532d; }
.dw-slot-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.dw-slot { flex: 1 1 30%; text-align: center; border: 2px solid #16a34a; color: #15803d; border-radius: 8px;
    padding: 0.5rem 0.4rem; font-weight: 700; font-size: 0.9rem; cursor: pointer; background: #fff; }
.dw-slot-done { background: #f0fdf4; }
.dw-slot-other { margin: 0.75rem 0 0.25rem; color: #6b7280; font-size: 0.9rem; }
