/* styles.css: estilos principales y responsividad */
html{ box-sizing: border-box; width:100%; overflow-x:hidden; }
*, *::before, *::after{ box-sizing: inherit; }
body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #f4f6f8;
  padding: 0; /* unifica con la home: header pegado a los bordes */
  margin: 0; /* elimina margen por defecto del navegador */
  color: #333;
  width:100%;
  overflow-x: hidden; /* evita desbordes horizontales en móvil */
}
:root{
  --brand:#0d6efd;
  --brand-600:#0b5ed7;
  --ink:#111827;
  --muted:#6b7280;
  --surface:#ffffff;
  --line:#e5e7eb;
  --shell: 1200px;
}

/* ========================== Layout base y Header ========================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .shell,
.site-footer .shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.2px;
}
.site-nav { display: flex; gap: 14px; align-items: center; }
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
}
.site-nav a:hover { background: #f1f5f9; }
.nav-toggle {
  display: none;
  background: transparent;
  color: var(--ink);
}
@media (max-width: 820px){
  .site-nav { position: fixed; right: 12px; top: 56px; background: var(--surface); border:1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.08); padding: 8px; display: none; flex-direction: column; min-width: 180px; }
  .site-nav.open { display: flex; }
  .nav-toggle { display: inline-flex; }
}

/* Mejoras sutiles generales */
body { color: var(--ink); }
.container { max-width: var(--shell); }
form { border: 1px solid var(--line); }
button { background: var(--brand); }
button:hover { background: var(--brand-600); }
#openPdfBtn, #downloadPdfBtn { background: #6b7280; }
#openPdfBtn:hover, #downloadPdfBtn:hover { background: #4b5563; }

