/* ATS CV Builder. The same design as the engineers registry's form
   (ieuoil-registry.com, static/css/site.css): font, colours, section cards,
   fields, pill choices and buttons, in English and left to right.
   No third-party resources (the CSP allows only this site). */

@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-display: swap;
  font-weight: 160 700;
  src: url("../fonts/readex-pro-latin-wght-normal.aa0c29916314.woff2") format("woff2-variations");
}

:root {
  color-scheme: light;

  --canvas: #f1f3ef;
  --surface: #ffffff;
  --surface-2: #f6f7f4;
  --line: #e6e9e3;
  --line-2: #d6dbd3;
  --ink: #101814;
  --ink-2: #4f5a54;
  --muted: #626c66;

  --g950: #0b2e20;
  --g900: #0f3d2a;
  --g800: #134e35;
  --g700: #1a6644;
  --g600: #23804f;
  --g300: #8fd0aa;
  --g200: #bfe5cd;
  --g100: #e2f3e8;
  --g50: #f2f9f4;

  --good-bg: #e6f4e6;
  --good-ink: #006300;
  --warn-bg: #fff3d6;
  --warn-ink: #7a4b00;
  --crit-bg: #fde7e7;
  --crit-ink: #a8201a;
  --error: #b42318;

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 12px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(16, 24, 20, 0.04), 0 12px 32px -18px rgba(16, 24, 20, 0.18);
  --ring: 0 0 0 3px rgba(35, 128, 79, 0.25);

  --cv-accent: #1f3a5f;

  font-family: "Readex Pro", system-ui, "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; line-height: 1.6; background: var(--canvas); color: var(--ink); }
h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 600; }
p { margin: 0 0 0.75rem; }
a { color: var(--g700); text-underline-offset: 3px; }
a:hover { color: var(--g900); }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 8px; }

