/* ============================================================
   style.css — Sistema de diseño "Mac moderno" RESPONSIVE
   ============================================================ */

:root {
  --paper: #ffffff;
  --paper-dim: #f5f5f7;
  --ink: #1d1d1f;
  --ink-soft: #3a3a3c;
  --brass: #b08d57;
  --brass-dark: #8f7040;
  --slate: #6e6e73;
  --line: #e3e3e6;
  --line-soft: #ececee;
  --success: #1e8e5a;
  --danger: #d33a2c;
  --white: #ffffff;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-page: 0 1px 3px rgba(0,0,0,0.06), 0 24px 48px rgba(0,0,0,0.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper-dim);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--brass-dark); }
button { font-family: var(--font-body); cursor: pointer; touch-action: manipulation; }

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 0;
  z-index: 30;
}
.app-header .brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.app-header .brand .mark {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.app-header .brand .tagline { font-size: 11px; color: var(--slate); font-family: var(--font-body); font-weight: 400; display: none; }

@media (min-width: 640px) {
  .app-header { padding: 14px 24px; }
  .app-header .brand .mark { font-size: 20px; }
}
@media (min-width: 860px) {
  .app-header { padding: 16px 32px; }
  .app-header .brand .mark { font-size: 21px; }
  .app-header .brand .tagline { display: inline; }
}

/* ---------- Language switcher ---------- */
.lang-switcher {
  display: flex;
  gap: 2px;
  background: var(--paper-dim);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.lang-switcher button {
  border: none;
  background: transparent;
  color: var(--ink);
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.45;
  filter: grayscale(70%);
  transition: opacity 0.15s ease, filter 0.15s ease, transform 0.15s ease, background 0.15s ease;
  min-width: 36px;
  min-height: 36px;
}
.lang-switcher button:hover { opacity: 0.8; }
.lang-switcher button.active {
  background: var(--white);
  box-shadow: var(--shadow-card);
  opacity: 1;
  filter: none;
  transform: scale(1.05);
}

/* ---------- Layout principal ---------- */
.app-body { display: flex; flex-direction: column; }
@media (min-width: 980px) {
  .app-body {
    display: grid;
    grid-template-columns: minmax(340px, 420px) 1fr;
    min-height: calc(100vh - 62px);
  }
}
@media (min-width: 1200px) {
  .app-body { grid-template-columns: minmax(380px, 460px) 1fr; }
}

/* ---------- Steps rail ---------- */
.steps-rail {
  display: flex;
  overflow-x: auto;
  gap: 2px;
  padding: 10px 12px 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.steps-rail::-webkit-scrollbar { display: none; }
.steps-rail button {
  border: none;
  background: transparent;
  padding: 10px 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--slate);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 40px;
}
.steps-rail button.active {
  color: var(--ink);
  border-bottom-color: var(--brass);
  font-weight: 600;
}
@media (min-width: 640px) {
  .steps-rail { padding: 12px 20px 0; gap: 4px; }
  .steps-rail button { padding: 10px 12px; font-size: 12px; }
}

/* ---------- Form panel ---------- */
.form-panel {
  background: var(--paper);
  padding: 20px 16px 80px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.form-panel h2 { font-family: var(--font-display); font-size: 22px; margin: 0 0 4px; }
@media (min-width: 640px) {
  .form-panel { padding: 24px 24px 90px; }
  .form-panel h2 { font-size: 24px; }
}
@media (min-width: 980px) {
  .form-panel { padding: 28px 32px 100px; }
  .form-panel h2 { font-size: 26px; }
}

.one-page-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 14px;
}
@media (min-width: 640px) {
  .one-page-badge { font-size: 13px; padding: 10px 14px; margin-bottom: 18px; }
}
.one-page-badge.ok { background: #e4f1e8; color: var(--success); }
.one-page-badge.warn { background: #fbf0df; color: var(--brass-dark); }

.form-panel .step-hint { color: var(--slate); font-size: 12px; margin-bottom: 16px; }
@media (min-width: 640px) { .form-panel .step-hint { font-size: 13px; margin-bottom: 22px; } }

.field { margin-bottom: 14px; }
@media (min-width: 640px) { .field { margin-bottom: 16px; } }

.field label {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--slate);
  margin-bottom: 5px;
}
@media (min-width: 640px) { .field label { font-size: 12px; margin-bottom: 6px; } }

/* ---------- Info icon ---------- */
.info-icon { position: relative; display: inline-block; vertical-align: middle; }
.info-icon-btn {
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 1px solid var(--brass);
  background: transparent;
  color: var(--brass-dark);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  min-width: 15px; min-height: 15px;
}
.info-icon-btn:hover { background: var(--brass); color: var(--white); }
.tooltip-box {
  display: none;
  position: absolute;
  z-index: 20;
  bottom: 22px;
  left: 0;
  width: 220px;
  max-width: calc(100vw - 32px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}
.tooltip-box.show { display: block; }
.tooltip-box::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 10px;
  border: 6px solid transparent;
  border-top-color: var(--ink);
}

/* ---------- Inputs ---------- */
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="month"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  min-height: 44px;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brass);
  box-shadow: 0 0 0 4px rgba(176, 141, 87, 0.16);
}

.field-row { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; gap: 12px; } }

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--slate);
  min-height: 44px;
}
.check-row input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: var(--brass);
  flex-shrink: 0;
}

