/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --border: #e4e7ee;
  --text: #1a1d29;
  --text-dim: #4b5266;
  --text-faint: #8a90a3;
  --cream: #fdfdfd;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20,20,40,.04), 0 8px 24px -12px rgba(20,20,40,.12);
  --shadow-lg: 0 20px 60px -20px rgba(20,20,40,.28);
  --sans: 'Inter', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12131a;
    --surface: #191b24;
    --border: #2b2e3b;
    --text: #eef0f6;
    --text-dim: #b6bacb;
    --text-faint: #7d8299;
    --cream: #1f2129;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; letter-spacing: -0.01em; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--text); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 500;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 1.2rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.accent { color: var(--accent); }

/* =============================================================
   4. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: .92rem;
  transition: transform .2s var(--ease-out), background .2s var(--ease-out), box-shadow .2s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { padding: .55rem 1rem; font-size: .82rem; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 999px; }
.btn-icon:hover { background: var(--border); }
.btn[disabled] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.import-label { position: relative; }

/* =============================================================
   5. Header / footer
   ============================================================= */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.05rem; }
.logo svg { width: 22px; height: 22px; color: var(--accent); }
.site-nav { display: flex; gap: 1.4rem; font-size: .9rem; font-weight: 600; color: var(--text-dim); margin-left: auto; margin-right: 1.4rem; }
.site-nav a:hover { color: var(--accent); }
.site-menu { display: none; position: relative; margin-left: auto; margin-right: .6rem; }
.site-menu summary { list-style: none; cursor: pointer; width: 2.4rem; height: 2.4rem; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 1.1rem; line-height: 1; }
.site-menu summary::-webkit-details-marker { display: none; }
.site-menu nav { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 12rem; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: .4rem; z-index: 50; }
.site-menu nav a { padding: .6rem .8rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .95rem; }
.site-menu nav a:hover { background: var(--border); }
@media (max-width: 800px) { .site-nav { display: none; } .site-menu { display: block; } }

footer { padding: 2.4rem 0 3rem; border-top: 1px solid var(--border); margin-top: 2rem; }
.footer-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; font-size: .85rem; color: var(--text-dim); }
.footer-links a:hover { color: var(--accent); }
.footer-credits { font-size: .76rem; color: var(--text-faint); max-width: 70ch; }

/* =============================================================
   6. Hero
   ============================================================= */
.hero { padding: 2.6rem 0 3rem; }
.hero-container { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-title { font-size: clamp(1.9rem, 5vw, 3rem); max-width: 20ch; margin: .8rem 0 1rem; }
.hero-sub { max-width: 62ch; color: var(--text-dim); font-size: 1.05rem; margin-bottom: 1.4rem; }
.badge-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-bottom: 2rem; }
.badge { display: inline-flex; align-items: center; gap: .5rem; padding: .5rem .9rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .8rem; color: var(--text-dim); }
.badge svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }

/* =============================================================
   7. Wizard shell
   ============================================================= */
.wizard-shell {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 68px minmax(0,1fr);
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: left;
  min-height: 640px;
}