.visually-hidden {
  position: absolute !important; inline-size: 1px; block-size: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* --- Header, page, footer ---------------------------------------------------- */

.wrap { max-inline-size: 1040px; margin-inline: auto; padding-inline: 16px; }
.public-header { background: var(--surface); border-block-end: 1px solid var(--line); }
.public-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand-mark { inline-size: 42px; block-size: 42px; border-radius: 50%; overflow: hidden; flex: none; background: #fff; }
.brand-mark img { inline-size: 100%; block-size: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-name { font-weight: 600; font-size: 1rem; color: var(--ink); }
.brand-unit { font-size: 0.78rem; color: var(--muted); }
.public-main { padding-block: 32px 64px; }
.public-footer { color: var(--muted); font-size: 0.82rem; padding-block: 0 32px; }
.public-footer p { max-inline-size: 80ch; }

.hero { margin-block-end: 24px; }
.hero h1 { font-size: 2rem; margin-block-end: 8px; letter-spacing: -0.01em; }
.hero p { color: var(--ink-2); max-inline-size: 70ch; }
.hero .rule { color: var(--ink); font-weight: 500; }

/* --- Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-block-size: 42px; padding: 8px 18px;
  border: 1px solid var(--line-2); border-radius: var(--pill);
  background: var(--surface); color: var(--ink);
  font: inherit; font-size: 0.92rem; font-weight: 500; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--g700); color: var(--g800); }
.btn-primary { background: var(--g800); border-color: var(--g800); color: #fff; }
.btn-primary:hover { background: var(--g900); border-color: var(--g900); color: #fff; }
.btn-sm { min-block-size: 34px; padding: 5px 14px; font-size: 0.85rem; }
.btn-add { border-style: dashed; color: var(--g800); }
.link-btn { background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 0.85rem; color: var(--crit-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* --- Form controls ------------------------------------------------------------ */

input, select, textarea {
  font: inherit; color: var(--ink);
  inline-size: 100%; min-block-size: 44px; padding: 9px 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-block-size: 96px; resize: vertical; line-height: 1.55; }
input:hover, select:hover, textarea:hover { border-color: #b9c1b6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--g600); box-shadow: var(--ring); }
input[type="checkbox"], input[type="radio"] { inline-size: auto; min-block-size: 0; accent-color: var(--g700); }
::placeholder { color: #8a948e; }

/* Six columns: ordinary fields take two (three to a row, as on the registry's
   form), dates and numbers one, text areas and choices the whole row. */
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px 20px; }
.field { margin-block-end: 14px; display: flex; flex-direction: column; min-inline-size: 0; grid-column: span 2; }
.field--short { grid-column: span 1; }
.field--wide, .field--choice { grid-column: 1 / -1; }
.field--check { justify-content: center; min-block-size: 44px; align-self: end; }
.field > label { font-size: 0.88rem; font-weight: 500; margin-block-end: 6px; color: var(--ink); }
.field.required > label::after, fieldset.choice.required > legend::after { content: " *"; color: var(--error); }
.has-error input, .has-error select, .has-error textarea { border-color: var(--error); }
.help { font-size: 0.8rem; color: var(--muted); margin: 6px 0 0; }
.error { font-size: 0.84rem; color: var(--error); margin: 6px 0 0; }

fieldset.choice { border: 0; padding: 0; margin: 0 0 14px; min-inline-size: 0; }
fieldset.choice > legend { font-size: 0.88rem; font-weight: 500; margin-block-end: 8px; padding: 0; }
.choice > div { display: flex; flex-wrap: wrap; gap: 8px; }
.choice > div > div label {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--pill);
  background: var(--surface); cursor: pointer; font-size: 0.9rem;
  transition: border-color 0.15s, background-color 0.15s;
}
.choice > div > div label:hover { border-color: var(--g600); }
.choice > div > div label:has(input:checked) { border-color: var(--g700); background: var(--g100); color: var(--g950); }
.choice input { margin: 0; }

.check { display: flex; gap: 10px; align-items: center; font-size: 0.9rem; cursor: pointer; }
.check input { inline-size: 18px; block-size: 18px; margin: 0; }

@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field, .field--check { grid-column: 1 / -1; }
  .field--short { grid-column: span 1; }
  .field--check { min-block-size: 0; }
}

/* --- Notices ------------------------------------------------------------------ */

.notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  padding: 12px 16px; border-radius: var(--radius-sm); margin-block-end: 16px;
  background: var(--warn-bg); color: var(--warn-ink);
}
.notice-error { background: var(--crit-bg); color: var(--crit-ink); }
.notice a { color: inherit; font-weight: 500; }

/* --- Section cards (as on the registry's form) ---------------------------------- */

.section {
  border: 0; margin: 0 0 18px; padding: 22px 24px 10px; min-inline-size: 0;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  scroll-margin-block-start: 16px;
}
.section > legend {
  float: inline-start; inline-size: 100%;
  display: flex; align-items: center; gap: 12px;
  font-size: 1.08rem; font-weight: 600; padding: 0; margin-block-end: 14px;
}
.section > legend + * { clear: both; }
.section h3 { font-size: 0.98rem; margin-block: 8px 12px; }
.step-n {
  inline-size: 32px; block-size: 32px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: none;
  background: var(--g100); color: var(--g900); font-size: 0.9rem; font-weight: 600;
}
.section-intro { color: var(--ink-2); font-size: 0.9rem; margin-block: -4px 14px; }
.optional { font-size: 0.78rem; font-weight: 500; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 10px; border-radius: var(--pill); }
.final { background: var(--g50); box-shadow: inset 0 0 0 1px var(--g200); }

/* Writing advice: like the registry's notes under a field. */
.guide {
  margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; line-height: 1.7;
  background: var(--g50); color: var(--g950); border-inline-start: 3px solid var(--g600);
}
.guide summary { cursor: pointer; font-weight: 500; color: var(--g800); }
.guide ul, .guide ol { padding-inline-start: 20px; margin-block: 8px; }
.guide li { margin-block: 3px; }
.example { margin: 8px 0; padding: 8px 12px; border-radius: 8px; background: #fff; color: var(--ink-2); }

/* One entry of a repeatable section (a job, a degree, ...). */
.entry { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 4px; margin: 0 0 14px; background: var(--surface); }
.entry-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-block-end: 12px; }
.entry-title { font-weight: 600; font-size: 0.92rem; color: var(--g800); }
.entry-remove { display: flex; justify-content: flex-end; }
.formset { margin-block-end: 16px; }

/* --- Preview and download -------------------------------------------------------- */

.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-block: 4px 12px; }
.start-over { font-size: 0.85rem; color: var(--muted); margin-block: 8px 12px; }

