/* ==========================================================================
   Onboarding Doctorado · Horizontal Slides
   Universidad Pontificia Comillas
   ========================================================================== */

:root {
    --comillas: #003366;
    --comillas-light: #0C4EA6;
    --comillas-dark: #001d3d;
    --accent: #F59F00;
    --accent-light: #FFF7E0;
    --purple: #8B5CF6;
    --purple-light: #F3EFFE;
    --green: #198754;
    --green-light: #E8F5EC;
    --red: #DC3545;
    --red-light: #FCEBED;
    --blue-pale: #E8F0FE;
    --bg: #f4f6f8;
    --card-bg: #ffffff;
    --border: #dee2e6;
    --text: #1f2937;
    --text-muted: #6c757d;
    --radius: 14px;
    --slide-gap: 48px;
}

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Bloqueo total de la ventana: el carrusel horizontal (ancho = Nx100vw) NO debe
   poder expandir ni desplazar el viewport (crítico en móvil). */
html {
    scroll-behavior: smooth;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
    color: var(--text);
    line-height: 1.65;
    background: var(--bg);
    overflow: hidden;
    overscroll-behavior: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--comillas);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-weight: 600;
    font-size: 15px;
}

.topbar-logo svg { height: 28px; width: 28px; opacity: 0.9; }
.topbar-logo-img { height: 32px; width: auto; opacity: 0.95; }

.topbar-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    font-weight: 600;
}

.progress-bar-bg {
    width: 160px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.4s ease;
}

/* ---- Dot navigation ---- */
.topbar-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.topbar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.25);
    cursor: pointer;
    padding: 0;
    transition: all 0.25s;
    position: relative;
}

.topbar-dot:hover {
    background: rgba(255,255,255,0.5);
    transform: scale(1.25);
}

.topbar-dot.active {
    background: var(--accent);
    transform: scale(1.3);
    box-shadow: 0 0 6px rgba(245,159,0,0.5);
}

/* Tooltip on hover */
.topbar-dot::after {
    content: attr(data-label);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.topbar-dot:hover::after {
    opacity: 1;
}

@media (max-width: 768px) {
    .topbar-dots { gap: 4px; }
    .topbar-dot { width: 8px; height: 8px; }
    .topbar-dot::after { display: none; }
}

/* ==========================================================================
   CIRCULAR NAV BUTTONS (lateral)
   ========================================================================== */
.nav-circle {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 110;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.nav-circle.prev {
    left: 20px;
    background: rgba(255,255,255,0.92);
    color: var(--comillas);
    backdrop-filter: blur(8px);
}

.nav-circle.next {
    right: 20px;
    background: var(--comillas);
    color: white;
}

.nav-circle:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
}

.nav-circle.next:hover { background: var(--comillas-light); }

.nav-circle:disabled {
    opacity: 0;
    pointer-events: none;
}

.nav-circle svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================================
   SLIDES CONTAINER
   ========================================================================== */
.slides-wrapper {
    display: flex;
    height: 100vh;
    width: max-content;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.15, 1);
    padding-top: 56px;
}

.slide {
    width: 100vw;
    height: calc(100vh - 56px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--slide-gap) 80px;
    position: relative;
}

/* Hide scrollbar when content fits */
.slide::-webkit-scrollbar { width: 6px; }
.slide::-webkit-scrollbar-track { background: transparent; }
.slide::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
.slide::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

.slide-inner {
    max-width: 920px;
    width: 100%;
}

/* Slides with little content: center vertically */
.slide.v-center {
    align-items: center;
}

/* ---- Staggered fade-in animations ---- */
.slide .slide-inner { opacity: 0; transform: translateY(30px); }

.slide.active .slide-inner {
    animation: slideUp 0.55s ease forwards;
}

