/* Preplo /scan upload UI — reuses landing.css base theme; this file adds
   the drop-zone + progress UI on top. Load BOTH stylesheets in the
   template. */

.scan-wrap {
    max-width: 720px;
    margin: 64px auto 96px;
    padding: 0 32px;
}
.scan-head {
    margin-bottom: 36px;
}
.scan-head h1 {
    font-size: 40px;
    font-weight: 700;
    color: var(--color-accent);
    margin: 0 0 14px;
    letter-spacing: -0.01em;
    line-height: 1.05;
}
.scan-head p.lede {
    font-size: 17px;
    color: var(--color-body);
    margin: 0;
    max-width: 56ch;
    line-height: 1.55;
}

/* ──────── Drop zone ──────── */
.dropzone {
    border: 1.5px dashed var(--color-rule);
    background: white;
    padding: 56px 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 200ms ease, background 200ms ease, transform 200ms ease;
    position: relative;
    outline: none;
}
.dropzone:hover,
.dropzone:focus-visible {
    border-color: var(--color-accent);
    background: rgba(26, 50, 88, 0.02);
}
.dropzone.is-dragover {
    border-color: var(--color-accent);
    background: rgba(26, 50, 88, 0.05);
    transform: scale(1.005);
}
.dropzone__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-body);
    margin: 0 0 8px;
    letter-spacing: -0.005em;
}
.dropzone__title strong { color: var(--color-accent); }
.dropzone__sub {
    color: var(--color-muted);
    font-size: 14px;
    margin: 0 0 18px;
}
.dropzone__pick {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid var(--color-accent);
    color: var(--color-accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: white;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}
.dropzone:hover .dropzone__pick,
.dropzone:focus-visible .dropzone__pick {
    background: var(--color-accent);
    color: var(--color-paper);
}
.dropzone__meta {
    margin-top: 18px;
    font-size: 12px;
    color: var(--color-subtle);
}

.dropzone__icon {
    font-size: 32px;
    color: var(--color-accent);
    margin-bottom: 14px;
    letter-spacing: 0;
    font-weight: 400;
    line-height: 1;
}

/* ──────── File preview / start ──────── */
.file-preview {
    display: none;
    margin-top: 28px;
    padding: 20px 24px;
    background: white;
    border-left: 2px solid var(--color-accent);
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.file-preview.is-active { display: flex; }
.file-preview__name {
    font-weight: 700;
    color: var(--color-body);
    margin: 0;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 0;
    min-width: 0;
}
.file-preview__size {
    color: var(--color-muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.file-preview__remove {
    background: none;
    border: none;
    color: var(--color-muted);
    font-size: 13px;
    cursor: pointer;
    border-bottom: 0.5px solid var(--color-muted);
    padding: 0;
}
.file-preview__remove:hover { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.start-row {
    display: none;
    margin-top: 24px;
    justify-content: flex-end;
}
.start-row.is-active { display: flex; }
.start-btn {
    background: var(--color-accent);
    color: var(--color-paper);
    border: none;
    padding: 14px 28px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 150ms ease;
}
.start-btn:hover { background: var(--color-accent-2); }
.start-btn:disabled { background: var(--color-muted); cursor: progress; }
.start-btn::after { content: " →"; letter-spacing: 0; }

/* ──────── ATS theater (the single visible stage during streaming) ──────── */
.theater {
    display: none;
    margin-top: 8px;
}
.theater.is-active { display: block; }
.theater__head {
    margin-bottom: 28px;
}
.theater__title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-accent);
    margin: 6px 0 14px;
    letter-spacing: -0.01em;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.theater__progress {
    font-size: 14px;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
    font-weight: 400;
    letter-spacing: 0;
}
.theater__rule {
    height: 1.5pt;
    background: var(--color-rule);
    margin: 0 0 8px;
    position: relative;
    overflow: hidden;
}
.theater__rule-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: var(--color-accent);
    transition: width 1.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.theater__sub {
    margin: 0;
    color: var(--color-muted);
    font-size: 14px;
    font-style: italic;
    line-height: 1.5;
    max-width: 60ch;
}

/* Vertical feed of ATS-check rows */
.check-feed {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 0.5px solid var(--color-rule);
}
.check-row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 14px;
    align-items: start;
    padding: 14px 0 14px 4px;
    border-bottom: 0.5px solid var(--color-rule);
    opacity: 0;
    transform: translateY(8px);
    animation: row-in 380ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
@keyframes row-in {
    to { opacity: 1; transform: translateY(0); }
}
.check-row__icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 12px;
    color: var(--color-paper);
    font-weight: 700;
    margin-top: 1px;
    background: var(--color-rule);
    animation: icon-pop 360ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes icon-pop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.18); }
    100% { transform: scale(1); opacity: 1; }
}
.check-row[data-status="pass"] .check-row__icon { background: #4A7A3F; }
.check-row[data-status="warn"] .check-row__icon { background: #B8821B; }
.check-row[data-status="fail"] .check-row__icon { background: #A33; }
.check-row[data-status="skip"] .check-row__icon { background: var(--color-subtle); }
.check-row[data-status="pass"] .check-row__icon::before { content: "✓"; }
.check-row[data-status="warn"] .check-row__icon::before { content: "!"; }
.check-row[data-status="fail"] .check-row__icon::before { content: "✕"; }
.check-row[data-status="skip"] .check-row__icon::before { content: "—"; font-size: 14px; }

.check-row__body { min-width: 0; }
.check-row__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.check-row__name {
    font-size: 15.5px;
    color: var(--color-body);
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.005em;
}
.check-row__cat {
    font-size: 10px;
    color: var(--color-subtle);
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.check-row__why {
    margin: 4px 0 0;
    color: var(--color-muted);
    font-size: 13px;
    line-height: 1.5;
    opacity: 0;
    animation: detail-fade-in 320ms ease 180ms forwards;
}
.check-row__detail {
    margin: 6px 0 0;
    color: var(--color-body);
    font-size: 13px;
    line-height: 1.45;
    font-style: italic;
    opacity: 0;
    animation: detail-fade-in 320ms ease 320ms forwards;
    border-left: 2px solid var(--color-rule);
    padding-left: 10px;
}
.check-row[data-status="pass"] .check-row__detail { border-left-color: #4A7A3F; }
.check-row[data-status="warn"] .check-row__detail { border-left-color: #B8821B; }
.check-row[data-status="fail"] .check-row__detail { border-left-color: #A33; }
@keyframes detail-fade-in { to { opacity: 1; } }

.check-row__id {
    font-size: 11px;
    color: var(--color-subtle);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    padding-top: 4px;
    text-align: right;
}

/* ──────── Handoff section — `preplo-ats-ticked`. Editorial typography
   beat between the marker list and the question summary. Source Serif 4
   carries the display lines; Source Sans 3 carries the eyebrow + micro.
   No decoration. ────────────────────────────────────────────────────── */

@font-face {
    font-family: 'Source Serif 4';
    src: url('fonts/SourceSerif4-Regular.otf.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Source Serif 4';
    src: url('fonts/SourceSerif4-It.otf.woff2') format('woff2');
    font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
    font-family: 'Source Serif 4';
    src: url('fonts/SourceSerif4-Bold.otf.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Source Serif 4';
    src: url('fonts/SourceSerif4-BoldIt.otf.woff2') format('woff2');
    font-weight: 700; font-style: italic; font-display: swap;
}

.preplo-ats-ticked {
    /* Subtle warm cream — barely different from the page bg (#FCFBF7), so
       the section reads as a quiet typographic beat, not a boxed card. */
    background: #F8F5EC;
    padding: 4rem 3rem;
    margin-top: 64px;
    display: none;       /* shown by JS on ats_complete; static report toggles via .is-active */
}
.preplo-ats-ticked.is-active {
    display: block;
    animation: handoff-in 540ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.preplo-ats-ticked .container {
    max-width: 720px;
    margin: 0 auto;
}

.preplo-ats-ticked .eyebrow {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin: 0 0 2rem;
}

.preplo-ats-ticked .headline {
    font-family: 'Source Serif 4', Georgia, "Times New Roman", serif;
    font-size: 64px;
    line-height: 1.05;
    font-weight: 700;
    color: var(--color-accent);
    letter-spacing: -0.01em;
    margin: 0 0 2rem;
}
.preplo-ats-ticked .headline em {
    font-weight: 400;
    font-style: italic;
    color: var(--color-accent);
}

.preplo-ats-ticked .body {
    font-family: 'Source Serif 4', Georgia, "Times New Roman", serif;
    font-size: 19px;
    line-height: 1.55;
    color: var(--color-body);
    margin: 0 0 2.5rem;
    max-width: 600px;
}
.preplo-ats-ticked .body em { font-style: italic; }

.preplo-ats-ticked .micro {
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 13px;
    color: var(--color-muted);
    font-style: italic;
    margin: 0;
}

@keyframes handoff-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (max-width: 900px) {
    .preplo-ats-ticked { padding: 3rem 2rem; }
    .preplo-ats-ticked .headline { font-size: 52px; }
}
@media (max-width: 640px) {
    .preplo-ats-ticked { padding: 2.5rem 1.5rem; }
    .preplo-ats-ticked .headline { font-size: 40px; line-height: 1.1; }
    .preplo-ats-ticked .body { font-size: 17px; }
    .preplo-ats-ticked .eyebrow { margin-bottom: 1.5rem; }
}

/* ──────── Summary card at the end ──────── */
.summary-card {
    display: none;
    margin-top: 56px;
    padding: 36px 32px 32px;
    background: white;
    border: 0.5px solid var(--color-rule);
    border-top: 1.5pt solid var(--color-accent);
    position: relative;
    animation: summary-in 420ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.summary-card.is-active { display: block; }
@keyframes summary-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.summary-card__title {
    margin: 8px 0 24px;
    color: var(--color-body);
    font-size: 20px;
    line-height: 1.45;
    font-weight: 400;
    letter-spacing: -0.005em;
}
.summary-card__title--reassure {
    font-size: 19px;
    line-height: 1.5;
    color: var(--color-body);
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 0.5px solid var(--color-rule);
}
.summary-card__title--question {
    font-size: 22px;
    line-height: 1.45;
    color: var(--color-body);
    margin: 0 0 18px;
    font-weight: 400;
}
.summary-card__title--question em {
    font-style: italic;
    color: var(--color-accent);
    font-weight: 700;
}
.summary-card__title strong {
    color: var(--color-accent);
    font-weight: 700;
}
.summary-card__title span {
    color: var(--color-accent);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.summary-card__intro-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--color-accent);
    font-weight: 700;
    margin: 0 0 12px;
}
.summary-card__intro {
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-body);
    margin: 0 0 28px;
    max-width: 62ch;
}
.summary-card__intro em {
    font-style: italic;
    color: var(--color-accent);
    font-weight: 700;
}
.summary-card__intro strong { color: var(--color-accent); font-weight: 700; }
.summary-card__sections {
    list-style: none;
    margin: 0 0 28px;
    padding: 0;
    border-top: 0.5px solid var(--color-rule);
}
.summary-card__sections li {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 0.5px solid var(--color-rule);
    opacity: 0;
    animation: row-in 320ms cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}
.summary-card__sections li > span:first-child {
    font-size: 15px;
    color: var(--color-body);
}
.summary-card__sections li > span:last-child {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--color-accent);
    font-size: 18px;
}
.summary-card__note {
    margin: 0 0 24px;
    color: var(--color-muted);
    font-size: 13.5px;
    line-height: 1.55;
    max-width: 60ch;
}
.summary-card__actions {
    display: flex;
    justify-content: flex-end;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(26, 50, 88, 0.35); }
    50%      { box-shadow: 0 0 0 6px rgba(26, 50, 88, 0); }
}

/* Static-mode (the /scan/{id}/report replay): kill entrance animations so
   nothing is mid-fade when the page first paints. */
body[data-static] .check-row,
body[data-static] .check-row__why,
body[data-static] .check-row__detail,
body[data-static] .check-row__icon,
body[data-static] .preplo-ats-ticked,
body[data-static] .summary-card,
body[data-static] .summary-card__sections li {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

/* Stage card — three of these stack vertically as the run progresses */
.stage-card {
    padding: 22px 0 24px;
    border-top: 0.5px solid var(--color-rule);
    opacity: 0.45;
    transition: opacity 250ms ease;
}
.stage-card:last-of-type { border-bottom: 0.5px solid var(--color-rule); }
.stage-card.is-active { opacity: 1; }
.stage-card.is-done   { opacity: 1; }

.stage-card__head {
    display: grid;
    grid-template-columns: 36px 1fr auto auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.stage-card__num {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-subtle);
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
    padding-top: 1px;
}
.stage-card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--color-body);
    letter-spacing: -0.005em;
}
.stage-card__dot {
    width: 8px;
    height: 8px;
    background: var(--color-rule);
    border-radius: 50%;
    transition: background 200ms ease;
}
.stage-card__clock {
    font-size: 11px;
    color: var(--color-subtle);
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    text-align: right;
}
.stage-card.is-active .stage-card__num,
.stage-card.is-done   .stage-card__num   { color: var(--color-accent); }
.stage-card.is-active .stage-card__title { color: var(--color-accent); }
.stage-card.is-active .stage-card__dot {
    background: var(--color-accent);
    animation: pulse 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.stage-card.is-done .stage-card__dot { background: var(--color-accent); }

.stage-card__sub {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--color-muted);
    line-height: 1.5;
}
.stage-card__counter {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--color-muted);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

/* ATS check grid — 40 dots that fill as each check ticks off */
.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(14px, 1fr));
    gap: 6px;
    max-width: 100%;
}
.check-cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--color-rule);
    border-radius: 2px;
    transition: background 200ms ease, transform 200ms ease;
    transform: scale(0.85);
    position: relative;
}
.check-cell.in {
    transform: scale(1);
    animation: pop-in 250ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.check-cell.pass { background: #5C8A4F; }   /* muted green */
.check-cell.warn { background: #C58820; }   /* muted amber */
.check-cell.fail { background: #B33; }      /* muted red */
.check-cell.skip { background: var(--color-subtle); }
@keyframes pop-in {
    0%   { transform: scale(0.6); opacity: 0.3; }
    60%  { transform: scale(1.18); }
    100% { transform: scale(1); opacity: 1; }
}

/* Fact list — extracted resume fields, popping in one by one */
.fact-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.fact-list li {
    display: grid;
    grid-template-columns: 18px 130px 1fr;
    gap: 12px;
    align-items: baseline;
    padding: 5px 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-body);
    animation: slide-in 260ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.fact-list li::before {
    content: "✓";
    color: var(--color-accent);
    font-weight: 700;
}
.fact-list .fact__label {
    color: var(--color-muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.fact-list .fact__value {
    color: var(--color-body);
    font-weight: 700;
}
@keyframes slide-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Question feed — audit questions appearing as they're revealed */
.q-feed {
    max-height: 320px;
    overflow-y: auto;
    border-left: 2px solid var(--color-rule);
    padding: 4px 0 4px 16px;
    margin-top: 8px;
    scroll-behavior: smooth;
}
.q-feed.has-items { border-left-color: var(--color-accent); }
.q-feed .q-line {
    padding: 7px 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-body);
    border-bottom: 0.5px solid var(--color-rule);
    animation: slide-in 260ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.q-feed .q-line:last-child { border-bottom: none; }
.q-feed .q-role {
    display: block;
    font-size: 10px;
    color: var(--color-accent);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.q-feed .q-text { color: var(--color-body); }
.q-feed .q-shape {
    display: inline-block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--color-muted);
    border: 0.5px solid var(--color-rule);
    padding: 1px 6px;
    margin-left: 6px;
    vertical-align: middle;
    background: white;
}
.q-feed .weak-bullet {
    padding: 8px 0;
    font-size: 13px;
    color: var(--color-muted);
    font-style: italic;
    border-bottom: 0.5px dotted var(--color-rule);
    animation: slide-in 260ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.q-feed .weak-bullet::before {
    content: "↳ ";
    color: var(--color-accent);
    font-style: normal;
    font-weight: 700;
}

.progress-status {
    margin-top: 24px;
    text-align: center;
    color: var(--color-muted);
    font-size: 13px;
    font-style: italic;
    min-height: 20px;
}

/* ──────── Error ──────── */
.error-pane {
    display: none;
    margin-top: 24px;
    padding: 18px 22px;
    background: rgba(179, 51, 51, 0.05);
    border-left: 2px solid #B33;
    color: #8B2828;
    font-size: 14px;
    line-height: 1.5;
}
.error-pane.is-active { display: block; }
.error-pane__title { font-weight: 700; margin: 0 0 4px; }
.error-pane__msg   { margin: 0; }

/* ──────── Trust line ──────── */
.scan-trust {
    margin-top: 56px;
    padding-top: 24px;
    border-top: 0.5px solid var(--color-rule);
    font-size: 12px;
    color: var(--color-subtle);
    line-height: 1.6;
    text-align: center;
}
.scan-trust strong { color: var(--color-muted); font-weight: 700; }

@media (max-width: 640px) {
    .scan-wrap { margin-top: 32px; padding: 0 22px; }
    .scan-head h1 { font-size: 30px; }
    .dropzone { padding: 40px 20px; }
}