.review h3, .preview h3 { font-size: 1rem; margin-block: 18px 8px; }
.findings { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.finding { display: flex; gap: 10px; align-items: baseline; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); font-size: 0.9rem; }
.finding--warning { background: var(--warn-bg); border-color: transparent; }
.finding--ok { background: var(--good-bg); color: var(--good-ink); border-color: transparent; }
.badge { flex: none; display: inline-flex; padding: 2px 10px; border-radius: var(--pill); font-size: 0.75rem; font-weight: 500; background: var(--g100); color: var(--g900); }
.finding--warning .badge { background: #fff; color: var(--warn-ink); }

/* The CV preview mirrors cvdocs/templates/classic (Calibri/Carlito, navy headings). */
.cv-sheet {
  background: #fff; color: #1a1a1a; max-inline-size: 794px; margin: 10px auto 18px; padding: 46px 54px;
  border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 10px 30px -12px rgba(0,0,0,.18);
  font-family: Calibri, Carlito, "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.32;
}
@media (max-width: 640px) { .cv-sheet { padding: 22px 18px; } }
.cv-sheet p { margin: 0 0 3px; }
.cv-name { font-size: 27px; font-weight: 700; color: var(--cv-accent); margin: 0 !important; }
.cv-headline { font-size: 16px; color: #4a4a4a; }
.cv-contact { font-size: 12.5px; margin-block-end: 6px !important; white-space: pre-wrap; }
.cv-heading { margin: 14px 0 5px; font-size: 14.5px; color: var(--cv-accent); border-block-end: 1px solid var(--cv-accent); padding-block-end: 1px; }
.cv-entry { margin-block-start: 7px; }
.cv-entry__title { display: flex; justify-content: space-between; gap: 12px; font-weight: 700; margin: 0 !important; }
.cv-date { font-weight: 400; white-space: nowrap; }
.cv-entry__detail { color: #4a4a4a; }
.cv-label { font-weight: 700; font-style: italic; color: #4a4a4a; font-size: 13px; }
.cv-sheet ul { margin: 0 0 3px; padding-inline-start: 22px; }
.cv-sheet li { margin: 0 0 2px; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  .section { padding: 18px 16px 6px; border-radius: var(--radius); }
  .brand-unit { display: none; }
}

/* --- Academic preview (cvdocs/templates/academic) ---------------------------- */
.cv-academic { color: #000; font-size: 14.5px; line-height: 1.38; }
.cv-academic .cv-name { color: #000; font-size: 21px; text-align: center; padding-block-end: 3px; border-block-end: 1.3px solid #000; margin-block-end: 6px !important; }
.cv-academic .cv-headline { text-align: center; color: #000; font-size: 14.5px; }
.cv-academic .cv-contact { text-align: center; font-size: 14.5px; white-space: normal; }
.cv-academic .cv-link, .cv-modern .cv-link { color: #0563c1; text-decoration: underline; }
.cv-academic .cv-heading { color: #000; font-size: 14.5px; border-block-end: 1.3px solid #000; margin-block: 12px 8px; }
.cv-academic .cv-just, .cv-academic li { text-align: justify; }
.cv-academic ul { padding-inline-start: 46px; }
.cv-row { display: flex; justify-content: space-between; gap: 14px; }
.cv-row > span:last-child { white-space: nowrap; }
.cv-academic .cv-row--title { font-weight: 700; margin-block-start: 6px !important; }
.cv-academic .cv-row--title > span:last-child { font-weight: 400; }
.cv-academic .cv-label { font-style: italic; font-weight: 400; color: #000; font-size: 14.5px; }
.cv-footer { text-align: center; font-size: 13px; margin-block-start: 24px !important; color: #000; }

/* --- Modern preview (cvdocs/templates/modern) ------------------------------- */
@font-face { font-family: "Play"; font-weight: 400; font-display: swap; src: url("../fonts/Play-Regular.18e2f68fb6fb.ttf") format("truetype"); }
@font-face { font-family: "Play"; font-weight: 700; font-display: swap; src: url("../fonts/Play-Bold.f0dbb3f25a77.ttf") format("truetype"); }
@font-face { font-family: "Tenor Sans"; font-weight: 400; font-display: swap; src: url("../fonts/TenorSans-Regular.31703b2501da.ttf") format("truetype"); }
.cv-modern { color: #000; font-family: Play, Arial, sans-serif; font-size: 13.3px; line-height: 1.36; }
.cv-modern .cv-name { font-family: "Tenor Sans", Play, sans-serif; font-weight: 400; font-size: 37px; color: #000; text-align: center; line-height: 1.1; }
.cv-modern .cv-headline { text-align: center; color: #000; font-size: 17px; margin-block-end: 12px !important; }
.cv-modern .cv-band { text-align: center; background: #f2f2f2; padding: 1px 6px; }
.cv-modern .cv-heading { color: #000; font-size: 13.3px; border-block-end: 1px solid #a5a5a5; margin-block: 16px 9px; }
.cv-modern .cv-just, .cv-modern li { text-align: justify; }
.cv-modern ul { padding-inline-start: 46px; }
.cv-modern .cv-row--entry { margin-block: 8px 6px !important; }
.cv-modern .cv-label { font-weight: 700; font-style: normal; color: #000; font-size: 13.3px; }

/* --- Choosing a template ------------------------------------------------------ */
.templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 0 0 16px; padding: 0; border: 0; grid-column: 1 / -1; }
.templates > legend { font-size: 0.88rem; font-weight: 500; margin-block-end: 8px; padding: 0; }
.template-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; }
.template-card:hover { border-color: var(--g600); }
.template-card:has(input:checked) { border-color: var(--g700); background: var(--g50); box-shadow: 0 0 0 2px var(--g300); }
.template-card:has(input:focus-visible) { box-shadow: var(--ring); }
.template-card img { inline-size: 100%; block-size: auto; border-radius: 6px; border: 1px solid var(--line); background: #fff; aspect-ratio: 210 / 297; object-fit: cover; object-position: top; }
.template-card .template-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.92rem; }
.template-card .template-name input { margin: 0; }
.template-card .template-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.45; }

/* --- Section order -------------------------------------------------------------- */
.order h3 { font-size: 1rem; margin-block: 18px 6px; }
.order-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; max-inline-size: 620px; }
.order-list li { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.order-n { inline-size: 24px; block-size: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--g100); color: var(--g900); font-size: 0.78rem; font-weight: 600; }
.order-label { flex: 1; min-inline-size: 0; font-size: 0.9rem; font-weight: 500; overflow-wrap: anywhere; }
.order-btns { display: flex; gap: 6px; flex: none; }
.order-btns .btn { min-block-size: 32px; padding: 4px 12px; }
.btn[disabled] { opacity: 0.4; cursor: default; border-color: var(--line-2); color: var(--muted); }
.link-btn--plain { color: var(--g800); }
@media (max-width: 480px) { .order-btns .btn { padding: 4px 9px; font-size: 0.8rem; } }