.slide.active .card,
.slide.active .callout,
.slide.active .contact-card,
.slide.active .timeline-item {
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

.slide.active .card:nth-child(1),
.slide.active .callout:nth-child(1),
.slide.active .timeline-item:nth-child(1) { animation-delay: 0.15s; }
.slide.active .card:nth-child(2),
.slide.active .callout:nth-child(2),
.slide.active .timeline-item:nth-child(2) { animation-delay: 0.25s; }
.slide.active .card:nth-child(3),
.slide.active .timeline-item:nth-child(3) { animation-delay: 0.35s; }
.slide.active .card:nth-child(4),
.slide.active .timeline-item:nth-child(4) { animation-delay: 0.45s; }
.slide.active .timeline-item:nth-child(5) { animation-delay: 0.50s; }
.slide.active .timeline-item:nth-child(6) { animation-delay: 0.55s; }
.slide.active .timeline-item:nth-child(7) { animation-delay: 0.60s; }
.slide.active .timeline-item:nth-child(8) { animation-delay: 0.65s; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   SLIDE BACKGROUNDS (alternating)
   ========================================================================== */
/* Default: light grey */
.slide { background: var(--bg); }

/* Hero: handled separately */

/* Alternating flavors via data-theme on <section> */
.slide[data-theme="white"]   { background: #ffffff; }
.slide[data-theme="blue"]    { background: linear-gradient(165deg, #e8f0fe 0%, #f0f4ff 100%); }
.slide[data-theme="purple"]  { background: linear-gradient(165deg, #f3effe 0%, #f8f5ff 100%); }
.slide[data-theme="green"]   { background: linear-gradient(165deg, #e8f5ec 0%, #f0faf3 100%); }
.slide[data-theme="gold"]    { background: linear-gradient(165deg, #fff7e0 0%, #fffcf0 100%); }
/* Warm: light version of dark (cream + gold accents) */
.slide[data-theme="warm"] {
    background: linear-gradient(165deg, #f8f5ed 0%, #faf7f0 100%);
}
.slide[data-theme="warm"] h2 { color: var(--comillas); }
.slide[data-theme="warm"] .slide-eyebrow { color: #8a6300; }
.slide[data-theme="warm"] .slide-eyebrow .num { background: var(--accent); color: white; }
.slide[data-theme="warm"] .card { background: white; border-color: #e8e0cc; }
.slide[data-theme="warm"] .callout.info { background: #fff7e0; border-color: var(--accent); }
.slide[data-theme="warm"] .callout.info strong { color: #8a6300; }
.slide[data-theme="warm"] .callout.warn { background: #fff7e0; border-color: var(--accent); }
.slide[data-theme="warm"] .callout.warn strong { color: #8a6300; }
.slide[data-theme="warm"] .contact-card { background: white; border-color: #e8e0cc; }
.slide[data-theme="warm"] .contact-card h4 { color: var(--comillas); }
.slide[data-theme="warm"] table { background: white; border-color: #e8e0cc; }
.slide[data-theme="warm"] tbody tr:nth-child(even) { background: #faf7f0; }

.slide[data-theme="dark"]    {
    background: linear-gradient(135deg, var(--comillas-dark) 0%, #0a3060 100%);
    color: white;
}
.slide[data-theme="dark"] h2 { color: white; }
.slide[data-theme="dark"] .subtitle { color: rgba(255,255,255,0.7); }
.slide[data-theme="dark"] .slide-eyebrow { color: var(--accent); }
.slide[data-theme="dark"] .slide-eyebrow .num { background: var(--accent); color: var(--comillas-dark); }
.slide[data-theme="dark"] .card { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.12); color: white; }
.slide[data-theme="dark"] .card h3 { color: white; }
.slide[data-theme="dark"] .card p,
.slide[data-theme="dark"] .card li { color: rgba(255,255,255,0.85); }
.slide[data-theme="dark"] .callout { background: rgba(255,255,255,0.08); border-color: var(--accent); }
.slide[data-theme="dark"] .callout strong { color: var(--accent); }
.slide[data-theme="dark"] .contact-card { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
.slide[data-theme="dark"] .contact-card h4 { color: var(--accent); }
.slide[data-theme="dark"] .contact-card p { color: rgba(255,255,255,0.7); }
.slide[data-theme="dark"] .contact-card a { color: var(--accent); }

/* Dark theme: tables */
.slide[data-theme="dark"] table { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); }
.slide[data-theme="dark"] thead { background: rgba(255,255,255,0.1); color: white; }
.slide[data-theme="dark"] th { color: var(--accent); }
.slide[data-theme="dark"] td { color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.08); }
.slide[data-theme="dark"] tbody tr { border-color: rgba(255,255,255,0.08); }
.slide[data-theme="dark"] tbody tr:nth-child(even) { background: rgba(255,255,255,0.04); }

/* Decorative blobs (subtle) */
.slide[data-theme="blue"]::after,
.slide[data-theme="purple"]::after,
.slide[data-theme="green"]::after {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    opacity: 0.06;
    pointer-events: none;
    z-index: 0;
}

.slide[data-theme="blue"]::after   { background: var(--comillas-light); top: -120px; right: -120px; }
.slide[data-theme="purple"]::after { background: var(--purple); top: -100px; left: -120px; }
.slide[data-theme="green"]::after  { background: var(--green); top: -100px; right: -100px; }

.slide .slide-inner { position: relative; z-index: 1; }

/* ==========================================================================
   SLIDE: HERO (primera diapositiva)
   ========================================================================== */
/* Hero: light version by default */
.hero-slide {
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #e1ecf8 0%, #eae4f8 55%, #f0ecfa 130%) !important;
    color: var(--text);
    position: relative;
    overflow: hidden;
}

.hero-slide::before {
    content: "";
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(12,78,166,0.06) 0, transparent 50%),
        radial-gradient(circle at 80% 75%, rgba(139,92,246,0.08) 0, transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(245,159,0,0.05) 0, transparent 30%);
    z-index: 0;
}

.hero-slide .slide-inner {
    max-width: 720px;
}

.hero-slide h1 {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
    line-height: 1.15;
    color: var(--comillas);
}

.hero-slide .lead {
    font-size: clamp(17px, 2.2vw, 21px);
    color: var(--text-muted);
    margin-bottom: 36px;
    line-height: 1.55;
}

.hero-points {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 28px;
    text-align: left;
    margin-bottom: 36px;
}

.hero-point {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

.hero-slide.active .hero-point:nth-child(1) { animation-delay: 0.3s; }
.hero-slide.active .hero-point:nth-child(2) { animation-delay: 0.4s; }
.hero-slide.active .hero-point:nth-child(3) { animation-delay: 0.5s; }
.hero-slide.active .hero-point:nth-child(4) { animation-delay: 0.6s; }
.hero-slide.active .hero-point:nth-child(5) { animation-delay: 0.7s; }
.hero-slide.active .hero-point:nth-child(6) { animation-delay: 0.8s; }

.hero-point-icon {
    width: 32px; height: 32px;
    background: rgba(12,78,166,0.1);
    color: var(--comillas-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.btn-start {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--comillas);
    color: white;
    padding: 14px 36px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 4px 16px rgba(0,51,102,0.25);
    opacity: 0;
    animation: fadeIn 0.5s ease 0.9s forwards;
}

.btn-start:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 8px 32px rgba(0,51,102,0.35);
    background: var(--comillas-light);
}

/* ==========================================================================
   CONTENT SLIDES
   ========================================================================== */
.slide-eyebrow {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--comillas-light);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.slide-eyebrow .num {
    background: var(--comillas-light);
    color: white;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.slide h2 {
    font-size: clamp(28px, 3.8vw, 42px);
    font-weight: 800;
    color: var(--comillas);
    margin-bottom: 8px;
    line-height: 1.15;
    letter-spacing: -0.3px;
}

.slide .subtitle {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ==========================================================================
   CARDS
   ========================================================================== */
.cards {
    display: grid;
    gap: 16px;
    margin: 20px 0;
}

.cards.cols-2 { grid-template-columns: 1fr 1fr; }
.cards.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.cards.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

.card-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    transition: transform 0.3s;
}

.card-icon svg {
    width: 24px; height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.card:hover .card-icon { transform: scale(1.1); }

.card-icon.blue   { background: var(--blue-pale); color: var(--comillas-light); }
.card-icon.purple { background: var(--purple-light); color: var(--purple); }
.card-icon.green  { background: var(--green-light); color: var(--green); }
.card-icon.gold   { background: var(--accent-light); color: #8a6300; }
.card-icon.red    { background: var(--red-light); color: var(--red); }

.card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--comillas);
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

.card p, .card li {
    font-size: 15px;
    color: var(--text);
    line-height: 1.6;
}

.card ul { padding-left: 18px; margin-top: 6px; }
.card ul li { margin-bottom: 3px; }

.card .code {
    font-family: 'Consolas', 'Monaco', monospace;
    background: var(--bg);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid var(--border);
    display: inline-block;
}

/* ==========================================================================
   GRANTS LINK (pill button)
   ========================================================================== */
.grants-link-wrap {
    display: flex;
    justify-content: center;
    margin-top: 22px;
}

.grants-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 13px 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--comillas) 0%, var(--comillas-light) 100%);
    color: #fff;
    font-size: 15.5px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0,51,102,0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.grants-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,51,102,0.35);
}

.grants-link svg {
    width: 19px; height: 19px;
    stroke: currentColor; fill: none; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}

.grants-link .arrow {
    font-size: 18px;
    transition: transform 0.25s ease;
}

.grants-link:hover .arrow { transform: translateX(5px); }

body.all-dark .grants-link {
    background: linear-gradient(135deg, var(--accent) 0%, #ffb733 100%) !important;
    color: var(--comillas-dark) !important;
    box-shadow: 0 6px 20px rgba(245,159,0,0.3) !important;
}

/* ==========================================================================
   HIGHLIGHT BOXES / CALLOUTS
   ========================================================================== */
.callout {
    border-left: 4px solid;
    padding: 18px 22px;
    border-radius: 0 12px 12px 0;
    margin: 18px 0;
    font-size: 15px;
    line-height: 1.6;
}

.callout.info  { border-color: var(--comillas-light); background: var(--blue-pale); }
.callout.warn  { border-color: var(--accent); background: var(--accent-light); }
.callout.ok    { border-color: var(--green); background: var(--green-light); }
.callout.alert { border-color: var(--red); background: var(--red-light); }

.callout strong { color: var(--comillas); }
.callout.warn strong { color: #8a6300; }
.callout.ok strong { color: #126a40; }
.callout.alert strong { color: #a3232f; }

/* ==========================================================================
   DOCUMENT LINK CARD
   ========================================================================== */
.doc-card-link {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--purple);
    border-radius: var(--radius);
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text);
    margin: 14px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 640px;
}
.doc-card-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.18);
}
.doc-card-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: var(--purple-light);
    color: var(--purple);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s;
}
.doc-card-icon svg {
    width: 24px; height: 24px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.doc-card-link:hover .doc-card-icon { transform: scale(1.08); }
.doc-card-title {
    font-weight: 700;
    color: var(--comillas);
    font-size: 15px;
    line-height: 1.4;
}
.doc-card-meta {
    font-size: 13px;
    color: var(--purple);
    font-weight: 600;
    margin-top: 4px;
}

/* ==========================================================================
   CHIP / BADGE
   ========================================================================== */
.chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.chip.blue   { background: var(--blue-pale); color: var(--comillas-light); }
.chip.purple { background: var(--purple-light); color: var(--purple); }
.chip.green  { background: var(--green-light); color: var(--green); }
.chip.gold   { background: var(--accent-light); color: #8a6300; }

/* ==========================================================================
   TIMELINE
   ========================================================================== */
.timeline {
    position: relative;
    padding-left: 32px;
    margin: 16px 0;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: linear-gradient(to bottom, var(--comillas-light), var(--purple), var(--green));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding: 0 0 20px 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -26px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--comillas-light);
    background: white;
    transition: transform 0.3s, background 0.3s;
}

.slide.active .timeline-item:hover .timeline-dot {
    transform: scale(1.3);
    background: var(--blue-pale);
}

.timeline-item:nth-child(n+4) .timeline-dot { border-color: var(--purple); }
.timeline-item:nth-child(n+7) .timeline-dot { border-color: var(--green); }

.timeline-item h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--comillas);
    margin-bottom: 3px;
    letter-spacing: -0.1px;
}

.timeline-item p {
    font-size: 14.5px;
    color: var(--text-muted);
    line-height: 1.55;
}

/* ==========================================================================
   TABLE
   ========================================================================== */
.table-wrap { overflow-x: auto; margin: 16px 0; }

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    font-size: 14px;
}

thead { background: var(--comillas); color: white; }
th, td { text-align: left; padding: 10px 14px; }
tbody tr { border-top: 1px solid var(--border); }
tbody tr:nth-child(even) { background: var(--bg); }

/* ==========================================================================
   CONTACT GRID
   ========================================================================== */
.contact-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 22px;
    transition: all 0.3s;
}

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.contact-card h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--comillas);
    margin-bottom: 5px;
}

.contact-card p {
    font-size: 14px;
    color: var(--text-muted);
    overflow-wrap: break-word;
    word-break: break-word;
}

.contact-card a {
    color: var(--comillas-light);
    text-decoration: none;
    font-weight: 600;
    overflow-wrap: break-word;
    word-break: break-word;
}

.contact-card a:hover { text-decoration: underline; }

/* Evita que contenido largo (correos) ensanche las columnas del grid */
.cards > * { min-width: 0; }

/* Variante compacta (directorios con muchas fichas: p. ej. coordinadores) */
.cards.cards-compact { gap: 10px; }
.cards.cards-compact .contact-card { padding: 12px 15px; }
.cards.cards-compact .contact-card h4 { font-size: 13.5px; line-height: 1.3; margin-bottom: 4px; }
.cards.cards-compact .contact-card p { font-size: 12.5px; line-height: 1.45; }

/* ==========================================================================
   FAQs (accordion inside slides)
   ========================================================================== */
details.faq {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
}

details.faq[open] { border-color: var(--comillas-light); }

details.faq summary {
    cursor: pointer;
    padding: 12px 18px;
    font-weight: 600;
    font-size: 14.5px;
    color: var(--comillas);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.2s;
}

details.faq summary:hover { background: var(--bg); }

details.faq summary::-webkit-details-marker { display: none; }

details.faq summary::before {
    content: "+";
    color: var(--comillas-light);
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.2s;
}

details.faq[open] summary::before { content: "−"; }

.faq-body {
    padding: 0 20px 18px;
    font-size: 15px;
    color: var(--text);
    line-height: 1.6;
}

.faq-body p { margin-bottom: 8px; }
.faq-body p:last-child { margin-bottom: 0; }
.faq-body ul { padding-left: 18px; margin: 6px 0; }
.faq-body li { margin-bottom: 3px; }

.faq-category {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin: 14px 0 6px;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--border);
}

.faq-category:first-child { margin-top: 0; }

/* ==========================================================================
   DARK MODE TOGGLE
   ========================================================================== */
.dark-toggle {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    padding: 0;
}

.dark-toggle:hover {
    background: rgba(255,255,255,0.25);
    transform: scale(1.1);
}

.dark-toggle svg {
    width: 18px; height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 0.3s;
}

.dark-toggle:hover svg { transform: rotate(20deg); }

/* ==========================================================================
   LANGUAGE TOGGLE (segmented ES / EN)
   ========================================================================== */
.lang-toggle {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 18px;
    height: 32px;
    padding: 3px;
    transition: background 0.25s;
}

.lang-toggle:hover { background: rgba(255,255,255,0.22); }

.lang-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: white;
    border-radius: 13px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.15, 1);
    pointer-events: none;
    z-index: 0;
}

.lang-toggle.is-en .lang-thumb { transform: translateX(100%); }

.lang-option {
    position: relative;
    z-index: 1;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.72);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 0 12px;
    cursor: pointer;
    transition: color 0.25s;
    line-height: 1;
}

.lang-option:hover { color: rgba(255,255,255,0.95); }

.lang-toggle.is-es .lang-option[data-lang="es"],
.lang-toggle.is-en .lang-option[data-lang="en"] {
    color: var(--comillas);
}

.lang-toggle.is-es .lang-option[data-lang="es"]:hover,
.lang-toggle.is-en .lang-option[data-lang="en"]:hover {
    color: var(--comillas);
}

/* ==========================================================================
   DARK MODE: shared base (text, cards, callouts, tables, etc.)
   ========================================================================== */
body.all-dark .slide { color: white !important; }
body.all-dark .slide::after { display: none !important; }
body.all-dark .slide h2 { color: white !important; }
body.all-dark .slide .subtitle { color: rgba(255,255,255,0.65) !important; }

body.all-dark .slide .card {
    background: rgba(255,255,255,0.07) !important;
    border-color: rgba(255,255,255,0.1) !important;
    color: white !important;
}
body.all-dark .slide .card h3 { color: white !important; }
body.all-dark .slide .card p,
body.all-dark .slide .card li { color: rgba(255,255,255,0.82) !important; }

body.all-dark .slide .callout {
    background: rgba(255,255,255,0.07) !important;
}
body.all-dark .slide .callout a { color: inherit !important; text-decoration: underline !important; }

body.all-dark .slide .contact-card {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.1) !important;
}
body.all-dark .slide .contact-card p { color: rgba(255,255,255,0.65) !important; }

body.all-dark .slide table { background: rgba(255,255,255,0.05) !important; border-color: rgba(255,255,255,0.1) !important; }
body.all-dark .slide thead { background: rgba(255,255,255,0.08) !important; }
body.all-dark .slide td { color: rgba(255,255,255,0.82) !important; border-color: rgba(255,255,255,0.07) !important; }
body.all-dark .slide tbody tr { border-color: rgba(255,255,255,0.07) !important; }
body.all-dark .slide tbody tr:nth-child(even) { background: rgba(255,255,255,0.03) !important; }

body.all-dark .slide .timeline::before { opacity: 0.5; }
body.all-dark .slide .timeline-item h4 { color: white !important; }
body.all-dark .slide .timeline-item p { color: rgba(255,255,255,0.6) !important; }

body.all-dark .slide .card-icon.blue,
body.all-dark .slide .card-icon.purple,
body.all-dark .slide .card-icon.green,
body.all-dark .slide .card-icon.gold,
body.all-dark .slide .card-icon.red { background: rgba(255,255,255,0.08) !important; }

body.all-dark .slide .chip { background: rgba(255,255,255,0.08) !important; }

body.all-dark .slide .doc-card-link {
    background: rgba(255,255,255,0.07) !important;
    border-color: rgba(255,255,255,0.18) !important;
    color: rgba(255,255,255,0.9) !important;
}
body.all-dark .slide .doc-card-link:hover {
    background: rgba(255,255,255,0.12) !important;
    box-shadow: 0 12px 32px rgba(0,0,0,0.4) !important;
}
body.all-dark .slide .doc-card-icon {
    background: rgba(255,255,255,0.1) !important;
    color: var(--accent) !important;
}
body.all-dark .slide .doc-card-title { color: white !important; }
body.all-dark .slide .doc-card-meta { color: var(--accent) !important; }

/* Steps (pasos numerados) */
.step-list { margin-top: 10px; }
.step-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.step-item:last-child { margin-bottom: 0; }
.step-num {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: var(--comillas);
    color: #fff;
    border-radius: 50%;
    font-weight: 600;
    font-size: 13px;
}
body.all-dark .slide .step-num { background: var(--accent) !important; color: var(--comillas-dark) !important; }

/* Enlaces dentro de .card y en .subtitle (mismo estilo) */
.card a,
.slide .subtitle a {
    color: var(--comillas-light);
    text-decoration: none;
    font-weight: 600;
}
.card a:hover,
.slide .subtitle a:hover { text-decoration: underline; }

/* Modo oscuro: dorado para ambos */
body.all-dark .slide .card a,
body.all-dark .slide .subtitle a { color: var(--accent) !important; }

body.all-dark .slide details.faq { background: rgba(255,255,255,0.05) !important; border-color: rgba(255,255,255,0.1) !important; }
body.all-dark .slide details.faq summary { color: white !important; }
body.all-dark .slide details.faq summary:hover { background: rgba(255,255,255,0.05) !important; }
body.all-dark .slide .faq-body { color: rgba(255,255,255,0.82) !important; }
body.all-dark .slide .faq-category { color: rgba(255,255,255,0.45) !important; border-color: rgba(255,255,255,0.1) !important; }

body.all-dark .slide .code {
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(255,255,255,0.12) !important;
}

body.all-dark .nav-circle.prev { background: rgba(255,255,255,0.1); color: white; }

/* ---- Dark mode: HEADER ---- */
body.all-dark .topbar { background: #0a0f1a; box-shadow: 0 2px 12px rgba(0,0,0,0.4); }

/* ---- Dark mode: per-theme backgrounds + accent colors ---- */

/* Blue dark */
body.all-dark .slide[data-theme="blue"] {
    background: linear-gradient(165deg, #0a1a33 0%, #0f2847 100%) !important;
}
body.all-dark .slide[data-theme="blue"] .slide-eyebrow { color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="blue"] .slide-eyebrow .num { background: #5b9cf5 !important; color: #0a1a33 !important; }
body.all-dark .slide[data-theme="blue"] .callout { border-color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="blue"] .callout strong { color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="blue"] .contact-card h4 { color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="blue"] .contact-card a { color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="blue"] .card-icon.blue { color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="blue"] .card-icon.purple { color: #a78bfa !important; }
body.all-dark .slide[data-theme="blue"] .card-icon.green { color: #4ade80 !important; }
body.all-dark .slide[data-theme="blue"] th { color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="blue"] details.faq[open] { border-color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="blue"] details.faq summary::before { color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="blue"] .code { color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="blue"] .chip { color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="blue"] .timeline-dot { background: #0a1a33 !important; }

/* Green dark */
body.all-dark .slide[data-theme="green"] {
    background: linear-gradient(165deg, #0a1f12 0%, #0f2e1a 100%) !important;
}
body.all-dark .slide[data-theme="green"] .slide-eyebrow { color: #4ade80 !important; }
body.all-dark .slide[data-theme="green"] .slide-eyebrow .num { background: #4ade80 !important; color: #0a1f12 !important; }
body.all-dark .slide[data-theme="green"] .callout { border-color: #4ade80 !important; }
body.all-dark .slide[data-theme="green"] .callout strong { color: #4ade80 !important; }
body.all-dark .slide[data-theme="green"] .contact-card h4 { color: #4ade80 !important; }
body.all-dark .slide[data-theme="green"] .contact-card a { color: #4ade80 !important; }
body.all-dark .slide[data-theme="green"] .card-icon.blue { color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="green"] .card-icon.purple { color: #a78bfa !important; }
body.all-dark .slide[data-theme="green"] .card-icon.green { color: #4ade80 !important; }
body.all-dark .slide[data-theme="green"] th { color: #4ade80 !important; }
body.all-dark .slide[data-theme="green"] .code { color: #4ade80 !important; }
body.all-dark .slide[data-theme="green"] .chip { color: #4ade80 !important; }

/* White dark → neutral dark grey */
body.all-dark .slide[data-theme="white"] {
    background: linear-gradient(165deg, #111827 0%, #1a2236 100%) !important;
}
body.all-dark .slide[data-theme="white"] .slide-eyebrow { color: #94a3b8 !important; }
body.all-dark .slide[data-theme="white"] .slide-eyebrow .num { background: #475569 !important; color: white !important; }
body.all-dark .slide[data-theme="white"] .callout { border-color: #475569 !important; }
body.all-dark .slide[data-theme="white"] .callout strong { color: #e2e8f0 !important; }
body.all-dark .slide[data-theme="white"] .contact-card h4 { color: #e2e8f0 !important; }
body.all-dark .slide[data-theme="white"] .contact-card a { color: #94a3b8 !important; }
body.all-dark .slide[data-theme="white"] .card-icon.blue { color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="white"] .card-icon.purple { color: #a78bfa !important; }
body.all-dark .slide[data-theme="white"] .card-icon.green { color: #4ade80 !important; }
body.all-dark .slide[data-theme="white"] th { color: #e2e8f0 !important; }
body.all-dark .slide[data-theme="white"] details.faq[open] { border-color: #475569 !important; }
body.all-dark .slide[data-theme="white"] details.faq summary::before { color: #94a3b8 !important; }
body.all-dark .slide[data-theme="white"] .code { color: #e2e8f0 !important; }
body.all-dark .slide[data-theme="white"] .chip { color: #94a3b8 !important; }

/* Purple dark */
body.all-dark .slide[data-theme="purple"] {
    background: linear-gradient(165deg, #150a2e 0%, #1e1145 100%) !important;
}
body.all-dark .slide[data-theme="purple"] .slide-eyebrow { color: #a78bfa !important; }
body.all-dark .slide[data-theme="purple"] .slide-eyebrow .num { background: #a78bfa !important; color: #150a2e !important; }
body.all-dark .slide[data-theme="purple"] .callout { border-color: #a78bfa !important; }
body.all-dark .slide[data-theme="purple"] .callout strong { color: #a78bfa !important; }
body.all-dark .slide[data-theme="purple"] .contact-card h4 { color: #a78bfa !important; }
body.all-dark .slide[data-theme="purple"] .contact-card a { color: #a78bfa !important; }
body.all-dark .slide[data-theme="purple"] .card-icon.blue { color: #5b9cf5 !important; }
body.all-dark .slide[data-theme="purple"] .card-icon.purple { color: #a78bfa !important; }
body.all-dark .slide[data-theme="purple"] .card-icon.green { color: #4ade80 !important; }
body.all-dark .slide[data-theme="purple"] th { color: #a78bfa !important; }
body.all-dark .slide[data-theme="purple"] .code { color: #a78bfa !important; }
body.all-dark .slide[data-theme="purple"] .chip { color: #a78bfa !important; }
body.all-dark .slide[data-theme="purple"] .timeline-dot { background: #150a2e !important; }

/* Warm dark: warm slides become the dark theme when toggle is active */
body.all-dark .slide[data-theme="warm"] {
    background: linear-gradient(135deg, var(--comillas-dark) 0%, #0a3060 100%) !important;
    color: white !important;
}
body.all-dark .slide[data-theme="warm"] h2 { color: white !important; }
body.all-dark .slide[data-theme="warm"] .subtitle { color: rgba(255,255,255,0.7) !important; }
body.all-dark .slide[data-theme="warm"] .slide-eyebrow { color: var(--accent) !important; }
body.all-dark .slide[data-theme="warm"] .slide-eyebrow .num { background: var(--accent) !important; color: var(--comillas-dark) !important; }
body.all-dark .slide[data-theme="warm"] .card {
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(255,255,255,0.12) !important;
    color: white !important;
}
body.all-dark .slide[data-theme="warm"] .card h3 { color: white !important; }
body.all-dark .slide[data-theme="warm"] .card p,
body.all-dark .slide[data-theme="warm"] .card li { color: rgba(255,255,255,0.85) !important; }
body.all-dark .slide[data-theme="warm"] .callout { background: rgba(255,255,255,0.08) !important; border-color: var(--accent) !important; }
body.all-dark .slide[data-theme="warm"] .callout strong { color: var(--accent) !important; }
body.all-dark .slide[data-theme="warm"] .callout a { color: var(--accent) !important; }
body.all-dark .slide[data-theme="warm"] .contact-card {
    background: rgba(255,255,255,0.06) !important;
    border-color: rgba(255,255,255,0.12) !important;
}
body.all-dark .slide[data-theme="warm"] .contact-card h4 { color: var(--accent) !important; }
body.all-dark .slide[data-theme="warm"] .contact-card p { color: rgba(255,255,255,0.7) !important; }
body.all-dark .slide[data-theme="warm"] .contact-card a { color: var(--accent) !important; }
body.all-dark .slide[data-theme="warm"] table { background: rgba(255,255,255,0.06) !important; border-color: rgba(255,255,255,0.12) !important; }
body.all-dark .slide[data-theme="warm"] thead { background: rgba(255,255,255,0.1) !important; color: white !important; }
body.all-dark .slide[data-theme="warm"] th { color: var(--accent) !important; }
body.all-dark .slide[data-theme="warm"] td { color: rgba(255,255,255,0.85) !important; border-color: rgba(255,255,255,0.08) !important; }
body.all-dark .slide[data-theme="warm"] tbody tr { border-color: rgba(255,255,255,0.08) !important; }
body.all-dark .slide[data-theme="warm"] tbody tr:nth-child(even) { background: rgba(255,255,255,0.04) !important; }
body.all-dark .slide[data-theme="warm"] .timeline::before { opacity: 0.6; }
body.all-dark .slide[data-theme="warm"] .timeline-item h4 { color: white !important; }
body.all-dark .slide[data-theme="warm"] .timeline-item p { color: rgba(255,255,255,0.6) !important; }
body.all-dark .slide[data-theme="warm"] .timeline-dot { background: var(--comillas-dark) !important; }
body.all-dark .slide[data-theme="warm"] .card-icon.blue,
body.all-dark .slide[data-theme="warm"] .card-icon.purple,
body.all-dark .slide[data-theme="warm"] .card-icon.green,
body.all-dark .slide[data-theme="warm"] .card-icon.gold,
body.all-dark .slide[data-theme="warm"] .card-icon.red { background: rgba(255,255,255,0.1) !important; color: var(--accent) !important; }
body.all-dark .slide[data-theme="warm"] .code { background: rgba(255,255,255,0.1) !important; border-color: rgba(255,255,255,0.15) !important; color: var(--accent) !important; }
body.all-dark .slide[data-theme="warm"] .cierre-titulo { color: white !important; }
body.all-dark .slide[data-theme="warm"] .cierre-sub { color: rgba(255,255,255,0.6) !important; }
body.all-dark .slide[data-theme="warm"] .cierre-titulo + p a,
body.all-dark .slide[data-theme="warm"] .cierre-sub + p a { color: var(--accent) !important; }

/* Hero dark: restore original dark hero */
body.all-dark .hero-slide {
    background: linear-gradient(135deg, var(--comillas-dark) 0%, var(--comillas-light) 55%, var(--purple) 130%) !important;
    color: white !important;
}
body.all-dark .hero-slide::before {
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08) 0, transparent 50%),
        radial-gradient(circle at 80% 75%, rgba(139,92,246,0.12) 0, transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(245,159,0,0.08) 0, transparent 30%) !important;
}
body.all-dark .hero-slide h1 { color: white !important; }
body.all-dark .hero-slide .lead { color: rgba(255,255,255,0.92) !important; }
body.all-dark .hero-slide .hero-point { color: white !important; }
body.all-dark .hero-slide .hero-point-icon { background: rgba(255,255,255,0.15) !important; color: white !important; }
body.all-dark .hero-slide .btn-start { background: var(--accent) !important; color: var(--comillas-dark) !important; box-shadow: 0 4px 16px rgba(245,159,0,0.3) !important; }


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
/* Se activa tanto en pantallas estrechas (móvil vertical) como en pantallas
   bajas y no demasiado anchas (móvil horizontal). */
@media (max-width: 768px), (max-height: 600px) and (max-width: 950px) {
    /* ---- Topbar: liberar espacio ---- */
    .topbar { padding: 0 14px; }
    .topbar-logo span { display: none; }   /* dejamos solo el logo */
    .topbar-logo-img { height: 28px; }
    .topbar-dots { display: none; }         /* navegación por flechas/swipe */
    .topbar-progress { gap: 10px; }
    .progress-bar-bg { width: 64px; }
    #slide-counter { font-size: 12px; white-space: nowrap; }

    /* ---- Slides ---- */
    .slide { padding: 24px 18px 84px; }   /* hueco inferior para las flechas fijas */
    .slide-inner { max-width: 100%; }
    .slide .subtitle { font-size: 15px; margin-bottom: 20px; }

    /* En móvil el contenido es más alto: si se centra verticalmente, la parte
       superior (título + número) se recorta y no se puede hacer scroll hasta ella.
       Alineamos arriba para que todo el contenido sea accesible. */
    .slide.v-center,
    .hero-slide { align-items: flex-start; }
    /* El hero tiene overflow:hidden (recorta los blobs de fondo); en móvil hay
       que permitir el scroll vertical para que no se corte por abajo. */
    .hero-slide { padding-top: 40px; padding-bottom: 90px; overflow-x: hidden; overflow-y: auto; }

    /* ---- Grids a una columna ---- */
    .cards { gap: 12px; margin: 16px 0; }
    .cards.cols-2,
    .cards.cols-3,
    .cards.cols-4 { grid-template-columns: 1fr; }
    .hero-points { grid-template-columns: 1fr; gap: 10px; }
    .card { padding: 18px; }

    /* ---- Flechas de navegación: abajo, fuera del texto ---- */
    .nav-circle {
        width: 46px; height: 46px;
        top: auto;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        transform: none;
        box-shadow: 0 4px 14px rgba(0,0,0,0.22);
        z-index: 120;
    }
    .nav-circle.prev { left: 14px; }
    .nav-circle.next { right: 14px; }
    .nav-circle:hover { transform: none; }
    .nav-circle svg { width: 18px; height: 18px; }

    /* ---- Blobs decorativos más pequeños ---- */
    .slide[data-theme="blue"]::after,
    .slide[data-theme="purple"]::after,
    .slide[data-theme="green"]::after { width: 220px; height: 220px; }
}

@media (max-width: 480px) {
    .slide { padding: 20px 14px; }
    .progress-bar-bg { display: none; }     /* muy estrecho: solo contador */
    .hero-slide h1 { font-size: 30px; }
    .hero-slide .lead { font-size: 16px; margin-bottom: 26px; }
    .btn-start { padding: 12px 28px; font-size: 15px; }
    .card h3 { font-size: 16.5px; }
    .doc-card-link { padding: 14px 16px; gap: 12px; }
    th, td { padding: 8px 10px; }
}