/* ---------- Repeat cards ---------- */
.repeat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
  background: #fafafa;
  position: relative;
}
@media (min-width: 640px) { .repeat-card { padding: 16px; margin-bottom: 14px; } }
.repeat-card .remove-btn {
  position: absolute;
  top: 8px; right: 8px;
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  font-family: var(--font-mono);
  min-width: 32px; min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.repeat-card .remove-btn:hover { background: rgba(211, 58, 44, 0.08); }

/* ---------- Tips box ---------- */
.tips-box {
  background: #f5f5f7;
  border-left: 3px solid var(--brass);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 14px;
}
@media (min-width: 640px) { .tips-box { padding: 12px 14px; margin-bottom: 18px; } }
.tips-title { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
@media (min-width: 640px) { .tips-title { font-size: 13px; } }
.tips-box ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}
@media (min-width: 640px) { .tips-box ul { font-size: 12.5px; } }

/* ---------- Bullet list ---------- */
.bullet-list { margin-bottom: 8px; }
.bullet-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.bullet-dot { color: var(--brass); font-weight: 700; flex-shrink: 0; font-size: 14px; }
.bullet-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-body);
  min-height: 40px;
}
.bullet-remove {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
  flex-shrink: 0;
  padding: 6px;
  min-width: 32px; min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}
.bullet-remove:hover { background: rgba(211, 58, 44, 0.08); }

/* ---------- Reference box ---------- */
.reference-box { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
@media (min-width: 640px) { .reference-box { margin-top: 14px; padding-top: 12px; } }
.reference-title {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--slate);
  margin-bottom: 8px;
}
@media (min-width: 640px) { .reference-title { font-size: 12px; } }

/* ---------- Buttons ---------- */
.btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 640px) { .btn { padding: 11px 20px; font-size: 14px; } }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: var(--white); }
.btn-primary:hover { background: var(--ink-soft); }
.btn-secondary { background: var(--paper-dim); color: var(--ink); border: 1px solid var(--line-soft); }
.btn-secondary:hover { background: var(--line-soft); }
.btn-gold {
  background: var(--brass);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(176, 141, 87, 0.35);
}
.btn-gold:hover { background: var(--brass-dark); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-add {
  border: 1px dashed var(--brass);
  background: transparent;
  color: var(--brass-dark);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  width: 100%;
  min-height: 44px;
}
.btn-add:hover { background: rgba(176, 141, 87, 0.06); }

/* ---------- Step actions ---------- */
.step-actions { display: flex; justify-content: space-between; margin-top: 20px; gap: 10px; }
@media (min-width: 640px) { .step-actions { margin-top: 24px; } }
.step-actions .btn { flex: 1; }
@media (min-width: 640px) { .step-actions .btn { flex: 0 0 auto; } }

/* ---------- Photo upload ---------- */
.photo-upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (min-width: 640px) { .photo-upload { gap: 14px; } }
.photo-upload .thumb {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--paper-dim);
  border: 1px solid var(--line);
  object-fit: cover;
  flex-shrink: 0;
}
@media (min-width: 640px) { .photo-upload .thumb { width: 64px; height: 64px; } }
.photo-upload input[type="file"] { font-size: 13px; min-height: 44px; }

