/* ═══════════════════════════════════════════════════════════════
   SAIYAN AUTH PAGES — auth-pages.css
   Login y registro. Extiende public-site.css (variables --l-*).
   Tema: mismo sistema que el index público (data-public-theme="dark").
   ═══════════════════════════════════════════════════════════════ */

/* Toggle de tema al borde derecho del menú (solo icono, ver public-site.css) */
body.is-auth-page .l-topnav-inner .auth-topnav-theme {
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Cuerpo de la página ── */
body.is-auth-page {
    background: var(--l-bg);
    min-height: 100dvh;
    overflow-x: hidden;  /* evita scroll horizontal en cualquier caso */
}

/* ── Contenedor principal del formulario ──
   Nav fija: solo un poco de aire bajo la barra; sin centrar en vertical (evita el “hueco”
   de pantallas altas). */
main.auth-public-v2 {
    min-height: calc(100dvh - var(--l-nav-h));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: calc(var(--l-nav-h) + 1.1rem) 1.25rem 2.5rem;
    background: var(--l-bg);
    box-sizing: border-box;
}

.auth-v2-inner {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Cabecera del formulario ── */
.auth-v2-title {
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--l-heading);
    text-align: center;
    margin: 0 0 0.45rem;
    line-height: 1.15;
}
.auth-v2-sub {
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 0.95rem;
    color: var(--l-text-muted);
    text-align: center;
    margin: 0 0 1.35rem;
}

/* ── Botón Google ── */
.auth-v2-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.78rem 1rem;
    background: var(--l-surface);
    border: 1.5px solid var(--l-border);
    border-radius: 10px;
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--l-text);
    text-decoration: none;
    transition: background var(--l-t), border-color var(--l-t), box-shadow var(--l-t);
    cursor: pointer;
    margin-bottom: 1.25rem;
}
.auth-v2-social-btn:hover {
    background: var(--l-bg-subtle);
    border-color: rgba(0,0,0,.18);
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
html[data-public-theme="dark"] .auth-v2-social-btn:hover {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.18);
}

/* ── Divisor "O con una cuenta" ── */
.auth-v2-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    color: var(--l-text-dim);
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.auth-v2-divider::before,
.auth-v2-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--l-border);
}

/* ── Mensajes ── */
.auth-v2-msg {
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 0.87rem;
    margin-bottom: 1rem;
}
.auth-v2-msg--ok {
    background: rgba(22,163,74,.1);
    color: var(--l-green);
    border: 1px solid rgba(22,163,74,.25);
}
.auth-v2-msg--err {
    background: rgba(220,38,38,.08);
    color: var(--l-red);
    border: 1px solid rgba(220,38,38,.2);
}

/* ── Formulario: campo+label sin tarjeta ── */
.auth-v2-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.auth-v2-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
}
.auth-v2-label {
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--l-text-muted);
    letter-spacing: 0.01em;
}
.auth-v2-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.72rem 0.9rem;
    background: var(--l-surface);
    border: 1.5px solid var(--l-border);
    border-radius: 10px;
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 0.97rem;
    color: var(--l-text);
    outline: none;
    transition: border-color var(--l-t), box-shadow var(--l-t), background var(--l-t);
    -webkit-appearance: none;
}
.auth-v2-input::placeholder {
    color: var(--l-text-dim);
}
.auth-v2-input:focus {
    border-color: var(--l-accent);
    box-shadow: 0 0 0 3px var(--l-accent-glow);
}