/* --- rail --- */
.wizard-rail {
  grid-row: 1 / -1;
  background: color-mix(in srgb, var(--bg) 60%, var(--surface));
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center;
  padding: 1.2rem .5rem;
  gap: 1.2rem;
}
.rail-steps { display: flex; flex-direction: column; gap: .4rem; flex: 1; width: 100%; }
.rail-step {
  width: 100%; padding: .3rem .4rem; border-radius: 999px;
  display: flex; align-items: center; gap: .4rem;
  color: var(--text-faint);
  background: var(--surface); border: 1.5px solid var(--border);
  transition: all .2s var(--ease-out);
}
.rail-step-dot {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: .66rem; font-weight: 700; border: 1.5px solid var(--border);
  color: var(--text-faint); background: var(--cream);
  transition: all .2s var(--ease-out);
}
.rail-step-label {
  font-size: .64rem; font-weight: 600; line-height: 1.1; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rail-step:hover { border-color: var(--accent); color: var(--accent); }
.rail-step:hover .rail-step-dot { border-color: var(--accent); color: var(--accent); }
.rail-step.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); }
.rail-step.is-active .rail-step-dot { border-color: var(--accent); background: var(--accent); color: #fff; }
.rail-step.is-done .rail-step-dot { border-color: var(--success); background: var(--success); color: #fff; }
.rail-step.is-done .rail-step-label { color: var(--text-dim); }
.rail-next {
  width: 40px; height: 40px; border-radius: 999px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 60%, transparent);
  transition: transform .2s var(--ease-out);
}
.rail-next:hover { transform: scale(1.08); }
.rail-next svg { width: 18px; height: 18px; }
.rail-health { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.health-ring { position: relative; width: 40px; height: 40px; }
.health-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.health-track { fill: none; stroke: var(--border); stroke-width: 4; }
.health-fill { fill: none; stroke: var(--success); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100.5; stroke-dashoffset: 100.5; transition: stroke-dashoffset .4s var(--ease-out); }
.health-score { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .58rem; font-weight: 800; }
.health-tip { display: none; }

/* --- form column --- */
.wizard-form-col { padding: 1.6rem 1.4rem; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.form-panel { border: 0; padding: 0; background: transparent; }
.step-count { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: .4rem; }
.step-title { font-size: 1.5rem; margin-bottom: .35rem; }
.step-subtitle { color: var(--text-dim); font-size: .9rem; margin-bottom: 1.3rem; max-width: 60ch; }

.step-body { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem 1rem; }
.field-full { grid-column: 1 / -1; }
.field {
  display: flex; flex-direction: column; gap: .3rem; position: relative;
}
.field-label-row { display: flex; align-items: center; gap: .35rem; }
.field label { font-size: .8rem; font-weight: 600; color: var(--text-dim); }
.help-icon {
  width: 15px; height: 15px; border-radius: 999px; background: var(--border); color: var(--text-dim);
  display: inline-flex; align-items: center; justify-content: center; font-size: .64rem; font-weight: 800;
  cursor: help; position: relative; flex-shrink: 0;
}
.help-icon .tooltip {
  position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); font-size: .72rem; font-weight: 500;
  padding: .5rem .7rem; border-radius: 8px; width: max-content; max-width: 240px;
  opacity: 0; pointer-events: none; transition: opacity .15s var(--ease-out);
  z-index: 5; line-height: 1.4;
}
.help-icon:hover .tooltip, .help-icon:focus-visible .tooltip { opacity: 1; }

.field-input-wrap { position: relative; display: flex; align-items: center; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field input[type="date"], .field select, .field textarea {
  width: 100%; padding: .68rem .9rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--cream); font-size: .9rem;
  transition: border-color .2s var(--ease-out);
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.field-check {
  position: absolute; right: .7rem; top: 2.15rem; width: 18px; height: 18px; color: var(--success);
  opacity: 0; transform: scale(.6); transition: all .2s var(--ease-out);
}
.field.is-valid .field-check { opacity: 1; transform: scale(1); }
.field-error { font-size: .72rem; color: var(--danger); min-height: 1em; }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--danger); }
.step-warning {
  color: var(--danger); font-size: .84rem; font-weight: 600; margin-top: 1rem;
  padding: .7rem .9rem; background: color-mix(in srgb, var(--danger) 8%, transparent);
  border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
}

.checkbox-row { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--accent); }
.checkbox-row label { font-size: .86rem; color: var(--text); font-weight: 500; }

/* photo field */
.photo-field { display: flex; align-items: center; gap: .9rem; }
.photo-preview {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--border); display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 1.4rem;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* suggestions button + list */
.suggest-btn { align-self: flex-start; font-size: .78rem; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: .3rem; margin-top: .2rem; }
.suggest-btn:hover { text-decoration: underline; }
.suggest-panel {
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--cream);
  padding: .8rem; margin-top: .5rem; display: flex; flex-direction: column; gap: .55rem; max-height: 220px; overflow-y: auto;
}
.suggest-item { display: flex; align-items: flex-start; gap: .5rem; font-size: .82rem; }
.suggest-item input { margin-top: .2rem; accent-color: var(--accent); }