/* ---------- Templates grid ---------- */
.template-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 480px) { .template-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; } }
@media (min-width: 640px) { .template-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; } }

.template-card {
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--white);
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.template-card:hover { transform: translateY(-2px); }
.template-card.active { border-color: var(--brass); }
.template-card .swatch {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 11px;
}
@media (min-width: 640px) { .template-card .swatch { height: 90px; font-size: 12px; } }
.template-card .name { padding: 6px 8px; font-size: 11px; font-weight: 600; }
@media (min-width: 640px) { .template-card .name { padding: 8px 10px; font-size: 12px; } }
.template-card .ats-tag {
  padding: 0 8px 8px;
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--slate);
}
@media (min-width: 640px) { .template-card .ats-tag { padding: 0 10px 10px; font-size: 10px; } }
.template-category {
  font-size: 9px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--brass-dark);
  letter-spacing: 0.04em;
  padding: 0 8px 6px;
}
@media (min-width: 640px) { .template-category { font-size: 10px; padding: 0 10px 6px; } }

/* ---------- Preview panel ---------- */
.preview-panel {
  background: var(--paper-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 12px 40px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) {
  .preview-panel {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 14px;
    padding: 24px 16px 50px;
  }
}
@media (min-width: 980px) { .preview-panel { gap: 18px; padding: 32px 24px 60px; } }

/* ---------- Ruler ---------- */
.ruler {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 34px;
  padding-top: 4px;
  position: sticky;
  top: 16px;
}
@media (min-width: 980px) { .ruler { display: flex; top: 24px; } }
@media (min-width: 1200px) { .ruler { top: 32px; } }
.ruler .fill-track {
  width: 6px;
  height: 300px;
  background: var(--line);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
@media (min-width: 1200px) { .ruler .fill-track { height: 400px; } }
.ruler .fill-bar { position: absolute; bottom: 0; width: 100%; background: var(--brass); transition: height 0.3s ease; }
.ruler .fill-label {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--slate);
  text-align: center;
  writing-mode: vertical-rl;
}

/* ---------- Page (hoja A4) ---------- */
.page-wrap { position: relative; width: 100%; max-width: 210mm; }
.page {
  width: 100%;
  min-height: 297mm;
  background: var(--white);
  box-shadow: var(--shadow-page);
  padding: 12mm 10mm;
  position: relative;
  margin: 0 auto;
}
@media (min-width: 480px) { .page { padding: 14mm 12mm; } }
@media (min-width: 640px) { .page { padding: 16mm 14mm; } }
@media (min-width: 980px) { .page { width: 210mm; padding: 16mm 14mm; } }

@media (max-width: 479px) {
  .page { transform-origin: top center; transform: scale(0.85); margin-bottom: -60mm; }
}
@media (min-width: 480px) and (max-width: 639px) {
  .page { transform-origin: top center; transform: scale(0.92); margin-bottom: -30mm; }
}

/* ---------- Watermark & protection ---------- */
#cv-page-content.is-protected {
  user-select: none;
  -webkit-user-select: none;
  filter: blur(3.5px);
  transition: filter 0.25s ease;
}
.unlocked-banner {
  background: #e4f1e8;
  color: var(--success);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;
  width: 100%;
  max-width: 210mm;
}
@media (min-width: 640px) { .unlocked-banner { padding: 10px 14px; font-size: 13px; margin-bottom: 12px; } }