/* ── Botón principal ── */
.auth-v2-submit {
    width: 100%;
    padding: 0.82rem 1rem;
    background: var(--l-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: background var(--l-t), transform 80ms, box-shadow var(--l-t);
}
.auth-v2-submit:hover {
    background: var(--l-accent-light);
    box-shadow: 0 4px 18px rgba(234,88,12,.35);
}
.auth-v2-submit:active {
    transform: scale(.985);
}

.auth-v2-forgot-wrap {
    margin: 0.35rem 0 0;
    text-align: center;
}

.auth-v2-forgot-link {
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--l-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-v2-forgot-link:hover {
    color: var(--l-accent-light);
}

/* ── Pie del formulario ── */
.auth-v2-legal-notice {
    margin: 1.25rem 0 0;
    text-align: center;
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--l-text-muted);
}

.auth-v2-legal-link {
    color: var(--l-accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-v2-legal-link:hover {
    color: var(--l-accent-light);
}

.auth-v2-foot {
    margin-top: 1.6rem;
    text-align: center;
    font-family: 'Inter', 'DM Sans', sans-serif;
    font-size: 0.875rem;
    color: var(--l-text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.auth-v2-foot a {
    color: var(--l-accent);
    text-decoration: none;
    font-weight: 600;
}
.auth-v2-foot a:hover {
    text-decoration: underline;
}
.auth-v2-home-link {
    color: var(--l-text-dim) !important;
    font-weight: 400 !important;
    font-size: 0.82rem;
}

/* ── Dark mode: superficie y campos ── */
html[data-public-theme="dark"] .auth-v2-input {
    background: rgba(255,255,255,.06);
}
html[data-public-theme="dark"] .auth-v2-social-btn {
    background: rgba(255,255,255,.06);
}

/* ── Responsive ── */
@media (max-width: 480px) {
    main.auth-public-v2 {
        padding-top: calc(var(--l-nav-h) + 0.85rem);
        padding-bottom: 2rem;
    }
    .auth-v2-title {
        font-size: 1.7rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   AUTH SPLIT LAYOUT — desktop two-column (publi left / form right)
   ═══════════════════════════════════════════════════════════════ */

/* El aside solo existe si PHP genera imágenes */
.auth-split-wrap {
    display: none;
}

/*
 * LAYOUT DESKTOP — solo cuando existe el carrusel (:has con soporte universal ≥2023).
 *
 * Diseño:
 *   - main: altura exacta del viewport disponible (bajo la nav fija).
 *   - aside: ocupa el espacio sobrante; capped a 60 vw para que en pantallas muy anchas
 *     la imagen no se coma el 80% del viewport.
 *   - form: ancho proporcional con clamp(); puede encoger (flex-shrink) para evitar overflow-x.
 *     Con overflow-y:auto gestiona formularios largos sin romper el layout.
 *   - Si NO hay carrusel, el main sigue el flujo normal (columna centrada móvil).
 */
@media (min-width: 900px) {
    /*
     * 1920×1080 ejemplo: nav 72px → panel alto ≈ 1008px. Form max 520px.
     * Columna imagen sin cap: 1400px → ratio ≈ 1.39 → arte ideal ~1400×1008 (o 2800×2016).
     * Con cap aside max 60vw: 1152×1008 → ratio ≈ 1.143 → arte ideal ~1152×1008.
     */
    main.auth-public-v2:has(.auth-split-wrap) {
        flex-direction: row;
        align-items: stretch;
        justify-content: flex-start;
        padding: 0;
        margin-top: var(--l-nav-h);
        height: calc(100dvh - var(--l-nav-h));
        min-height: 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        gap: 0;
        box-sizing: border-box;
    }

    .auth-split-wrap {
        display: flex;
        flex: 1 1 0;
        min-width: 0;
        max-width: 60vw;
        height: 100%;
        position: relative;
        overflow: hidden;
        /* Mismo tono que la página clara; si cover deja 1px, no se nota */
        background: #fafafa;
        box-sizing: border-box;
    }

    html[data-public-theme="dark"] .auth-split-wrap {
        background: #08080d;
    }

    main.auth-public-v2:has(.auth-split-wrap) .auth-v2-inner {
        /* flex-shrink 1: en viewports ~900px evita 420+540 > 900 y scroll horizontal */
        flex: 0 1 clamp(380px, 38vw, 520px);
        width: clamp(380px, 38vw, 520px);
        min-width: 0;
        height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        padding: 2.75rem clamp(2rem, 4vw, 3.5rem);
        box-sizing: border-box;
        border-left: 1px solid var(--l-border);
        background: var(--l-bg);
        max-width: none;
    }
}

/* ── Carrusel: estructura interna ── */
.auth-publi-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.auth-publi-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.75s cubic-bezier(.4,0,.2,1);
}

.auth-publi-slide {
    flex: 0 0 100%;
    height: 100%;
    overflow: hidden;
    background: #fafafa;
}

html[data-public-theme="dark"] .auth-publi-slide {
    background: #08080d;
}

.auth-publi-slide img {
    width: 100%;
    height: 100%;
    /* Rellena el panel sin bandas (arte landscape tipo 1200×800 o 16:10). Portrait: recorta lados. */
    object-fit: cover;
    object-position: center center;
    display: block;
    pointer-events: none;
    user-select: none;
}

/* ── Dots indicadores ── */
.auth-publi-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.45rem;
    z-index: 10;
}

.auth-publi-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.35);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background .3s, transform .3s;
}

.auth-publi-dot.is-active {
    background: rgba(255,255,255,.9);
    transform: scale(1.4);
}

/* ── Controles prev/next ── */
.auth-publi-prev,
.auth-publi-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.auth-publi-prev { left: 1rem; }
.auth-publi-next { right: 1rem; }
.auth-publi-prev:hover,
.auth-publi-next:hover {
    background: rgba(255,255,255,.22);
    border-color: rgba(255,255,255,.35);
}

/* Ocultar controles/dots cuando solo hay 1 imagen */
.auth-publi-carousel[data-slides="1"] .auth-publi-prev,
.auth-publi-carousel[data-slides="1"] .auth-publi-next,
.auth-publi-carousel[data-slides="1"] .auth-publi-dots {
    display: none;
}
