/* ===================================================================
   LeanPDM — base.css
   CSS compartido por todas las páginas del sitio (one-page separada).
   Solo va aquí lo común: reset, tokens, layout de sección, tipografía,
   botones, nav, menú móvil, footer, sistema de idioma, acordeón FAQ y
   modal PDM. El CSS específico de cada sección vive en su propia página.
   =================================================================== */

/* ─── RESET ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

/* ─── TOKENS ─── */
:root {
    --bg: #F0F4F8;
    --bg2: #FFFFFF;
    --bg3: #E8EFF5;
    --border: #D8E0E8;
    --accent: #1E5FA3;
    --accent2: #2B74BE;
    --text: #1A2B3C;
    --muted: #5A6A7A;
    --danger: #1E5FA3;
    --ok: #3A7D44;
    --nav-h: 64px;
    --fh: 'Inter', sans-serif;
    --fb: 'Inter', sans-serif;
    --fm: 'Inter', sans-serif;
}

/* ─── BASE ─── */
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-h);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--fb);
    font-size: 16px;
    line-height: 1.65;
    padding-top: var(--nav-h)
}

/* ─── NOISE ─── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 998;
    opacity: 0.5
}

/* ─── PAGE FADE-IN ─── */
@keyframes appear {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

#content {
    animation: appear 0.4s ease both
}

/* ─── SECTION LAYOUT ─── */
.page {
    display: block;
    max-width: 1100px;
    margin-inline: auto;
    padding: 72px 64px;
    scroll-margin-top: var(--nav-h)
}

.page+.page {
    border-top: 1px solid var(--border)
}

/* ─── STANDARD PAGE HEADER ─── */
.page-header {
    text-align: center;
    margin-bottom: 32px
}

.page-header .sec-label {
    display: block;
    margin-bottom: 6px
}

.page-header h2 {
    margin-bottom: 10px
}

.page-header .sec-desc {
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 0;
    text-align: center;
    max-width: 600px
}

/* ─── TYPOGRAPHY ─── */
h1 {
    font-family: var(--fh);
    font-size: clamp(36px, 4.5vw, 64px);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: 16px
}

h1 em {
    font-style: normal;
    color: var(--accent)
}

h2 {
    font-family: var(--fh);
    font-size: clamp(26px, 3.2vw, 44px);
    font-weight: 400;
    line-height: 1.0;
    letter-spacing: -0.01em;
    margin-bottom: 14px
}

.sec-label {
    font-family: var(--fm);
    font-size: 12px;
    color: var(--accent);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 8px;
    white-space: nowrap
}

.sec-desc {
    font-size: 14px;
    color: var(--muted);
    max-width: 520px;
    line-height: 1.7;
    font-weight: 300;
    margin-bottom: 16px
}

/* ─── BUTTONS ─── */
.btn-primary {
    background: var(--accent);
    color: #fff;
    font-family: var(--fh);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 14px 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s, transform 0.1s
}

.btn-primary:hover {
    background: var(--accent2);
    transform: translateY(-1px)
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    font-family: var(--fh);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 14px 28px;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: border-color 0.2s, color 0.2s
}

.btn-secondary:hover {
    border-color: var(--text);
    color: var(--text)
}

/* ─── TOP NAV ─── */
#sidenav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 0 32px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border)
}

.nav-logo {
    font-family: var(--fh);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0
}

.nav-logo svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0
}

.nav-links {
    list-style: none;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.2s;
    padding: 8px 12px;
    display: block;
    white-space: nowrap
}

.nav-links a:hover {
    color: var(--text)
}

.nav-links a.active {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--accent)
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0
}

.nav-links a.nav-cta {
    font-family: var(--fh);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: var(--accent);
    padding: 8px 18px;
    margin-left: 6px;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s
}

.nav-links a.nav-cta:hover {
    color: #fff;
    background: var(--accent2)
}

.lang-toggle {
    display: flex;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: hidden;
    font-family: var(--fm);
    font-size: 12px;
    width: fit-content
}

.lang-toggle button {
    background: none;
    border: none;
    padding: 4px 9px;
    cursor: pointer;
    color: var(--muted);
    font-family: inherit;
    font-size: inherit;
    transition: all 0.2s
}

.lang-toggle button.active {
    background: var(--accent);
    color: #fff
}

/* ─── HAMBURGER + MOBILE MENU ─── */
#hamburger {
    display: none;
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 200;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px 10px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px
}

#hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all 0.25s
}

#mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg2);
    z-index: 150;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 48px 32px;
    gap: 8px
}

#mobile-menu.open {
    display: flex
}

#mobile-menu a {
    color: var(--text);
    text-decoration: none;
    font-family: var(--fh);
    font-size: 24px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 0
}

#mobile-menu a:hover {
    color: var(--accent)
}

#mobile-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--muted)
}

/* ─── FOOTER ─── */
.site-footer {
    text-align: center;
    padding: 32px;
    font-family: var(--fm);
    font-size: 12px;
    color: var(--muted);
    border-top: 1px solid var(--border)
}

/* ─── LANG ─── */
[data-lang] {
    display: none
}

.lang-es [data-lang="es"] {
    display: block
}

.lang-en [data-lang="en"] {
    display: block
}

/* ─── FAQ ACCORDION (usado en «cómo funciona» y «faq») ─── */
.faq-item {
    border-bottom: 1px solid var(--border)
}

.faq-q {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 14px 0;
    font-family: var(--fh);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: color 0.2s
}

.faq-q:hover {
    color: var(--accent)
}

.faq-arrow {
    color: var(--accent);
    font-size: 13px;
    transition: transform 0.25s;
    flex-shrink: 0
}

.faq-item.open .faq-arrow {
    transform: rotate(180deg)
}

.faq-a {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    font-size: 14px;
    color: var(--text);
    line-height: 1.7
}

.faq-item.open .faq-a {
    max-height: 180px;
    padding-bottom: 14px
}

.faq-a strong {
    color: var(--text)
}

/* ─── PDM MODAL ─── */
.btn-pdm-info {
    display: inline-block;
    font-size: 1em;
    font-family: var(--fb);
    color: var(--accent);
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    vertical-align: middle;
    margin-left: 8px;
    line-height: 1.6;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.btn-pdm-info:hover {
    background: var(--accent);
    color: #fff;
}

#pdm-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26, 43, 60, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

#pdm-modal-overlay.open {
    display: flex;
}

.pdm-modal-box {
    position: relative;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 36px 32px 28px;
    max-width: 540px;
    width: calc(100% - 32px);
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(26, 43, 60, 0.18);
}

.pdm-modal-box h3 {
    font-family: var(--fh);
    font-size: 1.25rem;
    color: var(--accent);
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pdm-modal-box p {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.65;
    margin: 0;
}

.pdm-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
}

.pdm-modal-close:hover {
    color: var(--text);
}

/* ─── RESPONSIVE (común: nav + layout de sección) ─── */
@media (max-width: 900px) {

    .nav-links,
    .nav-actions {
        display: none
    }

    #hamburger {
        display: flex
    }

    .page {
        padding: 48px 20px
    }
}