.watermark-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.watermark-row {
  position: absolute;
  left: -20%;
  width: 140%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%) rotate(-32deg);
}
.watermark-row span {
  font-family: var(--font-mono);
  font-size: 18px;
  color: rgba(27, 42, 74, 0.075);
  white-space: nowrap;
  letter-spacing: 0.08em;
}
@media (min-width: 640px) { .watermark-row span { font-size: 22px; } }
@media (min-width: 980px) { .watermark-row span { font-size: 26px; } }

/* ---------- ATS meter ---------- */
.ats-meter-box {
  display: none;
  position: sticky;
  top: 16px;
  width: 130px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  font-size: 11px;
  flex-shrink: 0;
}
@media (min-width: 1240px) { .ats-meter-box { display: block; top: 32px; width: 150px; padding: 12px; } }
.ats-meter-box .label {
  font-family: var(--font-mono);
  text-transform: uppercase;
  color: var(--slate);
  font-size: 10px;
  margin-bottom: 6px;
}
.ats-dial { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.ats-dial .fill { height: 100%; background: var(--success); }
.ats-dial .fill.medium { background: var(--brass); }

/* ---------- Color picker ---------- */
.color-picker-box { margin-bottom: 18px; }
@media (min-width: 640px) { .color-picker-box { margin-bottom: 22px; } }
.color-picker-box .label {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--slate);
  margin-bottom: 8px;
}
@media (min-width: 640px) { .color-picker-box .label { font-size: 12px; } }
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 640px) { .color-swatches { gap: 10px; } }
.color-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}
@media (min-width: 640px) { .color-swatch { width: 28px; height: 28px; } }
.color-swatch.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--ink);
}
.custom-color-swatch { display: flex; align-items: center; justify-content: center; overflow: hidden; }
.custom-color-swatch input[type="color"] { opacity: 0; width: 100%; height: 100%; cursor: pointer; border: none; padding: 0; }

