/* ============ GENERADOR DE CV (/crea-tu-cv) ============ */
.cv-hero { padding-bottom: 44px; }
.cv-section { background: var(--paper-alt); border-bottom: 1px solid var(--line); padding: 40px 0 72px; }
.cv-app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 1000px) { .cv-app { grid-template-columns: 1fr; } }

/* ---- Formulario ---- */
.cv-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cv-block { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 20px 22px 22px; min-width: 0; }
.cv-block legend { font-family: 'Outfit', sans-serif; font-size: 17px; font-weight: 700; padding: 0 6px; margin-left: -6px; display: flex; align-items: center; gap: 10px; }
.cv-step { width: 26px; height: 26px; border-radius: 50%; background: var(--blue-600); color: white; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.cv-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 12px 0 5px; }
.cv-opt { font-weight: 400; color: var(--ink-faint); }
.cv-mt { margin-top: 18px; }
.cv-input {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--paper); border: 1px solid #d4dbe6; border-radius: 9px; padding: 10px 12px;
}
.cv-input:focus { outline: 3px solid var(--blue-100); border-color: var(--blue-400); }
textarea.cv-input { resize: vertical; line-height: 1.5; }
.cv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cv-row-3 { grid-template-columns: 1.2fr 1fr 1fr; }
@media (max-width: 560px) { .cv-row, .cv-row-3 { grid-template-columns: 1fr; } }
.cv-hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 8px; }
.cv-hint a { color: var(--blue-600); font-weight: 600; }
.cv-hint-top { margin: 4px 0 2px; }
.cv-link-btn { font: inherit; font-size: 13px; font-weight: 600; color: var(--blue-600); background: none; border: 0; padding: 6px 0; cursor: pointer; }
.cv-link-btn:hover { text-decoration: underline; }
.cv-photo { display: flex; gap: 16px; align-items: flex-start; margin-top: 6px; }
.cv-photo-thumb { width: 72px; height: 90px; border-radius: 8px; flex-shrink: 0; margin-top: 12px; background: var(--blue-50) center/cover no-repeat; border: 1px dashed #b9c5d8; }
.cv-photo-thumb.has-photo { border: 0; }
.cv-photo > div:not(.cv-photo-thumb) { min-width: 0; flex: 1; }
.cv-file { font: inherit; font-size: 13px; width: 100%; max-width: 100%; }
.cv-checks { display: flex; flex-direction: column; gap: 8px; }
.cv-check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.cv-check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--blue-600); flex-shrink: 0; }
.cv-list { display: flex; flex-direction: column; gap: 12px; }
.cv-item { border: 1px solid var(--line); border-radius: 10px; padding: 4px 14px 8px; background: var(--paper-alt); }
.cv-remove { color: #b91c1c; }
.cv-idea { margin-top: 2px; }
.cv-add { font: inherit; font-size: 14px; font-weight: 700; color: var(--blue-600); background: var(--blue-50); border: 1px dashed var(--blue-400); border-radius: 9px; padding: 10px; width: 100%; margin-top: 12px; cursor: pointer; }
.cv-add:hover { background: var(--blue-100); }
.cv-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cv-btn { font: inherit; font-size: 14.5px; font-weight: 700; border-radius: 10px; padding: 12px 18px; cursor: pointer; border: 1px solid var(--blue-600); color: var(--blue-600); background: var(--paper); }
.cv-btn:disabled { opacity: .6; cursor: wait; }
.cv-btn-primary { background: var(--blue-600); color: white; }
.cv-btn-primary:hover { background: #1d4ed8; }
.cv-btn-ghost { border-color: var(--line); color: var(--ink-soft); }
.cv-status { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.cv-privacy { font-size: 12.5px; color: var(--ink-faint); }

/* ---- Vista previa ---- */
.cv-preview { position: sticky; top: 16px; min-width: 0; }
.cv-preview-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.cv-preview-close { display: none; }
.cv-preview-actions { display: none; }
.cv-fab { display: none; }
@media (max-width: 1000px) {
  /* En móvil la vista previa se abre a pantalla completa con el botón flotante */
  .cv-preview { display: none; position: fixed; inset: 0; z-index: 200; overflow-y: auto; background: #e9edf3; padding: 0 14px 24px; }
  body.cv-preview-open { overflow: hidden; }
  body.cv-preview-open .cv-preview { display: block; }
  body.cv-preview-open .cv-fab { display: none; }
  .cv-preview-head { position: sticky; top: 0; z-index: 2; background: #e9edf3; margin: 0 -14px 12px; padding: 12px 14px; border-bottom: 1px solid #d4dbe6; }
  .cv-preview-close { display: inline-flex; font: inherit; font-size: 14px; font-weight: 700; text-transform: none; letter-spacing: 0; color: white; background: var(--blue-600); border: 0; border-radius: 9px; padding: 9px 14px; cursor: pointer; }
  .cv-preview-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
  .cv-preview-actions .cv-btn { flex: 1 1 auto; }
  .cv-fab {
    display: inline-flex; align-items: center; gap: 8px;
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 90;
    font: inherit; font-size: 15px; font-weight: 700; color: white; background: var(--ink);
    border: 0; border-radius: 999px; padding: 14px 22px; cursor: pointer; white-space: nowrap;
    box-shadow: 0 12px 28px -10px rgba(20, 24, 31, .6);
  }
  .cv-fab svg { width: 18px; height: 18px; }
  .cv-section { padding-bottom: 96px; } /* que el botón flotante no tape los botones de descarga */
}
.cv-preview-frame { position: relative; overflow: hidden; border-radius: 6px; box-shadow: 0 18px 40px -22px rgba(20, 24, 31, .45); background: white; }

/* ---- Hoja del CV (A4 a 96 ppp: 794 × 1123 px) ---- */
.cv-sheet {
  width: 794px; min-height: 1123px; transform-origin: top left;
  background: white; color: #14181f; padding: 56px 60px;
  font-family: 'Plus Jakarta Sans', Arial, sans-serif; font-size: 13.5px; line-height: 1.5;
}
.cvs-head { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding-bottom: 18px; border-bottom: 3px solid #1e3a5f; margin-bottom: 6px; }
.cvs-name { font-family: 'Outfit', Arial, sans-serif; font-size: 30px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.cvs-role { font-size: 15px; font-weight: 700; color: #2563eb; margin: 4px 0 8px; }
.cvs-contact { font-size: 12.5px; color: #4b5160; }
.cvs-dot { margin: 0 7px; color: #a0a8b8; }
.cvs-photo { width: 92px; height: 115px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.cvs-ph { color: #a0a8b8; }
.cv-sheet .cvs-sec { margin-top: 18px; padding: 0; }
.cvs-sec h2 { font-family: 'Outfit', Arial, sans-serif; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #1e3a5f; border-bottom: 1px solid #c9d3e3; padding-bottom: 4px; margin-bottom: 8px; }
.cvs-sec p { margin-bottom: 4px; }
.cvs-entry { margin-bottom: 10px; break-inside: avoid; }
.cvs-entry-top { display: flex; flex-wrap: wrap; gap: 0 4px; align-items: baseline; }
.cvs-entry-top span { color: #4b5160; }
.cvs-entry-top em { margin-left: auto; font-size: 12.5px; color: #4b5160; }
.cvs-entry ul { margin: 4px 0 0 18px; }
.cvs-entry li { margin-bottom: 2px; }

/* ---- Impresión: solo la hoja del CV ---- */
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: white !important; margin: 0; padding: 0; }
  body > *:not(main), main > section:not(.cv-section), .cv-form, .cv-preview-head, .cv-preview-actions, .cv-fab, #cookie-banner { display: none !important; }
  .cv-preview { display: block !important; padding: 0 !important; background: white !important; }
  .cv-section { padding: 0; border: 0; background: white; }
  .cv-section > .wrap { padding: 0; max-width: none; display: block; }
  .cv-preview, .cv-preview-frame { position: static; height: auto !important; box-shadow: none; border-radius: 0; overflow: visible; }
  #cv-sheet { transform: none !important; width: 210mm; min-height: 0; padding: 14mm 16mm; }
  .cvs-sec h2, .cvs-entry-top { break-after: avoid; }
}

/* ---- Aviso de privacidad (arriba del formulario) ---- */
.cv-notice { display: flex; gap: 14px; align-items: flex-start; background: #fef2f2; border: 1px solid #fca5a5; border-radius: var(--radius); padding: 16px 20px; color: #7f1d1d; font-size: 14px; }
.cv-notice svg { width: 22px; height: 22px; stroke: #dc2626; flex-shrink: 0; margin-top: 1px; }
.cv-notice strong { display: block; color: #b91c1c; font-size: 15px; margin-bottom: 3px; }
.cv-notice b { color: #b91c1c; }

/* ---- Botón "Sugerir otro texto" ---- */
.cv-suggest { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--blue-600); background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 9px; padding: 8px 13px; cursor: pointer; }
.cv-suggest:hover { background: var(--blue-100); border-color: var(--blue-400); }
.cv-suggest svg { width: 15px; height: 15px; transition: transform .35s; }
.cv-suggest:active svg { transform: rotate(180deg); }

/* ---- Encuadre de la foto ---- */
.cv-crop { position: fixed; inset: 0; z-index: 300; background: rgba(20, 24, 31, .7); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cv-crop[hidden] { display: none; }
body.cv-crop-open { overflow: hidden; }
body.cv-crop-open .cv-fab { display: none; }
.cv-crop-box { background: var(--paper); border-radius: 18px; padding: 22px; width: 100%; max-width: 520px; max-height: 100%; overflow-y: auto; }
.cv-crop-box h2 { font-size: 20px; margin-bottom: 2px; }
.cv-crop-area { margin-top: 14px; height: min(60vh, 420px); background: #e9edf3; border-radius: 10px; overflow: hidden; }
.cv-crop-area img { display: block; max-width: 100%; }
.cv-crop-tools { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.cv-crop-tool { font: inherit; font-size: 20px; font-weight: 700; line-height: 1; min-width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.cv-crop-tool:hover { border-color: var(--blue-400); color: var(--blue-600); }
.cv-crop-tool-text { font-size: 13.5px; padding: 0 14px; }
.cv-crop-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
@media (max-width: 480px) { .cv-crop-box { padding: 16px; } .cv-crop-actions .cv-btn { flex: 1; } }
@media print { .cv-crop { display: none !important; } }

/* ---- Aviso "vienes de…" (llegada desde ¿De dónde vienes?) ---- */
.cv-from { margin: 10px 0 4px; font-size: 13.5px; color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 10px 12px; }
.cv-from strong { color: #14532d; }
