/* ============================================================
   TOKENS
   ============================================================ */
:root {
    --dni-primary: #0f4fa8;
    --dni-dark:    #0c3d83;
    --dni-light:   #eef4ff;
    --dni-border:  #c5d8f8;

    --nie-primary: #c62828;
    --nie-dark:    #8e0000;
    --nie-light:   #ffebee;
    --nie-border:  #f5c2c2;

    --bg:     #f5f7fb;
    --white:  #ffffff;
    --text:   #1e2d3d;
    --muted:  #637080;
    --border: #dfe5ee;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    /* evita scroll horizontal en móvil */
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

.container {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 0 16px;
}

/* ============================================================
   HEADER — mobile-first con hamburger
   ============================================================ */
.header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    gap: 12px;
}

/* Logo */
.logo {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-es  { color: var(--dni-primary); }
.logo-sep { color: var(--muted); font-weight: 300; }
.logo-ex  { color: var(--nie-primary); }
.logo-sub {
    font-size: .65rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: .04em;
    margin-left: 4px;
    align-self: center;
}

/* Botón hamburger */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    flex-shrink: 0;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all .3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Menú — oculto en móvil */
.nav-menu {
    display: none;
    flex-direction: column;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 12px 16px 20px;
}
.nav-menu.is-open { display: flex; }

.menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.menu li { border-bottom: 1px solid var(--border); }
.menu li:last-child { border-bottom: none; }
.menu a {
    display: block;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: 1rem;
    padding: 12px 4px;
    transition: color .2s;
}
.menu a:hover { color: var(--dni-primary); }

/* ============================================================
   HERO SPLIT — apilado en móvil
   ============================================================ */
.hero-split {
    display: flex;
    flex-direction: column;
}

.hero-half {
    display: flex;
    align-items: center;
    padding: 48px 0;
}

.hero-half-inner {
    width: 100%;
    padding: 0 20px;
}

.hero-dni {
    background: linear-gradient(135deg, var(--dni-dark) 0%, var(--dni-primary) 100%);
    color: #fff;
}
.hero-nie {
    background: linear-gradient(135deg, var(--nie-dark) 0%, var(--nie-primary) 100%);
    color: #fff;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.hero-half h1 {
    font-size: 3.8rem;
    font-weight: 900;
    letter-spacing: -.02em;
    line-height: 1;
    margin-bottom: 14px;
    color: rgba(255,255,255,.95);
}

.hero-half p {
    font-size: .95rem;
    color: rgba(255,255,255,.85);
    margin-bottom: 24px;
}

.hero-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
    display: inline-block;
    text-decoration: none;
    padding: 13px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: .9rem;
    transition: all .25s;
    text-align: center;
    /* zona táctil mínima recomendada */
    min-height: 44px;
    line-height: 1.3;
}

.btn-white {
    background: #fff;
    color: var(--text);
}
.btn-outline-white {
    background: transparent;
    border: 2px solid rgba(255,255,255,.6);
    color: #fff;
}
.btn-dni-outline {
    display: inline-block;
    background: transparent;
    border: 2px solid var(--dni-primary);
    color: var(--dni-primary);
    font-size: .875rem;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    min-height: 44px;
}
.btn-nie-outline {
    display: inline-block;
    background: transparent;
    border: 2px solid var(--nie-primary);
    color: var(--nie-primary);
    font-size: .875rem;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    min-height: 44px;
}
.btn-compare-more {
    display: inline-block;
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
    font-size: .875rem;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    min-height: 44px;
}

/* ============================================================
   INTRO
   ============================================================ */
.intro {
    background: var(--white);
    padding: 44px 0;
    border-bottom: 1px solid var(--border);
}

.intro-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.intro-text h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: var(--text);
}
.intro-text p { color: var(--muted); margin-bottom: 10px; font-size: .95rem; }

.intro-stats {
    display: flex;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
}

.stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 8px;
    border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }

.stat-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}
.stat-label {
    font-size: .68rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    text-align: center;
}

/* ============================================================
   DOCUMENT SECTIONS
   ============================================================ */
.doc-section { padding: 44px 0; }
.section-dni { background: var(--bg); }
.section-nie { background: var(--white); }

