/* "Fix my CV" (public/fix.js): dark screens around a white page in our own
   classic layout. Source Serif 4 is self-hosted (SIL OFL 1.1, see fonts/). */

@font-face { font-family: "CVC Serif"; src: url("fonts/SourceSerif4-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "CVC Serif"; src: url("fonts/SourceSerif4-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

/* The offer on the result screen */
.fix-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); }
.result .fix-offer { background: var(--indigo-soft); border-color: rgba(165, 139, 255, 0.35); }
.fix-offer-text { flex: 1 1 260px; color: var(--white); font-size: 18px; font-weight: 600; }
.fix-offer .cta { flex: none; border: none; font: inherit; font-size: 17px; font-weight: 650; cursor: pointer; }

/* Screens */
.fixer { display: grid; gap: var(--s3); max-width: 860px; margin: 0 auto; color: var(--white); }
.fixer[hidden] { display: none; }
.fixer:focus { outline: none; }
.fix-head h2 { font-size: clamp(28px, 4.4vw, 40px); }
.fix-head p { margin-top: var(--s1); color: var(--on-navy); font-size: 17px; line-height: 1.55; }
.fixer .sample-flag { color: var(--white); }
.fix-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.fixer .cta { border: none; font: inherit; font-size: 17px; font-weight: 650; cursor: pointer; }
.fixer .cta[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.fixer .again { color: var(--white); border-color: var(--indigo-light); }
.fixer .status { color: var(--white); background: var(--surface); border-color: var(--glass-line); }
.fixer .status.problem { border-color: var(--partial); }
.fixer .status.loading { background: rgba(99, 49, 251, 0.22); border-color: rgba(165, 139, 255, 0.35); }
.fixer .status h3 { font-size: 20px; margin-bottom: var(--s1); }

/* Questions */
.fix-questions { display: grid; gap: var(--s2); }
.fix-q { display: grid; gap: var(--s1); background: var(--surface); border-color: var(--glass-line); color: var(--white); }
.fix-q-label { font-size: 17px; font-weight: 600; line-height: 1.45; }
.fix-q textarea { width: 100%; min-height: 84px; padding: 12px 14px; border: 1px solid var(--glass-line); border-radius: 12px; background: var(--navy); color: var(--white); font: inherit; font-size: 16px; line-height: 1.5; resize: vertical; }
.fix-q textarea:disabled { opacity: 0.45; }
.fix-unsure { justify-self: start; min-height: 44px; padding: 0 var(--s2); border: 1px solid var(--glass-line); border-radius: 999px; background: none; color: var(--on-navy); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.fix-unsure[aria-pressed="true"] { background: var(--indigo); border-color: var(--indigo); color: var(--white); }

/* [X] status above the page */
.fix-xnote { padding: 12px var(--s2); border-radius: 12px; background: rgba(232, 163, 23, 0.14); border: 1px solid rgba(232, 163, 23, 0.5); color: var(--white); font-size: 16px; line-height: 1.5; }
.fix-xnote.ready { background: rgba(99, 49, 251, 0.18); border-color: rgba(165, 139, 255, 0.4); }
.fix-xitems { display: grid; gap: var(--s2); margin-top: var(--s2); padding: 0; list-style: none; }
.fix-xitems li { display: grid; gap: var(--s1); }
.fix-xitems p { overflow-wrap: anywhere; }
.fix-xitems .cv-tool { justify-self: start; }
.fixer .status .cv-x { background: #FFE08A; color: #1A1400; }

/* The page: white, black text, one column, serif */
.cv-page {
  --cv-ink: #111111; --cv-soft: #4A4A4A; --cv-accent: #4B23D9;
  width: 100%; max-width: 794px; margin: 0 auto; padding: clamp(20px, 6vw, 60px) clamp(16px, 6vw, 64px);
  background: #FFFFFF; color: var(--cv-ink); border-radius: 6px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  font-family: "CVC Serif", Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.45;
  overflow-wrap: anywhere;
}
.cv-header { text-align: center; }
.cv-header .cv-style-name .cv-text { font-size: clamp(24px, 4vw, 30px); font-weight: 700; line-height: 1.2; text-align: center; }
.cv-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; margin-top: 6px; font-size: 14.5px; }
.cv-contact .cv-item { display: inline-flex; flex-direction: column; align-items: center; max-width: 100%; }
.cv-contact .cv-text { text-align: center; }
.cv-section { margin-top: 22px; }
.cv-heading { margin: 0 0 8px; padding-bottom: 3px; border-bottom: 1px solid var(--cv-ink); font-family: inherit; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.3; }
.cv-list { margin: 2px 0 0; padding-left: 1.2em; }
.cv-list li { margin: 2px 0; }
.cv-list li::marker { color: var(--cv-ink); }
.cv-entry-first { margin-top: 12px; font-weight: 700; }
.cv-section .cv-heading + .cv-entry-first { margin-top: 0; }
.cv-style-text { margin: 4px 0; }

/* Every line is a button that opens its editor */
.cv-item { position: relative; }
.cv-text { display: block; width: 100%; padding: 2px 4px; margin: 0 -4px; border: 0; border-radius: 4px; background: none; color: inherit; font: inherit; text-align: left; line-height: inherit; cursor: text; overflow-wrap: anywhere; }
.cv-text:hover { background: #F2F0F8; }
.cv-text:focus-visible { outline: 2px solid var(--cv-accent); outline-offset: 1px; }
.cv-x { padding: 0 2px; border-radius: 3px; background: #FFE08A; color: #1A1400; font-weight: 700; }

/* Rewritten (and newly written) lines are highlighted, with a switch back */
.cv-item.is-rewritten > .cv-text { background: #F1ECFF; box-shadow: inset 3px 0 0 var(--cv-accent); padding-left: 10px; }
.cv-item.is-original > .cv-text { box-shadow: inset 3px 0 0 #B9B9C6; padding-left: 10px; }
.cv-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 8px; font-family: Inter, system-ui, sans-serif; }
.cv-seg { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid #C9C3E6; border-radius: 999px; }
.cv-tool { min-height: 36px; padding: 0 12px; border: 1px solid #C9C3E6; border-radius: 999px; background: #FFFFFF; color: var(--cv-accent); font: inherit; font-family: Inter, system-ui, sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; }
.cv-seg .cv-tool { border-color: transparent; }
.cv-tool[aria-pressed="true"] { background: var(--cv-accent); border-color: var(--cv-accent); color: #FFFFFF; }
.cv-tool:focus-visible { outline: 2px solid var(--cv-accent); outline-offset: 2px; }
.cv-delete { color: #A3261F; border-color: #E4B4B0; }
.cv-own { font-size: 13px; font-weight: 600; color: var(--cv-soft); }
.fixer .status .cv-tool { background: var(--white); }

/* Editing a line */
.cv-editor { display: grid; gap: 6px; margin: 4px 0 10px; }
.cv-editor textarea { width: 100%; padding: 8px 10px; border: 2px solid var(--cv-accent); border-radius: 6px; background: #FFFFFF; color: var(--cv-ink); font: inherit; font-size: 16px; line-height: 1.45; resize: vertical; }
.cv-save { background: var(--cv-accent); border-color: var(--cv-accent); color: #FFFFFF; }

/* Deleted lines stay on screen (never in the PDF) so they can be restored */
.cv-item.is-deleted { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0; color: #5C5C66; font-size: 14px; }
.cv-deleted-text { text-decoration: line-through; overflow-wrap: anywhere; }
.cv-list .cv-item.is-deleted { list-style: none; margin-left: -1.2em; }

@media (max-width: 480px) {
  .cv-page { font-size: 15px; }
  .cv-contact { font-size: 13.5px; }
  .cv-tool { min-height: 40px; }
}
