/* CV builder landing + form. Loaded after candidate-matches.css; keep the order
   in includes/inline_styles.php unless deliberately changing the cascade. */

/* The form starts immediately below now, so the hero gives back the generous
   section padding it needed when three explainer sections sat in between.
   final-overrides.css sets .section{padding:58px 0!important} and loads after
   this file, so a plain .cvb-hero-section rule loses on equal specificity —
   two classes plus !important is what it takes to win. */
.cvb-hero-section.section { padding-top: 30px !important; padding-bottom: 14px !important; }
.cvb-build-section.section { padding-top: 18px !important; }
.cvb-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 48px; align-items: center; }
/* theme-violet.css forces h1 to clamp(48px, 6.2vw, 82px)!important and loads
   after this file, so source order cannot win — only specificity can. Two
   !important declarations are resolved by specificity, and .cvb-hero
   .cvb-hero-title (0,2,0) beats a bare h1 (0,0,1). At 82px the headline ate a
   whole screen before the reader reached what the page is for. */
.cvb-hero .cvb-hero-title {
    margin: 0; font-size: clamp(32px, 3.5vw, 48px) !important;
    line-height: 1.12; font-weight: 950; letter-spacing: -.025em;
}
.cvb-hero-sub { margin-top: 18px; max-width: 560px; color: #475569; font-size: 17px; line-height: 1.65; }
.cvb-hero-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.cvb-cta { padding: 13px 24px; font-size: 16px; }
.cvb-hero-points { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.cvb-hero-points li { position: relative; padding-left: 28px; color: #334155; font-size: 15.5px; font-weight: 800; }
.cvb-hero-points li::before {
    content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 999px;
    background: #dcfce7; box-shadow: inset 0 0 0 2px #22c55e;
}
.cvb-hero-points li::after {
    content: ""; position: absolute; left: 6px; top: 9px; width: 6px; height: 3px;
    border-left: 2px solid #15803d; border-bottom: 2px solid #15803d; transform: rotate(-45deg);
}

/* Hero illustration: a stylised CV sheet, drawn in CSS so it costs no request
   and stays crisp at any width. */
.cvb-hero-art { position: relative; display: flex; justify-content: center; }
.cvb-paper {
    width: 100%; max-width: 330px; border: 1px solid #dfe9f6; border-radius: 14px; background: #fff;
    padding: 26px 24px; box-shadow: 0 24px 60px rgba(66, 116, 217, .18); transform: rotate(-2deg);
}
.cvb-paper-head { width: 55%; height: 16px; border-radius: 6px; background: #4274d9; margin-bottom: 14px; }
.cvb-paper-line { height: 8px; border-radius: 999px; background: #e8eef8; margin-bottom: 9px; }
.cvb-paper-line.w90 { width: 90%; } .cvb-paper-line.w85 { width: 85%; }
.cvb-paper-line.w80 { width: 80%; } .cvb-paper-line.w70 { width: 70%; }
.cvb-paper-line.w60 { width: 60%; }
.cvb-paper-rule { height: 2px; background: #dce8f9; margin: 16px 0 14px; }
.cvb-paper-chips { display: flex; gap: 8px; }
.cvb-paper-chips span { width: 52px; height: 18px; border-radius: 999px; background: #eef4fc; }
.cvb-paper-badge {
    position: absolute; right: 4%; bottom: -12px; border-radius: 14px; background: #22c55e; color: #fff;
    padding: 12px 18px; font-weight: 950; box-shadow: 0 14px 30px rgba(34, 197, 94, .32);
}

/* Section headings sit on <h2>, which base.css sizes at clamp(30px, 4vw, 40px).
   That file loads earlier and without !important, so a single class wins. */
.cvb-section-title { text-align: center; font-size: clamp(26px, 2.6vw, 34px); letter-spacing: -.02em; }
.cvb-section-sub { max-width: 620px; margin: 12px auto 0; text-align: center; color: #475569; font-size: 16px; line-height: 1.65; }

/* Steps */
.cvb-steps { margin-top: 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cvb-step { border: 1px solid #dfe9f6; border-radius: 18px; background: #fff; padding: 22px 20px; box-shadow: 0 10px 30px rgba(15, 23, 42, .045); }
.cvb-step-num {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
    margin-bottom: 12px; border-radius: 12px; background: #eef4fc; color: #2d51a8; font-weight: 950; font-size: 16px;
}
.cvb-step strong { display: block; font-size: 17px; margin-bottom: 7px; }
.cvb-step p { margin: 0; color: #475569; font-size: 15.5px; line-height: 1.6; }

/* Why here — three claims, then the table that backs them up */
.cvb-why-grid { margin-top: 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cvb-why-card { border: 1px solid #dfe9f6; border-radius: 18px; background: #fff; padding: 22px 20px; box-shadow: 0 10px 30px rgba(15, 23, 42, .045); }
.cvb-why-card strong { display: block; font-size: 17px; margin-bottom: 8px; color: #0d1330; }
.cvb-why-card p { margin: 0; color: #475569; font-size: 15.5px; line-height: 1.65; }

/* The comparison table below is shared: the CV builder page and the homepage
   both use .cvb-cmp*, so a change here shows up in both places. It scrolls
   inside its own box rather than pushing the page sideways. */
.cvb-cmp-wrap { margin-top: 28px; overflow-x: auto; border: 1px solid #dfe9f6; border-radius: 18px; background: #fff; }
.cvb-cmp { width: 100%; min-width: 660px; border-collapse: collapse; font-size: 15px; }
.cvb-cmp th, .cvb-cmp td { padding: 13px 16px; text-align: left; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
[dir="rtl"] .cvb-cmp th, [dir="rtl"] .cvb-cmp td { text-align: right; }
.cvb-cmp thead th { font-size: 13.5px; font-weight: 950; color: #0d1330; background: #f8fafc; white-space: nowrap; }
.cvb-cmp tbody th { font-weight: 800; color: #334155; }
.cvb-cmp tbody tr:last-child th, .cvb-cmp tbody tr:last-child td { border-bottom: 0; }
/* Our column is tinted the whole way down so the eye can follow it. */
.cvb-cmp .cvb-cmp-us { background: #f6f9fe; }
.cvb-cmp thead .cvb-cmp-us { background: #eef4fc; color: #2d51a8; }
.cvb-cmp-yes { color: #15803d; font-weight: 900; white-space: nowrap; }
.cvb-cmp-no { color: #94a3b8; font-weight: 800; white-space: nowrap; }
.cvb-cmp-part { color: #64748b; }
.cvb-cmp-note { max-width: 640px; margin: 14px auto 0; text-align: center; color: #94a3b8; font-size: 13px; line-height: 1.6; }

body.theme-dark .cvb-why-card { border-color: #2a3a70; background: #101a3d; }
body.theme-dark .cvb-why-card strong { color: #e5e7eb; }
body.theme-dark .cvb-why-card p, body.theme-dark .cvb-cmp-part { color: #cbd5e1; }
body.theme-dark .cvb-cmp-wrap { border-color: #2a3a70; background: #101a3d; }
body.theme-dark .cvb-cmp th, body.theme-dark .cvb-cmp td { border-bottom-color: #1e2a55; }
body.theme-dark .cvb-cmp thead th { background: #0d1330; color: #e5e7eb; }
body.theme-dark .cvb-cmp tbody th { color: #cbd5e1; }
body.theme-dark .cvb-cmp .cvb-cmp-us { background: #152151; }
body.theme-dark .cvb-cmp thead .cvb-cmp-us { background: #172450; color: #bcd2f2; }

/* Template gallery */
.cvb-template-gallery { margin-top: 32px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cvb-template-card {
    display: block; border: 1px solid #dfe9f6; border-radius: 18px; background: #fff; padding: 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .045);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cvb-template-card:hover { transform: translateY(-3px); border-color: #bcd2f2; box-shadow: 0 16px 38px rgba(15, 23, 42, .09); }
.cvb-template-pick { display: block; margin-top: 12px; color: #2d51a8; font-size: 14.5px; font-weight: 900; }
body.theme-dark .cvb-template-pick { color: #bcd2f2; }
.cvb-template-card strong { display: block; margin-top: 14px; font-size: 16.5px; }
.cvb-template-card p { margin: 5px 0 0; color: #64748b; font-size: 14.5px; line-height: 1.55; }
.cvb-template-thumb { border: 1px solid #e8eef8; border-radius: 12px; background: #fff; padding: 16px; min-height: 138px; }
.cvb-thumb-head { height: 14px; width: 60%; border-radius: 4px; background: var(--cvb-accent, #1f4d46); margin-bottom: 14px; }
.cvb-thumb-line { height: 7px; border-radius: 999px; background: #eef2f7; margin-bottom: 8px; }
.cvb-thumb-line.w80 { width: 80%; } .cvb-thumb-line.w70 { width: 70%; }
.cvb-thumb-line.w60 { width: 60%; } .cvb-thumb-line.w50 { width: 50%; }
/* Each thumbnail hints at its template's real layout: a full-bleed header band
   for modern, no rules at all for minimal. */
.cvb-tpl-modern .cvb-thumb-head { width: calc(100% + 32px); margin: -16px -16px 14px; border-radius: 12px 12px 0 0; height: 34px; }
.cvb-tpl-minimal .cvb-thumb-head { background: #111827; width: 44%; height: 10px; }

/* Builder */
.cvb-alert { max-width: none; margin: 24px 0 0; }
.cvb-form { margin-top: 28px; }
/* The preview gets the wider half. The form is a column of labelled inputs and
   reads fine narrow; the sheet is a document someone has to actually be able to
   read, and every pixel it loses is a pixel of illegible 10pt text. */
.cvb-layout { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 28px; align-items: start; }
.cvb-fields { display: grid; gap: 18px; min-width: 0; }
.cvb-block { border: 1px solid #dfe9f6; border-radius: 18px; background: #fff; padding: 20px; margin: 0; box-shadow: 0 10px 30px rgba(15, 23, 42, .045); }
.cvb-block legend { padding: 0 8px; font-size: 15px; font-weight: 950; color: #0d1330; }
.cvb-block legend em { color: #dc2626; font-style: normal; }
.cvb-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cvb-span-2 { grid-column: 1 / -1; }
.cvb-field { display: grid; gap: 7px; min-width: 0; }
.cvb-field > span { color: #334155; font-size: 14px; font-weight: 900; }
.cvb-field > span em { color: #dc2626; font-style: normal; }
.cvb-field input, .cvb-field textarea {
    width: 100%; min-height: 42px; border: 1px solid #d5e3f7; border-radius: 12px; background: #fff;
    padding: 11px 14px; color: #334155; font-size: 15px; outline: none;
}
.cvb-field textarea { min-height: auto; resize: vertical; line-height: 1.6; }
.cvb-field input:focus, .cvb-field textarea:focus { border-color: #6693e0; box-shadow: 0 0 0 3px rgba(66, 116, 217, .14); }
.cvb-hint { margin: 10px 0 0; color: #64748b; font-size: 13.5px; line-height: 1.6; }

.cvb-row { position: relative; border-top: 1px dashed #e2e8f0; padding-top: 16px; margin-top: 16px; display: grid; gap: 14px; }
.cvb-row:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.cvb-row-remove {
    justify-self: start; border: 1px solid #fee2e2; border-radius: 10px; background: #fff; color: #dc2626;
    padding: 7px 13px; font-size: 13px; font-weight: 900; cursor: pointer;
}
.cvb-row-remove:hover { background: #fef2f2; }
.cvb-add { margin-top: 16px; }

/* Numbered section headings.
   legend cannot be a flex container reliably across browsers, so the number,
   label and badge sit in an inline row inside it instead. */
.cvb-legend { padding: 0 8px; }
.cvb-legend .cvb-step-badge,
.cvb-legend .cvb-legend-text,
.cvb-legend .cvb-tag { display: inline-block; vertical-align: middle; }
.cvb-step-badge {
    width: 24px; height: 24px; margin-right: 9px; border-radius: 999px;
    background: #0d1330; color: #fff; font-size: 12.5px; font-weight: 950;
    text-align: center; line-height: 24px;
}
.cvb-step-badge--ai { background: #4274d9; }
.cvb-legend-text { font-size: 16px; font-weight: 950; color: #0d1330; }
.cvb-tag {
    margin-left: 9px; border-radius: 999px; padding: 3px 9px;
    font-size: 11px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase;
}
.cvb-tag--required { background: #fef2f2; color: #b91c1c; }
.cvb-tag--optional { background: #f1f5f9; color: #64748b; }
.cvb-tag--shortcut { background: #eef4fc; color: #2d51a8; }
[dir="rtl"] .cvb-step-badge { margin-right: 0; margin-left: 9px; }
[dir="rtl"] .cvb-tag { margin-left: 0; margin-right: 9px; }
body.theme-dark .cvb-legend-text { color: #e5e7eb; }
body.theme-dark .cvb-step-badge { background: #bcd2f2; color: #0d1330; }
body.theme-dark .cvb-tag--optional { background: #172450; color: #cbd5e1; }
body.theme-dark .cvb-tag--required { background: #3f1d1d; color: #fecaca; }
body.theme-dark .cvb-tag--shortcut { background: #172450; color: #bcd2f2; }

/* Completion checklist */
.cvb-progress { border: 1px solid #dfe9f6; border-radius: 14px; background: #fff; padding: 14px 16px; }
.cvb-progress-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 13.5px; color: #475569; }
.cvb-progress-top strong { font-size: 15px; color: #0d1330; }
.cvb-progress-track { height: 6px; margin: 9px 0 0; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.cvb-progress-track span { display: block; height: 100%; width: 0; border-radius: 999px; background: #22c55e; transition: width .25s ease; }
.cvb-progress-list { margin: 11px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.cvb-progress-list li { position: relative; padding-left: 20px; font-size: 13.5px; color: #64748b; line-height: 1.5; }
.cvb-progress-list li::before {
    content: ""; position: absolute; left: 0; top: 5px; width: 10px; height: 10px;
    border-radius: 999px; box-shadow: inset 0 0 0 2px #cbd5e1;
}
.cvb-progress-list li.is-done { color: #15803d; }
.cvb-progress-list li.is-done::before { background: #22c55e; box-shadow: none; }
.cvb-progress-list li.is-missing { color: #b91c1c; }
.cvb-progress-list li.is-missing::before { box-shadow: inset 0 0 0 2px #f87171; }
[dir="rtl"] .cvb-progress-list li { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .cvb-progress-list li::before { left: auto; right: 0; }
body.theme-dark .cvb-progress { border-color: #2a3a70; background: #101a3d; }
body.theme-dark .cvb-progress-top { color: #cbd5e1; }
body.theme-dark .cvb-progress-top strong { color: #e5e7eb; }
body.theme-dark .cvb-progress-track { background: #1e2a55; }

/* Inline field errors */
.cvb-field.has-error input, .cvb-field.has-error textarea, .cvb-field.has-error select { border-color: #f87171; }
.cvb-field-error { margin: 0; color: #b91c1c; font-size: 12.5px; font-weight: 800; }
body.theme-dark .cvb-field-error { color: #fecaca; }

/* Design: colour swatches + layout */
.cvb-field-title { margin: 0 0 10px; color: #334155; font-size: 14px; font-weight: 900; }
.cvb-field-title--spaced { margin-top: 20px; }
.cvb-accents { display: flex; flex-wrap: wrap; gap: 10px; }
.cvb-accent { display: inline-flex; cursor: pointer; }
.cvb-accent input {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.cvb-accent-dot {
    display: block; width: 30px; height: 30px; border-radius: 999px;
    background: var(--cvb-swatch, #94a3b8);
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #e2e8f0;
    transition: box-shadow .15s ease, transform .15s ease;
}
/* "Template default" reads as a swatch that is not one colour. */
.cvb-accent-dot.is-default {
    background: conic-gradient(#1f4d46 0 33%, #0f766e 0 66%, #111827 0);
}
.cvb-accent:hover .cvb-accent-dot { transform: scale(1.08); }
.cvb-accent input:checked + .cvb-accent-dot {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0d1330; transform: scale(1.08);
}
.cvb-accent input:focus-visible + .cvb-accent-dot { outline: 3px solid rgba(66, 116, 217, .35); outline-offset: 3px; }
body.theme-dark .cvb-field-title { color: #cbd5e1; }
body.theme-dark .cvb-accent-dot { box-shadow: 0 0 0 2px #101a3d, 0 0 0 3px #2a3a70; }
body.theme-dark .cvb-accent input:checked + .cvb-accent-dot { box-shadow: 0 0 0 2px #101a3d, 0 0 0 4px #bcd2f2; }

.cvb-template-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cvb-template-option { display: block; cursor: pointer; }
/* Hidden visually but still a real focusable radio — zero width/height can drop
   it out of the accessibility tree and out of the tab order, which would leave
   the template choice keyboard-unreachable. */
.cvb-template-option input {
    position: absolute; width: 1px; height: 1px; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.cvb-template-option-body {
    display: block; height: 100%; border: 1px solid #d5e3f7; border-radius: 14px; background: #fff; padding: 14px;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.cvb-template-option-body strong { display: block; font-size: 15px; }
.cvb-template-option-body small { display: block; margin-top: 4px; color: #64748b; font-size: 12.5px; line-height: 1.45; }
.cvb-template-option input:checked + .cvb-template-option-body { border-color: #4274d9; background: #f6f9fe; box-shadow: 0 0 0 3px rgba(66, 116, 217, .14); }
.cvb-template-option input:focus-visible + .cvb-template-option-body { outline: 3px solid rgba(66, 116, 217, .35); outline-offset: 3px; }

/* AI tailoring. Tinted apart from the plain form blocks so it reads as a
   distinct offer rather than another set of fields to fill in. */
.cvb-ai-block { border-color: #c7d9f5; background: linear-gradient(180deg, #f6f9fe, #fff 70%); }
.cvb-ai-block legend { color: #2d51a8; }
.cvb-ai-intro { margin-top: 0; }
.cvb-ai-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; margin-top: 12px; }
.cvb-ai-controls select {
    width: 100%; min-height: 42px; border: 1px solid #d5e3f7; border-radius: 12px;
    background: #fff; padding: 10px 13px; color: #334155; font-size: 14.5px; outline: none;
}
.cvb-ai-controls select:focus { border-color: #6693e0; box-shadow: 0 0 0 3px rgba(66, 116, 217, .14); }
.cvb-ai-run { white-space: nowrap; }

/* The describe box is the front door, so it gets more presence than the
   tailoring panel further down the form. */
.cvb-describe textarea { min-height: 130px; font-size: 15.5px; line-height: 1.6; }
.cvb-describe-controls { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.cvb-band { max-width: 340px; margin-bottom: 16px; }
.cvb-field select {
    width: 100%; min-height: 42px; border: 1px solid #d5e3f7; border-radius: 12px;
    background: #fff; padding: 10px 13px; color: #334155; font-size: 14.5px; outline: none;
}
.cvb-field select:focus { border-color: #6693e0; box-shadow: 0 0 0 3px rgba(66, 116, 217, .14); }
body.theme-dark .cvb-field select { border-color: #2a3a70; background: #0d1330; color: #e5e7eb; }
.cvb-ai-run[disabled] { opacity: .6; cursor: progress; }

.cvb-ai-result { margin-top: 16px; border-top: 1px dashed #c7d9f5; padding-top: 14px; display: grid; gap: 12px; }
.cvb-ai-message { margin: 0; font-size: 15px; line-height: 1.6; color: #475569; }
.cvb-ai-message.is-ok { color: #15803d; }
.cvb-ai-message.is-bad { color: #b91c1c; }

body.theme-dark .cvb-ai-block { border-color: #2a3a70; background: linear-gradient(180deg, #132048, #101a3d 70%); }
body.theme-dark .cvb-ai-block legend { color: #bcd2f2; }
body.theme-dark .cvb-ai-controls select { border-color: #2a3a70; background: #0d1330; color: #e5e7eb; }
body.theme-dark .cvb-ai-result { border-top-color: #2a3a70; }
body.theme-dark .cvb-ai-message { color: #cbd5e1; }

/* Preview */
/* align-items:start on .cvb-layout would shrink this column to its content, and
   a sticky child can only travel as far as its own parent — so the preview
   scrolled out of sight halfway down a long form. Stretching the column to the
   full grid height gives it the whole form to stay pinned across. */
.cvb-preview-pane { min-width: 0; align-self: stretch; }
.cvb-preview-sticky { position: sticky; top: 100px; display: grid; gap: 14px; }
.cvb-preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
/* True-to-print preview.
   The sheet is a real A4 page — 210×297mm at 96dpi — with the same 14mm margins
   mpdf is configured with, so a line that wraps here wraps in the same place in
   the PDF. It is then scaled down as a whole to fit the column, rather than
   being laid out at column width, which is what used to make the download look
   like a different document. --cvb-scale is set by cv-builder.js; the fallback
   suits the usual desktop column so it is never wildly wrong without JS. */
.cvb-preview-stage {
    --cvb-scale: .66;
    position: relative; overflow: hidden; margin: 0 auto;
    border: 1px solid #dfe9f6; border-radius: 14px; background: #fff;
    box-shadow: 0 14px 40px rgba(15, 23, 42, .08);
    /* No max-height: the sheet is one page, and clipping it would hide the
       bottom of the CV the visitor is trying to check. */
    height: calc(1123px * var(--cvb-scale));
}
.cvb-preview-paper {
    width: 794px; min-height: 1123px; padding: 53px; background: #fff;
    transform: scale(var(--cvb-scale)); transform-origin: top left;
}
/* A full-width sheet inside a narrower stage overflows towards the inline end,
   which in RTL is the left — so scaling from the top-left corner shrinks it
   around a point already outside the frame and the preview reads as blank.
   Anchor it to the corner the sheet actually starts at. */
[dir="rtl"] .cvb-preview-paper { transform-origin: top right; }
.cvb-preview-stage[data-cv-busy="1"] { opacity: .55; }
.cvb-preview-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cvb-preview-actions .btn { flex: 1 1 auto; }
.cvb-download { min-height: 50px; }
.cvb-wall-note { margin: 0; color: #64748b; font-size: 13px; line-height: 1.6; }

/* Register page: the handover from a built CV into signup. */
.cvb-pending-cv { border: 1px solid #bbf7d0; border-radius: 14px; background: #f0fdf4; padding: 16px 18px; }
.cvb-pending-cv strong { display: block; color: #15803d; }
.cvb-pending-cv p { margin: 6px 0 8px; }
.cvb-pending-cv a { color: #15803d; font-weight: 900; text-decoration: underline; }
.cvb-pending-upload summary { cursor: pointer; }
body.theme-dark .cvb-pending-cv { border-color: #14532d; background: #052e16; }
body.theme-dark .cvb-pending-cv strong, body.theme-dark .cvb-pending-cv a { color: #bbf7d0; }

/* FAQ */
.cvb-faq { max-width: 780px; margin: 28px auto 0; display: grid; gap: 10px; }
.cvb-faq-item { border: 1px solid #dfe9f6; border-radius: 14px; background: #fff; padding: 14px 18px; }
.cvb-faq-item summary { cursor: pointer; font-size: 16px; font-weight: 900; color: #0d1330; list-style: none; }
.cvb-faq-item summary::-webkit-details-marker { display: none; }
.cvb-faq-item summary::after {
    content: ""; float: right; width: 8px; height: 8px; margin-top: 6px;
    border-right: 2px solid #64748b; border-bottom: 2px solid #64748b; transform: rotate(45deg); transition: transform .2s;
}
.cvb-faq-item[open] summary::after { transform: rotate(225deg); }
.cvb-faq-item p { margin: 10px 0 0; color: #475569; font-size: 15.5px; line-height: 1.65; }
.cvb-final-cta { max-width: 620px; margin: 40px auto 0; text-align: center; }
.cvb-final-cta h3 { font-size: 23px; }
.cvb-final-cta p { margin: 10px 0 20px; color: #475569; font-size: 16px; line-height: 1.65; }

/* RTL: the summary::after caret and the check bullets are the only pieces that
   carry a hard side. rtl.css flips layout globally; these need explicit help. */
[dir="rtl"] .cvb-hero-points li { padding-left: 0; padding-right: 30px; }
[dir="rtl"] .cvb-hero-points li::before { left: auto; right: 0; }
[dir="rtl"] .cvb-hero-points li::after { left: auto; right: 6px; }
[dir="rtl"] .cvb-faq-item summary::after { float: left; }
[dir="rtl"] .cvb-paper { transform: rotate(2deg); }
[dir="rtl"] .cvb-paper-badge { right: auto; left: 4%; }

/* Dark theme */
body.theme-dark .cvb-hero-sub, body.theme-dark .cvb-section-sub,
body.theme-dark .cvb-step p, body.theme-dark .cvb-faq-item p, body.theme-dark .cvb-final-cta p { color: #cbd5e1; }
body.theme-dark .cvb-hero-points li { color: #e5e7eb; }
body.theme-dark .cvb-step, body.theme-dark .cvb-template-card, body.theme-dark .cvb-block,
body.theme-dark .cvb-faq-item, body.theme-dark .cvb-template-option-body {
    border-color: #2a3a70; background: #101a3d; color: #e5e7eb;
}
body.theme-dark .cvb-block legend, body.theme-dark .cvb-faq-item summary { color: #e5e7eb; }
body.theme-dark .cvb-field > span { color: #cbd5e1; }
body.theme-dark .cvb-field input, body.theme-dark .cvb-field textarea { border-color: #2a3a70; background: #0d1330; color: #e5e7eb; }
body.theme-dark .cvb-step-num { background: #172450; color: #bcd2f2; }
body.theme-dark .cvb-template-option input:checked + .cvb-template-option-body { border-color: #6693e0; background: #172450; }
body.theme-dark .cvb-template-thumb { border-color: #2a3a70; background: #0d1330; }
body.theme-dark .cvb-thumb-line { background: #1e2a55; }
body.theme-dark .cvb-row { border-top-color: #2a3a70; }
body.theme-dark .cvb-row-remove { border-color: #4c1d24; background: #0d1330; }
body.theme-dark .cvb-hint, body.theme-dark .cvb-wall-note, body.theme-dark .cvb-template-option-body small,
body.theme-dark .cvb-template-card p { color: #cbd5e1; }
body.theme-dark .cvb-paper-line { background: #1e2a55; }
body.theme-dark .cvb-paper-rule { background: #2a3a70; }
body.theme-dark .cvb-paper-chips span { background: #172450; }
/* The preview paper stays white in dark mode on purpose — it is a picture of a
   printed page, and inverting it would misrepresent what downloads. */
body.theme-dark .cvb-paper { border-color: #2a3a70; background: #fff; }
body.theme-dark .cvb-preview-stage { border-color: #2a3a70; background: #fff; }

@media (max-width: 1024px) {
    .cvb-hero { grid-template-columns: 1fr; gap: 34px; }
    .cvb-hero-art { order: -1; }
    .cvb-layout { grid-template-columns: 1fr; }
    /* Un-stick the preview once it sits below the form: pinning it there would
       cover the fields the visitor is trying to fill in. */
    .cvb-preview-sticky { position: static; }
    .cvb-preview-stage { max-height: none; }
    .cvb-steps, .cvb-template-gallery, .cvb-why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .cvb-steps, .cvb-template-gallery, .cvb-why-grid, .cvb-grid-2, .cvb-template-picker { grid-template-columns: 1fr; }
    .cvb-block { padding: 16px; }
    .cvb-preview-actions .btn { width: 100%; }
    /* theme-violet.css also pins h1 to 44px!important at this breakpoint, so
       the same specificity argument as above applies here. */
    .cvb-hero .cvb-hero-title { font-size: 30px !important; }
    .cvb-section-title { font-size: 25px; }
    .cvb-ai-controls { grid-template-columns: 1fr; }
    .cvb-ai-run { width: 100%; }
}

/* Print: the fallback path when server-side PDF generation is unavailable, and
   a genuine convenience otherwise. Everything except the preview paper is
   dropped so the sheet prints on its own. */
/* Print exactly the CV sheet and nothing else.
   This was a blacklist of sections to hide, which rotted the moment the page
   changed: it still named two sections that had been deleted while the newer
   "why build it here" block and the progress checklist were never added, so
   printing produced the comparison table and a to-do list stapled to the CV.
   Hiding everything and revealing only the sheet cannot fall out of date. */
@media print {
    /* cv-builder.js clones the sheet into #cvb-print-root, a direct child of
       <body>, before printing. Everything else is simply hidden — no chain of
       ancestors to keep in step, and nothing here to update when the page
       gains or loses a section. */
    body > *:not(#cvb-print-root) { display: none !important; }

    /* base.css paints a blue gradient on body, which printers reproduce as a
       tinted wash across a CV that should be plain white paper. */
    html, body { background: #fff !important; }

    #cvb-print-root { display: block !important; background: #fff !important; }
    #cvb-print-root .cvb-preview-paper {
        width: auto !important; min-height: 0 !important;
        margin: 0 !important; padding: 0 !important;
        /* At true size: the on-screen scale exists to fit a column, and
           carrying it into print would put a shrunken CV on a full page. */
        transform: none !important;
        border: 0 !important; box-shadow: none !important; background: #fff !important;
    }
    @page { margin: 14mm; }
}