.section-header { margin-bottom: 8px; }
.section-header h2 { font-size: 1.4rem; margin: 10px 0 8px; line-height: 1.3; }

.section-desc { color: var(--muted); margin-bottom: 0; font-size: .9rem; }

.section-link-all {
    color: var(--dni-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: .875rem;
    display: inline-block;
    margin-top: 4px;
}
.section-link-all:hover { text-decoration: underline; }
.section-nie .section-link-all { color: var(--nie-primary); }

/* Tags */
.section-tag, .faq-tag, .compare-tag {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
}
.tag-dni {
    background: var(--dni-light);
    color: var(--dni-primary);
    border: 1px solid var(--dni-border);
}
.tag-nie {
    background: var(--nie-light);
    color: var(--nie-primary);
    border: 1px solid var(--nie-border);
}

/* ============================================================
   CARDS
   ============================================================ */
.cards-grid {
    display: grid;
    /* en móvil: 1 columna; auto-fit amplía en pantallas mayores */
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 24px;
}

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 18px 16px;
    border: 1px solid var(--border);
    transition: transform .25s, box-shadow .25s;
    /* zona táctil cómoda */
    -webkit-tap-highlight-color: transparent;
}
/* sin hover-lift en touch para no "pegarse" */
@media (hover: hover) {
    .card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0,0,0,.08);
    }
}

.card-icon { font-size: 1.4rem; margin-bottom: 8px; }
.card h3   { font-size: .95rem; margin-bottom: 6px; }
.card p    { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }

.card-btn {
    display: inline-block;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    min-height: 36px;
    line-height: 36px;
}
.card-dni .card-btn { color: var(--dni-primary); }
.card-nie .card-btn { color: var(--nie-primary); }
.card-btn:hover { text-decoration: underline; }

.card-dni { border-top: 3px solid var(--dni-primary); }
.card-nie { border-top: 3px solid var(--nie-primary); }

.card-hub { border-style: dashed; background: var(--bg); }

/* ============================================================
   ADS
   ============================================================ */
.ad-container { margin: 8px auto; }
.ad-placeholder {
    background: var(--white);
    border: 2px dashed var(--border);
    border-radius: 10px;
    text-align: center;
    padding: 22px 16px;
    color: var(--muted);
    font-size: .85rem;
}

/* ============================================================
   COMPARE SECTION
   ============================================================ */