/* ---------- Segmented control ---------- */
.segmented { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.segmented-btn {
  flex: 1;
  border: none;
  background: var(--white);
  padding: 8px 6px;
  font-size: 11px;
  color: var(--slate);
  border-right: 1px solid var(--line);
  min-height: 40px;
}
@media (min-width: 640px) { .segmented-btn { padding: 8px; font-size: 12px; } }
.segmented-btn:last-child { border-right: none; }
.segmented-btn.active { background: var(--brass); color: var(--ink); font-weight: 600; }

/* ---------- Phrase suggestions ---------- */
.phrase-toggle {
  border: none;
  background: transparent;
  color: var(--brass-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 0;
  margin: -4px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
}
.phrase-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
  padding: 10px;
  margin-bottom: 14px;
}
@media (min-width: 640px) { .phrase-panel { padding: 12px; } }
.phrase-panel select {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
  min-height: 40px;
}
.phrase-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 6px;
  cursor: pointer;
  line-height: 1.4;
  min-height: 40px;
}
.phrase-item:hover { border-color: var(--brass); background: #f5efe3; }

/* ---------- Format selector ---------- */
.format-group { display: flex; gap: 6px; margin-bottom: 12px; }
@media (min-width: 640px) { .format-group { gap: 8px; margin-bottom: 14px; } }
.format-chip {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius);
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.format-chip.active { border-color: var(--brass); background: #f5efe3; color: var(--brass-dark); }

/* ---------- Payment modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 12px;
}
@media (min-width: 640px) { .modal-backdrop { padding: 20px; } }
.modal {
  background: var(--paper);
  border-radius: 18px;
  max-width: 100%;
  width: 100%;
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
@media (min-width: 480px) { .modal { max-width: 420px; padding: 24px; } }
@media (min-width: 640px) { .modal { padding: 28px; } }
.modal h3 { font-family: var(--font-display); font-size: 20px; margin: 0 0 8px; }
@media (min-width: 640px) { .modal h3 { font-size: 22px; } }
.modal .price-badge {
  font-family: var(--font-mono);
  font-size: 24px;
  color: var(--brass-dark);
  margin: 8px 0;
}
@media (min-width: 640px) { .modal .price-badge { font-size: 28px; margin: 10px 0; } }
.price-local-note { font-size: 12px; color: var(--slate); min-height: 16px; margin-bottom: 4px; }
.modal .secure-note {
  font-size: 12px;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}
.modal .close-x {
  position: absolute;
  top: 10px; right: 14px;
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--slate);
  min-width: 36px; min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.modal .close-x:hover { background: var(--paper-dim); }
#paypal-button-container { margin-top: 14px; min-height: 45px; }
@media (min-width: 640px) { #paypal-button-container { margin-top: 16px; } }

.pay-method-tabs { display: flex; gap: 6px; margin-top: 12px; }
@media (min-width: 640px) { .pay-method-tabs { gap: 8px; margin-top: 14px; } }
.pay-method-tab {
  flex: 1;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
  text-align: center;
  min-height: 44px;
}
@media (min-width: 640px) { .pay-method-tab { padding: 10px 8px; font-size: 12.5px; } }
.pay-method-tab.active { border-color: var(--brass); background: #f5efe3; color: var(--brass-dark); }

.promo-toggle {
  display: block;
  margin: 14px auto 0;
  border: none;
  background: transparent;
  color: var(--slate);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
  min-height: 36px;
}
.promo-box { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.promo-box input {
  flex: 1;
  min-width: 120px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 13px;
  min-height: 44px;
}
#promo-status .status-banner { margin-top: 10px; }
.status-banner {
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 14px;
}
.status-banner.success { background: #e4f1e8; color: var(--success); }
.status-banner.error { background: #fbe9e7; color: var(--danger); }

/* ---------- Footer ---------- */
.app-footer {
  text-align: center;
  font-size: 11px;
  color: var(--slate);
  padding: 14px;
  font-family: var(--font-mono);
}
@media (min-width: 640px) { .app-footer { padding: 18px; } }

/* ---------- Print ---------- */
@media print {
  .app-header, .steps-rail, .form-panel, .ruler, .ats-meter-box, .app-footer, .unlocked-banner { display: none !important; }
  .page { box-shadow: none; transform: none !important; margin-bottom: 0 !important; }
  .preview-panel { padding: 0; background: white; }
  .page-wrap { max-width: none; width: 210mm; }
}

/* ---------- Touch improvements ---------- */
@media (hover: none) {
  .btn:hover, .btn-add:hover, .lang-switcher button:hover, .info-icon-btn:hover,
  .phrase-item:hover, .template-card:hover, .segmented-btn:hover, .format-chip:hover,
  .pay-method-tab:hover, .bullet-remove:hover, .repeat-card .remove-btn:hover,
  .modal .close-x:hover { transform: none; background: inherit; }
  .btn:active { transform: scale(0.97); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

#crop-upload-zone:hover { border-color: var(--brass) !important; background: #f5efe3 !important; }

/* ============================================================
   TIPOGRAFÍA ATS UNIFORME PARA EL CV
   ============================================================ */
#cv-page-content, #cv-page-content * {
  font-family: 'Calibri', 'Arial', 'Helvetica Neue', Helvetica, sans-serif !important;
}
#cv-page-content h1, #cv-page-content .cv-name {
  font-size: 18pt !important; font-weight: 700 !important; line-height: 1.2 !important;
  margin-bottom: 4px !important; letter-spacing: 0.3px !important;
}
#cv-page-content h2, #cv-page-content .cv-title, #cv-page-content .cv-contact {
  font-size: 11pt !important; font-weight: 400 !important; line-height: 1.4 !important;
  margin-bottom: 2px !important;
}
#cv-page-content h3, #cv-page-content .cv-section-title {
  font-size: 11pt !important; font-weight: 700 !important; text-transform: uppercase !important;
  letter-spacing: 0.5px !important; border-bottom: 1px solid #b08d57 !important;
  padding-bottom: 2px !important; margin-top: 14px !important; margin-bottom: 6px !important;
  line-height: 1.3 !important;
}
#cv-page-content p, #cv-page-content li, #cv-page-content .cv-body, #cv-page-content .cv-bullet {
  font-size: 11pt !important; font-weight: 400 !important; line-height: 1.5 !important;
  margin-bottom: 3px !important;
}
#cv-page-content strong, #cv-page-content b, #cv-page-content .cv-bold {
  font-size: 11pt !important; font-weight: 700 !important;
}
#cv-page-content .cv-date, #cv-page-content .cv-meta {
  font-size: 10.5pt !important; font-weight: 400 !important; color: #3a3a3c !important;
}
#cv-page-content ul { padding-left: 18px !important; margin: 4px 0 !important; }
#cv-page-content li { margin-bottom: 2px !important; }
#cv-page-content i, #cv-page-content em { font-style: normal !important; font-size: 11pt !important; }

