/* ============================================================
   CV BUILDER — formulario izquierda, preview derecha
   ============================================================ */

.cv-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(10, 10, 10, .85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.cv-header .logo-img { height: 38px; }
.cv-header-actions { display: flex; gap: 10px; }

.cv-main {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(0, 1.2fr);
  gap: 24px;
  padding: 24px;
  align-items: start;
  min-height: calc(100vh - 70px);
}

/* ----- FORM ----- */
.cv-form-wrapper {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 8px;
}
.cv-form-intro h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.8rem;
  margin: 0 0 6px;
  color: var(--white);
  letter-spacing: -0.01em;
}
.cv-form-intro p {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 0.92rem;
}
.cv-form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px 20px;
  margin: 0 0 14px;
  background: rgba(255, 255, 255, .02);
}
.cv-form legend {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: 600;
  padding: 0 8px;
}
.cv-form label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.cv-form .cv-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cv-form input,
.cv-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.92rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.cv-form input:focus,
.cv-form textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, .15);
}
.cv-form textarea { resize: vertical; min-height: 80px; }

.cv-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}
.cv-item {
  position: relative;
  padding: 14px 14px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.cv-item-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: color .2s, border-color .2s;
}
.cv-item-remove:hover { color: var(--orange); border-color: var(--orange); }
.btn-add {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--orange);
  border: 1px dashed var(--orange-ring);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.btn-add:hover { background: var(--orange-soft); color: var(--orange-bright); }

.cv-form-wrapper::-webkit-scrollbar { width: 6px; }
.cv-form-wrapper::-webkit-scrollbar-track { background: transparent; }
.cv-form-wrapper::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }

/* ============================================================
   PREVIEW (CV en estilo Harvard con guiño VengaJobs)
   ============================================================ */
.cv-preview-wrapper {
  display: flex;
  justify-content: center;
  padding-bottom: 40px;
}
.cv-paper {
  width: 100%;
  max-width: 820px;
  min-height: 1100px;
  padding: 60px 64px;
  background: #FFFFFF;
  color: #1a1a1a;
  font-family: 'EB Garamond', 'Times New Roman', Garamond, serif;
  font-size: 11pt;
  line-height: 1.45;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5);
  border-radius: 4px;
  position: relative;
}

.cv-paper-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid #FF6A00; }
.cv-paper-header h1 {
  font-family: 'EB Garamond', serif;
  font-weight: 600;
  font-size: 28pt;
  color: #0a0a0a;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.cv-paper-title {
  font-size: 11pt;
  color: #555;
  margin: 0 0 12px;
  font-style: italic;
}
.cv-paper-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 9.5pt;
  color: #444;
}
.cv-paper-contact span::before {
  content: "•";
  margin-right: 14px;
  color: #FF6A00;
}
.cv-paper-contact span:first-child::before { display: none; }

.cv-section { margin: 18px 0; }
.cv-section h2 {
  font-family: 'EB Garamond', serif;
  font-size: 11pt;
  font-weight: 700;
  color: #0a0a0a;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #FF6A00;
}
.cv-section p, .cv-section li { color: #1a1a1a; }
.cv-section .cv-empty {
  color: #aaa;
  font-style: italic;
  font-size: 10pt;
}

.cv-entry { margin-bottom: 14px; }
.cv-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 2px;
}
.cv-entry-head strong {
  font-weight: 700;
  font-size: 11pt;
  color: #0a0a0a;
}
.cv-entry-head em {
  font-style: normal;
  color: #666;
  font-size: 10pt;
  white-space: nowrap;
}
.cv-entry-sub {
  font-style: italic;
  color: #444;
  font-size: 10pt;
  margin: 0 0 4px;
}
.cv-entry ul {
  margin: 4px 0 0;
  padding-left: 18px;
  list-style: none;
}
.cv-entry ul li {
  position: relative;
  margin: 2px 0;
  font-size: 10.5pt;
  padding-left: 12px;
}
.cv-entry ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #FF6A00;
  font-weight: 700;
}

/* Footer antiguo (vj. + "Hecho con vengajobs.com" en parte inferior)
   queda oculto. La marca ahora vive en .cv-paper-brand (top-right). */
.cv-paper-footer { display: none !important; }
.cv-vj { display: none !important; }

/* Marca VengaJobs en esquina superior derecha del CV */
.cv-paper-brand {
  position: absolute;
  top: 28px;
  right: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 8.5pt;
  color: #888;
  letter-spacing: 0;
  z-index: 2;
  pointer-events: none;
}
.cv-paper-brand img {
  height: 16px;
  width: auto;
  /* Logo del sitio es blanco (disenado para fondo oscuro). Lo invertimos
     a negro puro para que se lea sobre el papel blanco del CV. */
  filter: brightness(0);
  opacity: 0.85;
}

.cv-section.is-empty { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .cv-main { grid-template-columns: 1fr; }
  .cv-form-wrapper { position: static; max-height: none; }
  .cv-preview-wrapper { padding-top: 8px; }
  .cv-paper { padding: 40px 36px; min-height: auto; }
  .cv-paper-brand { top: 16px; right: 18px; }
  .cv-paper-brand img { height: 14px; }
}
@media (max-width: 600px) {
  .cv-header { padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
  .cv-header-actions { flex: 1 1 100%; justify-content: flex-end; }
  .cv-main { padding: 16px; }
  .cv-form .cv-row { grid-template-columns: 1fr; }
  .cv-paper { padding: 28px 22px; font-size: 10.5pt; }
  .cv-paper-header h1 { font-size: 22pt; }
  .cv-paper-brand { top: 12px; right: 14px; gap: 5px; }
  .cv-paper-brand img { height: 12px; }
  .cv-paper-brand span { font-size: 7.5pt; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff !important; }
  body::before { display: none !important; }
  .cursor-glow,
  .cv-header,
  .cv-form-wrapper,
  .vj-game-trigger { display: none !important; }
  .cv-main {
    display: block;
    padding: 0;
    min-height: auto;
  }
  .cv-preview-wrapper { padding: 0; }
  .cv-paper {
    box-shadow: none;
    border-radius: 0;
    padding: 50px 56px;
    max-width: 100%;
    min-height: 100vh;
    page-break-after: avoid;
  }
  .cv-paper-brand {
    position: absolute;
    top: 28px;
    right: 32px;
  }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