/* pill row (optional fields / extras) */
.pill-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.pill-btn {
  padding: .45rem .9rem; border-radius: 999px; border: 1.5px dashed var(--border);
  font-size: .78rem; font-weight: 600; color: var(--text-dim); background: var(--cream);
  transition: all .2s var(--ease-out);
}
.pill-btn:hover { border-color: var(--accent); color: var(--accent); }
.pill-btn.is-active { display: none; }

.step-nav { display: flex; justify-content: space-between; margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }

/* repeatable blocks (experience/education/extras) */
.rep-block { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: .9rem; grid-column: 1/-1; }
.rep-block-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.rep-block-head strong { font-size: .86rem; }
.rep-remove { font-size: .76rem; color: var(--danger); font-weight: 600; }
.rep-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: .8rem; }
.add-rep-btn { grid-column: 1/-1; border: 1.5px dashed var(--border); border-radius: var(--radius-sm); padding: .8rem; font-size: .85rem; font-weight: 700; color: var(--accent); text-align: center; }
.add-rep-btn:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.field-hint { grid-column: 1/-1; font-size: .76rem; color: var(--text-faint); margin-top: -.3rem; }

.skill-row, .lang-row {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; grid-column: 1/-1;
  background: var(--cream); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: .5rem .5rem .5rem .9rem; transition: border-color .2s var(--ease-out);
}
.skill-row:focus-within, .lang-row:focus-within { border-color: var(--accent); }
.skill-row input, .lang-row input {
  flex: 1 1 140px; min-width: 0; border: none; background: transparent;
  padding: .5rem .2rem; font-size: .9rem; color: var(--text);
}
.skill-row input:focus, .lang-row input:focus { outline: none; }
.skill-row select, .lang-row select {
  width: 140px; flex-shrink: 0; border: 1.5px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); padding: .45rem .9rem; font-size: .82rem; font-weight: 600;
}
.skill-row select:focus, .lang-row select:focus { outline: none; border-color: var(--accent); }
.tag-remove {
  color: var(--text-faint); font-size: .85rem; font-weight: 700; flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s var(--ease-out);
}
.tag-remove:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }

.extras-checklist { grid-column: 1/-1; display: grid; grid-template-columns: repeat(2,1fr); gap: .6rem; margin-bottom: 1rem; }

/* template step */
.template-grid { grid-column: 1/-1; display: grid; grid-template-columns: repeat(3,1fr); gap: .8rem; }
.template-card { border: 2px solid var(--border); border-radius: var(--radius-sm); padding: .7rem; text-align: center; cursor: pointer; transition: all .2s var(--ease-out); }
.template-card:hover { border-color: var(--accent); }
.template-card.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.template-thumb { width: 100%; aspect-ratio: 3/4; border-radius: 6px; margin-bottom: .5rem; overflow: hidden; border: 1px solid var(--border); }
.template-card strong { font-size: .8rem; display: block; }
.template-card span { font-size: .7rem; color: var(--text-faint); }