/* ============================== Home (landing) nueva ============================== */
/* Scope básico para el home en raíz */
.home-root { padding: 0; margin: 0; background: #f1f5f9; }

/* Shell + helpers */
.home-shell{width:100%;max-width:var(--shell);margin:0 auto;padding:0 20px}
.home-btn{display:inline-flex;align-items:center;justify-content:center;border-radius:12px;padding:12px 20px;font-weight:600;text-decoration:none;border:1px solid var(--line);color:var(--ink);background:#fff;transition:.2s ease}
.home-btn:hover{background:#f8fafc}

/* Header */
.home-header{position:sticky;top:0;background:rgba(255,255,255,.9);backdrop-filter:saturate(130%) blur(8px);border-bottom:1px solid var(--line);z-index:20}
.home-nav a[aria-current="page"]{background:#eef2f7;font-weight:700}
.home-header .home-shell{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 20px}
.home-brand{font-weight:800;color:var(--ink);text-decoration:none}
/* Mobile-first: nav oculto por defecto, toggle visible */
.home-nav{position:fixed;right:12px;top:56px;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.12);padding:8px;display:flex;flex-direction:column;min-width:190px;opacity:0;transform:translateY(-6px);pointer-events:none;transition:opacity .18s ease, transform .18s ease}
.home-nav.open{opacity:1;transform:none;pointer-events:auto}
.home-nav a{color:var(--ink);text-decoration:none;padding:8px 10px;border-radius:8px}
.home-nav a:hover{background:#eef2f7}
.home-navToggle{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:0;font-size:22px;line-height:1;color:var(--ink);padding:6px 8px;border-radius:8px;cursor:pointer}
.home-navToggle:hover{background:#eef2f7}
.home-nav a{color:var(--ink);text-decoration:none;padding:8px 10px;border-radius:8px}
.home-nav a:hover{background:#eef2f7}
.home-navToggle{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:0;font-size:22px;line-height:1;color:var(--ink);padding:6px 8px;border-radius:8px;cursor:pointer}
.home-navToggle:hover{background:#eef2f7}
/* Desktop overrides */
@media (min-width:821px){
  .home-nav{position:static;display:flex;flex-direction:row;gap:12px;box-shadow:none;border:none;padding:0;background:transparent;opacity:1;transform:none;pointer-events:auto}
  .home-navToggle{display:none}
}

/* Main */
.home-main{padding:40px 0 80px}
.home-main section+section{margin-top:56px}

/* Hero */
.home-hero{background:linear-gradient(115deg,#f6f9ff 0%,#ffffff 45%,#eaf1ff 100%);border-radius:24px;padding:28px 0;box-shadow:0 16px 40px rgba(15,23,42,.08);margin-bottom:16px;min-height:auto}
.home-hero .home-shell{display:flex;gap:24px;align-items:center;justify-content:center;flex-direction:column}
.home-hero__text{max-width:780px;width:100%;flex:0 0 auto;min-width:0;margin:0 auto;text-align:center}
.home-hero__text h1{margin:0 0 14px;font-size:clamp(1.8rem,4.2vw,2.8rem);line-height:1.15;letter-spacing:-.4px;background:linear-gradient(90deg,#113977,#1f6bff);-webkit-background-clip:text;background-clip:text;color:transparent;font-weight:800}
.home-lead{margin:0 auto 20px;color:#475569;max-width:60ch}
.home-ctaRow{display:flex;gap:12px;flex-wrap:wrap;justify-content:center}
/* Visual del hero retirado */

/* Steps */
.home-steps{background:#fff;border-radius:20px;padding:36px 0;box-shadow:0 12px 28px rgba(15,23,42,.06)}
.home-steps{background:#fff;border-radius:20px;padding:28px 0;box-shadow:0 12px 28px rgba(15,23,42,.06)}
.home-steps .home-shell{display:flex;flex-direction:column;align-items:center}
.home-steps h2{margin:0 0 14px;font-size:1.6rem;text-align:center}
.home-stepsList{list-style:none;margin:0 auto;padding:0;display:grid;gap:12px;max-width:680px}
.home-stepsList li{background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px 16px 12px 56px;position:relative;color:#1f2937}
.home-num{position:absolute;left:16px;top:50%;transform:translateY(-50%);width:28px;height:28px;border-radius:8px;background:var(--brand);color:#fff;font-weight:700;display:inline-flex;align-items:center;justify-content:center;box-shadow:0 10px 18px rgba(29,78,216,.25)}

/* Metrics */
.home-metrics{background:transparent}
.home-metricsGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px}
.home-metric{background:linear-gradient(160deg,#f8fbff,#ffffff);border:1px solid #e0e7ff;border-radius:18px;padding:22px 18px;text-align:center;box-shadow:0 10px 22px rgba(15,23,42,.06)}
.home-metric__num{display:block;font-size:2.1rem;font-weight:700;letter-spacing:-.5px}
.home-metric__desc{display:block;margin-top:8px;font-size:.74rem;color:#475569;text-transform:uppercase;letter-spacing:.4px}

/* Documents */
.home-docs{background:#ffffff;border-radius:22px;padding:48px 0;box-shadow:0 12px 30px rgba(15,23,42,.07)}
.home-docs h2{margin:0 0 28px;font-size:1.7rem;text-align:center}
.home-docsGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:24px}
.home-docCard{background:#fff;border:1px solid var(--line);border-radius:16px;padding:20px 18px;box-shadow:0 6px 18px rgba(0,0,0,.05)}
.home-docCard h3{margin:0 0 10px;font-size:1.02rem;text-align:center}
.home-docCard ul{margin:0;padding:0;list-style:none;display:grid;gap:8px}
.home-docCard li{position:relative;padding-left:18px;color:#334155;font-size:.92rem}
.home-docCard li::before{content:"";position:absolute;left:0;top:.55em;width:9px;height:9px;border-radius:50%;background:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.25)}
/* Link estilizado dentro de la lista de documentos */
.home-docCard li a{color:#334155;text-decoration:none}
.home-docCard li a:hover{text-decoration:underline}

/* Footer */
.home-footer{margin-top:40px;background:#0b1220;color:#d1d5db;border-top:1px solid #0f172a}
.home-footer .home-footerNav a[aria-current="page"]{text-decoration:underline}
.home-footer .home-shell{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 20px}
.home-footerNav{display:flex;gap:12px;flex-wrap:wrap}
.home-footerNav a{color:#a5b4fc;text-decoration:none}
.home-footerNav a:hover{text-decoration:underline}

/* Responsive */
@media (max-width:1024px){.home-hero .home-shell{flex-direction:column;text-align:center}.home-hero__text{min-width:unset}.home-steps .home-shell{display:flex;flex-direction:column;align-items:center}}
@media (max-width:640px){
  .home-main{padding:20px 0 48px}
  .home-main section+section{margin-top:28px}
  .home-hero{padding:14px 0 !important;border-radius:16px;margin-bottom:10px;min-height:0 !important}
  .home-hero .home-shell{gap:10px !important}
  .home-hero__text{max-width:560px;width:100%;flex:0 0 auto}
  .home-hero__text h1{font-size:clamp(1.6rem,6vw,2.1rem)}
  .home-lead{max-width:52ch}
  .home-stepsList{max-width:100%}
}

/* Tabs navegación */
.tabs { margin-bottom: 14px; }
.tablist { display: flex; gap: 6px; }
.tab {
  background: #e3e7eb;
  color: #333;
  border: none;
  padding: 8px 14px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  position: relative;
  transition: background .2s ease, color .2s ease;
}
.tab:hover { background: #d5dbe0; }
.tab.active {
  background: #fff;
  color: #111;
  box-shadow: 0 -2px 6px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.06);
  border-bottom: 2px solid #fff;
}
#tab-panels { border: 1px solid #d8dce0; border-radius: 0 8px 8px 8px; background:#fff; padding:18px; }
section[role="tabpanel"] { animation: fadeTab .25s ease; }
@keyframes fadeTab { from { opacity:0; transform: translateY(4px);} to { opacity:1; transform:none; } }
.panel-placeholder { padding: 10px; background: #fafbfc; border:1px dashed #c9d1d9; border-radius:6px; font-size:14px; }
h1 {
  text-align: center;
  margin-bottom: 20px;
}
.collapsible-h2 {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.collapsible-h2::after {
  content: '▾';
  margin-left: auto;
  font-size: 22px; /* Aumentado para mayor visibilidad */
  line-height: 1;
  transition: transform .2s ease;
}
.collapsible-h2[aria-expanded="false"]::after {
  transform: rotate(-90deg);
}
.section-collapse[hidden] { display: none; }
.container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: auto;
}
/* Grid interno para distribuir los campos del formulario en dos columnas */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
  align-items: start;
}
/* Clase para ocupar ambas columnas (ej. selects grandes, boton, campoPais) */
.form-grid .full {
  grid-column: 1 / -1;
}
form {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
/* Secciones desplegables */
details.section {
  border: 1px solid #d8dce0;
  border-radius: 8px;
  background: #fff;
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow .25s ease;
}
details.section[open] {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
details.section summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  padding: 10px 14px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
details.section summary::-webkit-details-marker { display: none; }
details.section summary:after {
  content: '\25BC';
  font-size: 12px;
  margin-left: auto;
  transition: transform .3s ease;
}
details.section[open] summary:after { transform: rotate(180deg); }
details.section .form-grid { padding: 0 14px 14px; }
@media (max-width: 768px) {
  details.section summary { font-size: 14px; padding: 10px 12px; }
  details.section .form-grid { padding: 0 12px 12px; }
}
label {
  display: block;
  margin-top: 6px;
  font-weight: bold;
  font-size: 14px;
}
input, select {
  width: 100%;
  padding: 8px;
  margin-top: 6px;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
  font-size: 14px;
}
button {
  margin-top: 14px;
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 15px;
}
button:hover { background: #0056b3; }
/* Alineación del botón dentro de la rejilla (ocupa ambas columnas) */
.form-actions { text-align: right; }

/* Visor PDF */
iframe {
  width: 100%;
  height: 750px;
  border: none;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  background: white;
}

/* Desktop canvas preview */
#pdfCanvasDesktop {
  display: block;
  width: 100%;
  height: 750px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  transition: filter .25s ease;
  /* Evita efectos de rotación/volteo por herencia accidental */
  transform: none !important;
}
@media (min-width: 769px) {
  /* Efecto blur solo en escritorio */
  #pdfCanvasDesktop:hover {
    filter: blur(2px);
  }
}

.overlay {
  /* hidden by default on larger screens; enabled only on mobile via media query */
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 76vh;
  max-height: 92vh;
  background: #fff;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.25);
  transform: translateY(100%);
  transition: transform 360ms cubic-bezier(.22,.9,.3,1);
  z-index: 9999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.overlay.open {
  transform: translateY(0);
}
.overlay .overlay-header {
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(0,0,0,0.02), transparent);
}
.close-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  color: #222; /* asegurar contraste frente al header */
  font-weight: 600;
  z-index: 10001;
}
.close-btn:hover { background: rgba(0,0,0,0.06); }

/* Make iframe inside overlay take the remaining space */
.overlay iframe {
  height: calc(100% - 40px);
  border-radius: 0 0 12px 12px;
}

/* Canvas preview styles */
#pdfCanvasContainer {
  background: #fff; /* evitar bandas negras alrededor del canvas */
  display: flex;
  align-items: center;
  justify-content: center;
}
#pdfCanvas { display: block; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* Asegura que ningún canvas se invierta por CSS externo/UA */
#pdfCanvas, #pdfCanvasDesktop {
  image-orientation: from-image;
  transform: none !important;
}

/* Mensaje de error/estado discreto en el formulario */
.inline-error {
  display: inline-block;
  margin-left: 10px;
  color: #b00020;
  font-size: 13px;
}

/* Open button (fallback) */
.overlay .notice {
  padding: 8px 12px;
  font-size: 13px;
  color: #444;
}

/* When overlay is open, prevent body scroll */
.lock-scroll { overflow: hidden; }

/* --- Responsividad y animación para móviles --- */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }
  .container { padding: 0 8px; }
  form { padding: 16px; }
  /* Apilar todos los campos en una sola columna (efecto .full) */
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > * { grid-column: 1 / -1 !important; }
  h1 { font-size: 1.25rem; margin: 12px 0 10px; }
  .tablist { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { flex: 0 0 auto; }
  /* Hacemos que el iframe comience ligeramente desplazado y transparente
     y al mostrarlo reciba la clase `.visible` para deslizarlo hacia arriba */
  #preview {
    height: 60vh;
    transform: translateY(18px);
    opacity: 0;
    transition: transform 360ms cubic-bezier(.2,.9,.3,1), opacity 360ms ease;
  }
  #preview.visible {
    transform: translateY(0);
    opacity: 1;
  }

  /* show mobile overlay and hide inline preview */
  .overlay { display: flex; }
  #previewInline { display: none; }
  #pdfCanvasDesktop { display: none; }
  #previewDesktopContainer { display: none; }
}

/* En pantallas grandes el preview siempre visible */
@media (min-width: 769px) {
  /* Desktop: show inline preview, hide overlay */
  #preview { opacity: 1; transform: none; }
  #previewInline { display: none; }
  /* Mantener el preview siempre visible con posición sticky */
  #previewDesktopContainer {
    position: sticky;
    top: 16px;            /* margen superior cuando hace stick */
    align-self: start;    /* evita estirar a toda la altura de la fila */
    height: calc(100vh - 32px); /* ocupa el alto de la ventana menos márgenes */
  }
  #pdfCanvasDesktop { 
    display: block; 
    width: 100%; 
    height: 100%; /* el script escalará el canvas a este alto */
  }
  .overlay { display: none; }
}

/* --- Educación superior dinámica: estilos y animación --- */
details.edu-block {
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  background: #fff;
  margin: 10px 0;
  overflow: hidden;
}
details.edu-block summary.edu-header {
  list-style: none;
  padding: 8px 12px;
  font-weight: 600;
}
details.edu-block summary.edu-header::-webkit-details-marker { display: none; }
.edu-header .chev {
  display: inline-block;
  transition: transform .25s ease;
  color: #333;
}
details.edu-block[open] .edu-header .chev {
  transform: rotate(90deg);
}
.edu-actions { padding: 0 12px; }
.edu-actions .remove-edu {
  background: transparent;
  border: 1px solid #d0d7de;
  color: #333;
  border-radius: 6px;
  padding: 4px 8px;
}
.edu-actions .remove-edu:hover { background: #f3f4f6; }
.edu-content { 
  padding: 0 12px 12px;
  opacity: .0; 
  transform: translateY(-2px);
  transition: opacity .2s ease, transform .2s ease;
}
details.edu-block[open] .edu-content { opacity: 1; transform: none; }

/* --- Idiomas dinámicos: estilos y animación --- */
details.idioma-block {
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  background: #fff;
  margin: 10px 0;
  overflow: hidden;
}
details.idioma-block summary.idioma-header {
  list-style: none;
  padding: 8px 12px;
  font-weight: 600;
}
details.idioma-block summary.idioma-header::-webkit-details-marker { display: none; }
.idioma-header .chev {
  display: inline-block;
  transition: transform .25s ease;
  color: #333;
}
details.idioma-block[open] .idioma-header .chev { transform: rotate(90deg); }
.idioma-actions { padding: 0 12px; }
.idioma-actions .remove-idioma {
  background: transparent;
  border: 1px solid #d0d7de;
  color: #333;
  border-radius: 6px;
  padding: 4px 8px;
}
.idioma-actions .remove-idioma:hover { background: #f3f4f6; }
.idioma-content {
  padding: 0 12px 12px;
  opacity: .0;
  transform: translateY(-2px);
  transition: opacity .2s ease, transform .2s ease;
}
details.idioma-block[open] .idioma-content { opacity: 1; transform: none; }

/* --- Experiencia laboral dinámica: estilos y animación --- */
details.exp-block {
  border: 1px solid #e1e5ea;
  border-radius: 8px;
  background: #fff;
  margin: 10px 0;
  overflow: hidden;
}
details.exp-block summary.exp-header {
  list-style: none;
  padding: 8px 12px;
  font-weight: 600;
}
details.exp-block summary.exp-header::-webkit-details-marker { display: none; }
.exp-header .chev {
  display: inline-block;
  transition: transform .25s ease;
  color: #333;
}
details.exp-block[open] .exp-header .chev { transform: rotate(90deg); }
.exp-actions { padding: 0 12px; }
.exp-actions .remove-exp {
  background: transparent;
  border: 1px solid #d0d7de;
  color: #333;
  border-radius: 6px;
  padding: 4px 8px;
}
.exp-actions .remove-exp:hover { background: #f3f4f6; }
.exp-content {
  padding: 0 12px 12px;
  opacity: .0;
  transform: translateY(-2px);
  transition: opacity .2s ease, transform .2s ease;
}
details.exp-block[open] .exp-content { opacity: 1; transform: none; }

/* =====================================================================
   ARTÍCULO SEO — Estilos específicos (acotados a .seo-article)
   Mantener esta sección independiente para facilitar mantenimiento.
   ===================================================================== */
.seo-article {
  max-width: 860px;
  margin: 48px auto 64px auto;
  padding: 0 16px;
  line-height: 1.7;
  color: #1b1b1b;
}
.seo-article h2 {
  font-size: 1.9rem;
  line-height: 1.3;
  margin: 0 0 12px 0;
}
.seo-article h3 {
  font-size: 1.25rem;
  margin: 28px 0 10px 0;
}
.seo-article p { margin: 12px 0; }
.seo-article ul, .seo-article ol { margin: 8px 0 16px 24px; }
.seo-article .toc {
  background: #f7f7f8;
  border: 1px solid #ececee;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0 24px 0;
}
.seo-article .note {
  background: #fff7e6;
  border: 1px solid #ffe0a3;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 0.95rem;
}
.seo-article details {
  border: 1px solid #ececee;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  margin: 10px 0;
}
.seo-article summary { font-weight: 600; cursor: pointer; }
@media (max-width: 768px) {
  .seo-article { max-width: 96ch; margin: 32px auto 48px; }
  .seo-article h2 { font-size: 1.5rem; }
  .seo-article h3 { font-size: 1.1rem; }
}
/* ============================= FIN ARTÍCULO SEO ============================= */

/* ============================== Footer del sitio ============================== */
.site-footer{
  background: #0b1220;
  color: #d1d5db;
  border-top: 1px solid #0f172a;
  margin-top: 40px;
}
.site-footer a{ color: #a5b4fc; text-decoration:none; }
.site-footer a:hover{ text-decoration:underline; }
.footer-nav{ display:flex; gap:12px; flex-wrap: wrap; }