/* ============================================================
   AI CV ANALYZER — Estilos completos
   ============================================================ */

.ai-trigger-box {
  background: linear-gradient(135deg, #faf7f0 0%, #f5efe3 100%);
  border: 1px dashed var(--brass);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 20px;
  text-align: center;
}
.ai-trigger-text { margin: 0 0 12px; font-size: 14px; color: var(--ink-soft); }

.btn-ai {
  background: var(--brass);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.btn-ai:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(176,141,87,0.25);
}
.btn-ai:disabled { opacity: .7; cursor: wait; }

.ai-analysis-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  animation: aiSlideIn .4s ease;
}
@keyframes aiSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.ai-score-ring {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 3px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
}
.ai-score-num { font-size: 24px; font-weight: 700; line-height: 1; }
.ai-score-label { font-size: 11px; opacity: .7; }
.ai-header-text h3 { margin: 0 0 4px; font-size: 17px; }
.ai-header-text p { margin: 0; font-size: 13px; color: var(--slate); }
.ai-ats-bar {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.ai-ats-track {
  flex: 1; height: 6px;
  background: #e9ecef;
  border-radius: 3px;
  overflow: hidden;
  max-width: 140px;
}
.ai-ats-fill { height: 100%; border-radius: 3px; transition: width .6s ease; }

.btn-ai-refresh {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: transform .2s, background .2s;
}
.btn-ai-refresh:hover { background: #f5efe3; transform: rotate(180deg); }

.spinner { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.ai-section { margin-bottom: 22px; }
.ai-section h4 {
  margin: 0 0 12px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--ink);
  font-weight: 700;
}

.ai-compare {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
}
.ai-before small, .ai-after small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 4px;
  font-weight: 600;
}
.ai-before p { margin: 0; color: var(--slate); font-style: italic; text-decoration: line-through; opacity: .75; font-size: 13px; }
.ai-arrow { text-align: center; color: var(--brass); font-size: 20px; margin: 6px 0; }
.ai-after p { margin: 0; color: var(--ink); font-weight: 500; background: #e8f5e9; padding: 10px; border-radius: 6px; font-size: 13px; line-height: 1.5; }

.ai-tips { margin: 10px 0 0 18px; padding: 0; font-size: 12px; color: var(--ink-soft); }
.ai-tips li { margin-bottom: 6px; }

.ai-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.ai-card strong { font-size: 13px; color: var(--ink); }
.ai-issue {
  font-size: 12px;
  color: #c62828;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ai-rewritten { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ai-rewritten small { display: block; font-size: 11px; color: var(--brass); font-weight: 600; margin-bottom: 6px; }
.ai-rewritten ul { margin: 0; padding-left: 16px; }
.ai-rewritten li { font-size: 12px; color: var(--ink); margin-bottom: 4px; }

.ai-missing { margin-bottom: 10px; }
.ai-skill-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ai-chip {
  background: var(--brass);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.ai-redflags { background: #fff5f5 !important; border-radius: 10px; padding: 14px !important; }
.ai-redflag {
  font-size: 12px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff;
}
.ai-severity-high { border-left: 3px solid #c62828; color: #c62828; }
.ai-severity-medium { border-left: 3px solid #ed6c02; color: #c05621; }
.ai-severity-low { border-left: 3px solid #b08d57; color: #975a16; }

.btn-sm { padding: 6px 14px; font-size: 12px; margin-top: 8px; }