.color-row, .font-row { grid-column: 1/-1; display: flex; gap: .6rem; flex-wrap: wrap; }
.color-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.color-swatch.is-active { border-color: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.font-swatch { padding: .55rem 1rem; border-radius: 999px; border: 1.5px solid var(--border); font-size: .82rem; cursor: pointer; }
.font-swatch.is-active { border-color: var(--accent); color: var(--accent); font-weight: 700; }

.ad-mobile-only { display: none; }

/* =============================================================
   8. Preview column (fixed on desktop)
   ============================================================= */
.preview-col {
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
  border-left: 1px solid var(--border);
  padding: 1.6rem 1.4rem;
  min-width: 0;
}
.preview-sticky { position: sticky; top: 88px; display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.preview-frame { width: 100%; max-width: 300px; }
.a4-sheet {
  width: 100%; aspect-ratio: 210/297; background: #fff; color: #1a1a1a;
  box-shadow: var(--shadow-lg); border-radius: 4px; overflow: hidden;
  font-size: 5.6px; line-height: 1.35; position: relative;
  transform-origin: top center;
}
.preview-note { font-size: .76rem; color: var(--text-faint); text-align: center; max-width: 280px; }
.preview-actions { display: flex; flex-direction: column; gap: .5rem; width: 100%; max-width: 280px; }
.preview-actions .btn { width: 100%; }
.overflow-warning { font-size: .74rem; color: var(--danger); text-align: center; max-width: 280px; }

.mobile-preview-btn {
  display: none; position: fixed; bottom: 1.2rem; right: 1.2rem; z-index: 80;
  background: var(--accent); color: #fff; padding: .85rem 1.3rem; border-radius: 999px;
  font-weight: 700; font-size: .88rem; box-shadow: var(--shadow-lg);
}

/* =============================================================
   9. A4 sheet — plantillas (6 estructuras)
   ============================================================= */
.a4-sheet * { box-sizing: border-box; }
.a4-sheet h1,.a4-sheet h2,.a4-sheet h3 { line-height: 1.2; letter-spacing: 0; text-wrap: initial; }
.a4-sheet[data-font="moderno"] { --heading-font: 'Poppins', sans-serif; --body-font: 'Inter', sans-serif; }
.a4-sheet[data-font="clasico"] { --heading-font: 'Lora', serif; --body-font: 'Inter', sans-serif; }
.a4-sheet[data-font="solido"] { --heading-font: 'Roboto Slab', serif; --body-font: 'Inter', sans-serif; }
.a4-sheet { font-family: var(--body-font, 'Inter', sans-serif); }
.a4-sheet .cv-name { font-family: var(--heading-font, 'Poppins', sans-serif); font-weight: 700; }
.a4-sheet .cv-h2 { font-family: var(--heading-font, 'Poppins', sans-serif); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 1.05em; color: var(--accent); margin-bottom: .5em; padding-bottom: .25em; border-bottom: 1px solid currentColor; opacity: .95; }
.a4-sheet .cv-section { margin-bottom: 1.4em; padding: 0 1.6em; }
.a4-sheet .cv-item { margin-bottom: .9em; }
.a4-sheet .cv-item-head { display: flex; justify-content: space-between; gap: .5em; font-weight: 700; font-size: 1.02em; }
.a4-sheet .cv-item-sub { font-size: .95em; color: #555; font-style: italic; margin-bottom: .3em; }
.a4-sheet .cv-item-date { font-size: .88em; color: #777; white-space: nowrap; flex-shrink: 0; }
.a4-sheet .cv-item-desc { font-size: .95em; color: #333; white-space: pre-line; }
.a4-sheet .cv-tag { display: inline-block; padding: .3em .8em; margin: 0 .3em .3em 0; border-radius: 999px; font-size: .88em; background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent); }
.a4-sheet .cv-empty-hint { color: #b8b8b8; font-style: italic; }
.a4-sheet .cv-photo { border-radius: 50%; object-fit: cover; display: block; }

/* --- layout: sidebar-left (Ejecutiva) --- */
.a4-sheet[data-template="sidebar-oscura"] { display: grid; grid-template-columns: 34% 66%; }
.a4-sheet[data-template="sidebar-oscura"] .cv-sidebar { background: var(--accent); color: #fff; padding: 1.8em 1.3em; }
.a4-sheet[data-template="sidebar-oscura"] .cv-sidebar .cv-h2 { color: #fff; border-color: rgba(255,255,255,.5); }
.a4-sheet[data-template="sidebar-oscura"] .cv-photo { width: 5.5em; height: 5.5em; margin: 0 auto 1em; border: 3px solid rgba(255,255,255,.6); }
.a4-sheet[data-template="sidebar-oscura"] .cv-sidebar .cv-item-desc, .a4-sheet[data-template="sidebar-oscura"] .cv-sidebar .cv-item-sub { color: rgba(255,255,255,.85); }
.a4-sheet[data-template="sidebar-oscura"] .cv-main { padding: 1.8em 1.6em; }
.a4-sheet[data-template="sidebar-oscura"] .cv-main .cv-section { padding: 0; }
.a4-sheet[data-template="sidebar-oscura"] .cv-name { font-size: 1.9em; color: var(--accent); }
.a4-sheet[data-template="sidebar-oscura"] .cv-jobtitle { color: #666; font-size: 1.1em; margin-bottom: 1em; }
.a4-sheet[data-template="sidebar-oscura"] .cv-sidebar .cv-tag { background: rgba(255,255,255,.18); color: #fff; }

/* --- layout: classic / minimal --- */
.a4-sheet[data-template="clasica"], .a4-sheet[data-template="minimalista"] { padding: 2em 1.8em; }
.a4-sheet[data-template="clasica"] .cv-header, .a4-sheet[data-template="minimalista"] .cv-header { text-align: center; margin-bottom: 1.4em; padding-bottom: 1em; border-bottom: 2px solid var(--accent); }
.a4-sheet[data-template="clasica"] .cv-name, .a4-sheet[data-template="minimalista"] .cv-name { font-size: 2em; }
.a4-sheet[data-template="clasica"] .cv-jobtitle, .a4-sheet[data-template="minimalista"] .cv-jobtitle { color: var(--accent); font-weight: 600; margin: .3em 0; }
.a4-sheet[data-template="clasica"] .cv-contact, .a4-sheet[data-template="minimalista"] .cv-contact { font-size: .92em; color: #666; }
.a4-sheet[data-template="clasica"] .cv-section, .a4-sheet[data-template="minimalista"] .cv-section { padding: 0; }
.a4-sheet[data-template="clasica"] .cv-photo { width: 5em; height: 5em; margin: 0 auto .8em; }
.a4-sheet[data-template="minimalista"] .cv-h2 { border-bottom: none; color: #333; font-weight: 600; letter-spacing: .12em; }
.a4-sheet[data-template="minimalista"] .cv-name { font-weight: 500; }

/* --- layout: sidebar-right (Moderna) --- */
.a4-sheet[data-template="sidebar-derecha"] { display: grid; grid-template-columns: 66% 34%; }
.a4-sheet[data-template="sidebar-derecha"] .cv-main { padding: 1.8em 1.6em; order: 1; }
.a4-sheet[data-template="sidebar-derecha"] .cv-sidebar { order: 2; background: #f1f3f9; padding: 1.8em 1.3em; }
.a4-sheet[data-template="sidebar-derecha"] .cv-sidebar .cv-h2 { color: var(--accent); }
.a4-sheet[data-template="sidebar-derecha"] .cv-photo { width: 5.5em; height: 5.5em; margin: 0 auto 1em; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.a4-sheet[data-template="sidebar-derecha"] .cv-name { font-size: 1.8em; }
.a4-sheet[data-template="sidebar-derecha"] .cv-jobtitle { color: var(--accent); margin-bottom: 1em; font-weight: 600; }
.a4-sheet[data-template="sidebar-derecha"] .cv-main .cv-section { padding: 0; }

/* --- layout: timeline (barra lateral oscura fija + iconos + línea de tiempo) --- */
.a4-sheet[data-template="timeline"] { display: grid; grid-template-columns: 32% 68%; }
.a4-sheet[data-template="timeline"] .cv-sidebar { background: #1f2937; color: #fff; padding: 1.8em 1.2em; }
.a4-sheet[data-template="timeline"] .cv-sidebar .cv-h2 { color: #fff; border-color: rgba(255,255,255,.35); font-size: .92em; }
.a4-sheet[data-template="timeline"] .cv-photo {
  width: calc(100% + 2.4em); height: 11em; margin: -1.8em -1.2em 1.2em;
  border: none; border-radius: 0;
}
.a4-sheet[data-template="timeline"] .cv-sidebar .cv-item-desc { color: rgba(255,255,255,.85); }
.a4-sheet[data-template="timeline"] .cv-contact-icons div { margin-bottom: .3em; word-break: break-word; }
.a4-sheet[data-template="timeline"] .cv-bullet-list { list-style: none; padding: 0; margin: 0; }
.a4-sheet[data-template="timeline"] .cv-bullet-list li { position: relative; padding-left: 1em; margin-bottom: .35em; color: rgba(255,255,255,.85); }
.a4-sheet[data-template="timeline"] .cv-bullet-list li::before { content: "•"; position: absolute; left: 0; color: var(--accent); }
.a4-sheet[data-template="timeline"] .cv-main { padding: 1.8em 1.6em; }
.a4-sheet[data-template="timeline"] .cv-main .cv-section { padding: 0; }
.a4-sheet[data-template="timeline"] .cv-name { font-size: 1.85em; color: var(--accent); font-weight: 700; }
.a4-sheet[data-template="timeline"] .cv-jobtitle { color: #555; font-size: 1.05em; margin-bottom: 1em; }

/* Iconos de sección (badge circular) — solo aparecen cuando la plantilla lo pide */
.cv-h2-icon { display: flex; align-items: center; gap: .5em; border-bottom: none !important; }
.cv-h2-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--accent);
  color: #fff; flex-shrink: 0; padding: .35em; box-sizing: border-box;
}
.cv-h2-badge svg { width: 100%; height: 100%; }

/* Línea de tiempo: puntos conectados por una línea vertical entre elementos */
.has-timeline .cv-item { position: relative; padding-left: 1.3em; }
.has-timeline .cv-item::before {
  content: ""; position: absolute; left: 0; top: .35em; width: .5em; height: .5em;
  border-radius: 50%; background: var(--accent);
}
.has-timeline .cv-item::after {
  content: ""; position: absolute; left: .2em; top: 1em; bottom: -1.1em; width: 1px;
  background: var(--border);
}
.has-timeline .cv-item:last-child::after { display: none; }

/* Barra de nivel de idioma (sidebar oscura de la plantilla "timeline") */
.cv-lang-bar-row { margin-bottom: .6em; }
.cv-lang-bar-label { display: flex; justify-content: space-between; font-size: .95em; margin-bottom: .25em; color: rgba(255,255,255,.9); }
.cv-lang-bar-track { height: .35em; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; }
.cv-lang-bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }

/* --- layout: banner --- */
.a4-sheet[data-template="banner"] .cv-header { background: var(--accent); color: #fff; padding: 2em 1.8em 1.6em; }
.a4-sheet[data-template="banner"] .cv-name { font-size: 2em; }
.a4-sheet[data-template="banner"] .cv-jobtitle { color: rgba(255,255,255,.9); margin-top: .3em; }
.a4-sheet[data-template="banner"] .cv-contact { color: rgba(255,255,255,.85); font-size: .9em; margin-top: .6em; }
.a4-sheet[data-template="banner"] .cv-photo { width: 4.5em; height: 4.5em; border: 3px solid rgba(255,255,255,.7); float: right; }
.a4-sheet[data-template="banner"] .cv-body { display: grid; grid-template-columns: 62% 38%; padding: 1.6em 0; }
.a4-sheet[data-template="banner"] .cv-body .cv-section { padding: 0 1.6em; }

/* --- layout: compact --- */
.a4-sheet[data-template="compacta"] { padding: 1.3em 1.5em; font-size: 5.1px; }
.a4-sheet[data-template="compacta"] .cv-header { display: flex; align-items: center; gap: 1em; margin-bottom: .9em; padding-bottom: .7em; border-bottom: 2px solid var(--accent); }
.a4-sheet[data-template="compacta"] .cv-photo { width: 4em; height: 4em; flex-shrink: 0; }
.a4-sheet[data-template="compacta"] .cv-name { font-size: 1.6em; }
.a4-sheet[data-template="compacta"] .cv-jobtitle { color: var(--accent); font-weight: 600; }
.a4-sheet[data-template="compacta"] .cv-contact { font-size: .85em; color: #666; }
.a4-sheet[data-template="compacta"] .cv-section { padding: 0; margin-bottom: .8em; }
.a4-sheet[data-template="compacta"] .cv-item { margin-bottom: .5em; }
.a4-sheet[data-template="compacta"] .cv-h2 { font-size: .95em; margin-bottom: .35em; }

/* =============================================================
   10. Ads
   ============================================================= */
.ad-slot {
  min-height: 90px; border: 1.5px dashed var(--border); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; color: var(--text-faint);
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; margin: 1.4rem auto;
}
/* Anuncios reales (AdSense exige style="display:block" en línea en el <ins>,
   así que el tamaño/márgenes se reservan aquí en vez de heredarlos de .ad-slot). */
ins.adsbygoogle { min-height: 90px; margin: 1.4rem auto; }
.ad-leaderboard { max-width: 728px; }
.ad-incontent { max-width: 1280px; margin-inline: auto; }

.adblock-wall {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 11, 18, .94);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.adblock-wall[hidden] { display: none; }
.adblock-wall-inner {
  max-width: 480px; width: 100%; text-align: center;
  background: var(--surface); border-radius: var(--radius);
  padding: clamp(2rem, 6vw, 3.2rem) clamp(1.6rem, 5vw, 2.6rem);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.adblock-icon { width: 64px; height: 64px; color: var(--danger); flex-shrink: 0; }
.adblock-wall-inner h2 { font-size: 1.4rem; }
.adblock-wall-inner p { color: var(--text-dim); font-size: .95rem; }
.adblock-wall-inner .btn-large { width: 100%; padding: 1.05rem 1.4rem; font-size: 1rem; margin-top: .4rem; }
.adblock-hint { font-size: .78rem !important; color: var(--text-faint) !important; }
html.adblock-locked, html.adblock-locked body { overflow: hidden; }

/* =============================================================
   11. Sections shared (cómo funciona, para quién, faq)
   ============================================================= */
section { padding: 3rem 0; }
.section-head { max-width: 60ch; margin: 0 auto 2rem; text-align: center; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: .5rem 0; }
.section-head p { color: var(--text-dim); }

.steps-grid, .usecase-grid { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); }
.step-card { padding: 1.6rem; }
.step-num { width: 34px; height: 34px; border-radius: 999px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; margin-bottom: .9rem; }
.step-card h3 { margin-bottom: .5rem; font-size: 1.05rem; }
.step-card p { color: var(--text-dim); font-size: .9rem; }

.usecase-card { padding: 1.4rem; display: flex; gap: .9rem; align-items: flex-start; }
.usecase-card svg { width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; margin-top: .2rem; }
.usecase-card h3 { font-size: 1rem; margin-bottom: .3rem; }
.usecase-card p { color: var(--text-dim); font-size: .87rem; }

.faq-list { display: flex; flex-direction: column; gap: .7rem; max-width: 74ch; margin: 0 auto; }
.faq-item { padding: 1rem 1.2rem; }
.faq-item summary { font-weight: 700; cursor: pointer; font-size: .95rem; }
.faq-item p { color: var(--text-dim); margin-top: .6rem; font-size: .88rem; }

/* =============================================================
   12. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =============================================================
   13. Responsive
   ============================================================= */
@media (min-width: 720px) {
  .step-body { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .wizard-shell { grid-template-columns: 84px minmax(0,1fr) 340px; grid-template-rows: 1fr; }
  .wizard-rail { grid-column: 1; }
  .wizard-form-col { grid-column: 2; overflow-y: auto; max-height: 82vh; }
  .preview-col { grid-column: 3; }
  .ad-mobile-only { display: none !important; }
}

@media (max-width: 959px) {
  .wizard-shell { grid-template-columns: 68px minmax(0,1fr); }
  .rail-step {
    flex-direction: column; justify-content: center; text-align: center;
    gap: .15rem; padding: .35rem .1rem;
  }
  .rail-step-label {
    display: block; font-size: .52rem; white-space: normal; text-align: center;
    overflow: visible; text-overflow: clip; line-height: 1.05;
  }
  .preview-col { display: none; }
  .preview-col.is-open {
    display: block; position: fixed; inset: 0; z-index: 70; background: var(--bg);
    overflow-y: auto; padding: 1.2rem; border: 0;
  }
  .preview-col.is-open .preview-sticky { position: static; }
  .mobile-preview-btn { display: inline-flex; }
  .ad-mobile-only { display: flex !important; }
  .rep-grid { grid-template-columns: 1fr; }
  .extras-checklist { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 539px) {
  .step-body { grid-template-columns: 1fr; }
  .wizard-shell { min-height: 560px; }
  .skill-row input, .lang-row input { flex-basis: 100%; }
  .skill-row select, .lang-row select { flex: 1; width: auto; }
}