.compare-section {
    padding: 44px 0;
    background: linear-gradient(180deg, #f0f4ff 0%, #fff0f0 100%);
}

.compare-title {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 28px;
    line-height: 1.3;
}

.compare-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.compare-divider { display: none; }

.compare-box {
    background: var(--white);
    border-radius: 14px;
    padding: 24px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.compare-box h3  { font-size: 1rem; margin: 10px 0 14px; }
.compare-box ul  { list-style: none; margin-bottom: 20px; }
.compare-box li  {
    padding: 7px 0;
    font-size: .875rem;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}
.compare-box li:last-child { border-bottom: none; }

.compare-box-dni { border-top: 4px solid var(--dni-primary); }
.compare-box-nie { border-top: 4px solid var(--nie-primary); }

.compare-extra-link { text-align: center; margin-top: 24px; }

/* ============================================================
   FAQ
   ============================================================ */
.faq-section {
    padding: 44px 0;
    background: var(--bg);
}
.faq-section h2 { font-size: 1.4rem; margin-bottom: 24px; }

.faq-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.faq-item {
    background: var(--white);
    border-radius: 12px;
    padding: 18px 16px;
    border: 1px solid var(--border);
}
.faq-tag   { margin-bottom: 10px; }
.faq-item h3 { font-size: .9rem; margin-bottom: 6px; }
.faq-item p  { font-size: .85rem; color: var(--muted); margin: 0; }

/* ============================================================
   EEAT
   ============================================================ */
.eeat-section {
    padding: 44px 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.eeat-inner {
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.eeat-text h2 { font-size: 1.3rem; margin-bottom: 12px; }
.eeat-text p  { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }

.eeat-links h3 { font-size: .95rem; margin-bottom: 12px; }
.eeat-links ul { list-style: none; }
.eeat-links li { margin-bottom: 8px; }
.eeat-links a  {
    color: var(--dni-primary);
    text-decoration: none;
    font-size: .875rem;
    display: inline-block;
    min-height: 36px;
    line-height: 36px;
}
.eeat-links a:hover { text-decoration: underline; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: #111c2b;
    color: #aab4c2;
    padding: 44px 0 24px;
}

.footer-cols {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-logo {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-weight: 800;
    font-size: 1.3rem;
    margin-bottom: 12px;
    text-decoration: none;
}
.footer-logo .logo-es  { color: #5b9cf6; }
.footer-logo .logo-sep { color: #4a5568; }
.footer-logo .logo-ex  { color: #fc8181; }

.footer-desc { font-size: .85rem; line-height: 1.6; }

.footer-col h4 {
    color: #fff;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 14px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 6px; }
.footer-col a  {
    color: #7a8fa8;
    text-decoration: none;
    font-size: .85rem;
    display: inline-block;
    min-height: 32px;
    line-height: 32px;
    transition: color .2s;
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
    border-top: 1px solid #1e2d3d;
    padding-top: 20px;
    font-size: .78rem;
    color: #4a5568;
}

/* ============================================================
   TABLET — 600px+
   ============================================================ */
@media (min-width: 600px) {

    .container { padding: 0 24px; }

    /* Header: menú siempre visible, inline */
    .nav-toggle { display: none; }
    .nav-menu {
        display: flex !important;
        flex-direction: row;
        border-top: none;
        padding: 0;
        background: transparent;
    }
    .menu {
        flex-direction: row;
        gap: 18px;
    }
    .menu li { border-bottom: none; }
    .menu a  { padding: 6px 0; font-size: .875rem; }

    /* Hero botones en fila */
    .hero-btns { flex-direction: row; }

    /* Cards: 2 columnas */
    .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }

    /* FAQ: 2 columnas */
    .faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); }

    /* Footer 2 cols */
    .footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* ============================================================
   DESKTOP — 900px+
   ============================================================ */
@media (min-width: 900px) {

    .container { padding: 0 32px; }

    /* Hero lado a lado */
    .hero-split { flex-direction: row; min-height: 420px; }
    .hero-half  { flex: 1; padding: 70px 0; }
    .hero-half-inner { max-width: 480px; padding: 0 48px; }
    .hero-half h1 { font-size: clamp(3.5rem, 5vw, 5.5rem); }

    /* Intro grid */
    .intro { padding: 60px 0; }
    .intro-grid {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 50px;
        align-items: center;
    }
    .intro-stats {
        border: none;
        border-radius: 0;
        overflow: visible;
        flex-direction: row;
        gap: 32px;
    }
    .stat {
        border-right: none;
        padding: 0;
    }
    .stat-num { font-size: 2rem; }

    /* Sections */
    .doc-section { padding: 70px 0; }
    .section-header h2 { font-size: 1.8rem; }

    /* Cards 3 columnas */
    .cards-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }

    /* Compare lado a lado */
    .compare-section { padding: 70px 0; }
    .compare-title   { font-size: 1.8rem; margin-bottom: 44px; }
    .compare-grid {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        gap: 24px;
        align-items: center;
    }
    .compare-divider {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .compare-divider span {
        background: var(--white);
        border: 2px solid var(--border);
        border-radius: 50%;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: .85rem;
        color: var(--muted);
        box-shadow: 0 2px 8px rgba(0,0,0,.06);
    }

    /* FAQ 3 columnas */
    .faq-section { padding: 70px 0; }
    .faq-section h2 { font-size: 1.8rem; margin-bottom: 36px; }
    .faq-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }

    /* EEAT */
    .eeat-section { padding: 60px 0; }
    .eeat-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 60px;
        align-items: start;
    }

    /* Footer 3 cols */
    .footer { padding: 56px 0 28px; }
    .footer-cols { grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }

    /* Hover effects only on real pointer */
    .btn-white:hover       { opacity: .92; transform: translateY(-2px); }
    .btn-outline-white:hover { background: rgba(255,255,255,.12); transform: translateY(-2px); }
    .btn-dni-outline:hover { background: var(--dni-light); }
    .btn-nie-outline:hover { background: var(--nie-light); }
    .btn-compare-more:hover { background: var(--white); border-color: var(--text); }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}