/* ============================================================
   AUTH INLINE EN EL HERO
   ============================================================ */

/* ==========================================
   LAYOUT: 1 columna por defecto, 2 cuando el auth está abierto
   ========================================== */
.hero-layout {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: "izq";
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: clamp(5rem, 9vh, 7rem) clamp(1rem, 3vw, 2rem) clamp(2rem, 4vh, 3rem);
    box-sizing: border-box;
    transition: grid-template-columns 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-lado-izq {
    grid-area: izq;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-lado-der {
    grid-area: "der";
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.45s ease 0.15s, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.15s;
}

/* Cuando el auth está abierto (solo en el hero) */
.hero-central.auth-abierto .hero-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "izq der";
    gap: 3rem;
    max-width: 1280px;
}

.hero-central.auth-abierto .hero-lado-izq {
    align-items: flex-start;
    text-align: left;
    opacity: 1;
}

.hero-central.auth-abierto .hero-lado-der {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

/* Ocultar los botones originales y el subtítulo en modo auth */
.hero-central.auth-abierto .hero-botones-login {
    opacity: 0;
    visibility: hidden;
    height: 0;
    margin: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.hero-central.auth-abierto .hero-titulo {
    font-size: clamp(2rem, 4vw, 3rem);
    transition: font-size 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-central.auth-abierto .hero-badge {
    transition: font-size 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-central.auth-abierto .hero-subtitulo {
    margin-bottom: 0;
}

/* ==========================================
   PANEL
   ========================================== */
.hero-auth-panel {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-medium);
    padding: 2rem 1.75rem;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.hero-auth-cerrar {
    position: absolute;
    top: 0.2rem;
    right: 1rem;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    z-index: 2;
}

.hero-auth-cerrar:hover {
    color: var(--color-gold);
    background: var(--color-surface-hover);
    border-color: var(--color-border);
}

/* Secciones (una por tab) */
.hero-auth-seccion {
    display: none;
}

.hero-auth-seccion.activo {
    display: block;
    animation: heroAuthFade 0.3s ease-out;
}

@keyframes heroAuthFade {
    from {
        opacity: 0;
        transform: translateX(8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0 1.5rem;
}

.hero-auth-titulo {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 0.35rem;
    line-height: 1.2;
}

.hero-auth-subtitulo {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin: 0;
}

/* Form */
.hero-auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.hero-auth-form .campo-form {
    margin: 0;
    padding-bottom: 1rem;
    position: relative;
}

.hero-auth-form label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.35rem;
}

.hero-auth-form .custom-error-msg {
    position: absolute;
    top: 5.8rem;
    left: 0;
    right: 0;
    z-index: 5;
    margin-top: 2px;
}

.hero-auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

/* Submit */
.hero-auth-submit {
    position: relative;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--color-gold);
    color: #111;
    border: none;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    margin-top: 0.25rem;
}

.hero-auth-submit:hover:not(:disabled) {
    background: var(--color-gold-dark);
}

.hero-auth-submit:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.hero-auth-submit-spinner {
    display: none;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(17, 17, 17, 0.25);
    border-top-color: #111;
    border-radius: 50%;
    animation: heroAuthSpin 0.7s linear infinite;
}

.hero-auth-submit.cargando .hero-auth-submit-texto {
    opacity: 0.6;
}

.hero-auth-submit.cargando .hero-auth-submit-spinner {
    display: inline-block;
}

@keyframes heroAuthSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Links al pie */
.hero-auth-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--color-border);
}

.hero-auth-link {
    background: transparent;
    border: none;
    color: var(--color-text-secondary);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: color 0.2s;
}

.hero-auth-link:hover {
    color: var(--color-gold);
    text-decoration: underline;
}

.hero-auth-link--destacado {
    color: var(--color-gold);
    font-weight: 700;
}

/* ==========================================
   BLOQUEO DE SCROLL
   ========================================== */
body.auth-abierto {
    overflow: hidden;
}

body.auth-abierto .scene-nav {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ==========================================
   MOBILE (<= 991px)
   ========================================== */
@media (max-width: 991px) {
    .hero-central.auth-abierto .hero-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "izq"
            "der";
        gap: 1.5rem;
        padding-top: clamp(4rem, 8vh, 6rem);
    }

    .hero-central.auth-abierto .hero-lado-izq {
        align-items: center;
        text-align: center;
    }

    .hero-central.auth-abierto .hero-titulo {
        font-size: 1.6rem;
    }

    .hero-central.auth-abierto .hero-badge {
        font-size: 1.8rem;
    }

    .hero-central.auth-abierto .hero-subtitulo {
        font-size: 0.85rem;
    }

    .hero-auth-panel {
        max-width: 100%;
        padding: 1.75rem 1.5rem;
    }
}

@media (max-width: 640px) {
    .hero-auth-row {
        grid-template-columns: 1fr;
    }
    .hero-layout {
        padding: clamp(1rem, 3vh, 3rem) clamp(1rem, 3vw, 2rem) clamp(10rem, 4vh, 3rem);
    }

    .hero-auth-titulo {
        font-size: 1.2rem;
    }

    .hero-central.auth-abierto .hero-titulo,
    .hero-central.auth-abierto .hero-badge {
        display: none;
    }

    .hero-central.auth-abierto .hero-subtitulo {
        display: none;
    }

    .hero-auth-panel {
        padding: 0.5rem 1.25rem;
    }
}

@media (max-height: 680px) {
    .hero-central.auth-abierto .hero-lado-der {
        max-height: 27rem;
    }
    .hero-auth-form {
        gap: 0.1px;
    }
    .hero-auth-seccion.activo {
        max-height: 30rem;
        overflow-y: auto;
    }
    .hero-auth-header {
        margin-bottom: 0;
    }
    .hero-auth-form .campo-form {
        padding-bottom: 0.2rem;
        gap: 5px;
    }
}

/* ==========================================
   PREFERENCIAS DE MOVIMIENTO
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    .hero-layout,
    .hero-lado-izq,
    .hero-lado-der,
    .hero-auth-seccion.activo {
        transition: none !important;
        animation: none !important;
    }
}

/* ============================================
   RATE LIMIT
   ============================================ */
.hero-auth-rate-limit {
    padding: 0.85rem 1rem;
    background: var(--color-danger-bg);
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.hero-auth-rate-limit-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-danger);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

.hero-auth-rate-limit-header svg {
    flex-shrink: 0;
    stroke: currentColor;
}

.hero-auth-rate-limit-body {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

.hero-auth-rate-limit-timer {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-danger);
    font-family: 'Courier New', monospace;
    min-width: 3rem;
}
/* ============================================
   AVISO INFO (Revisa tu correo)
   ============================================ */
.hero-auth-info-aviso {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    background: var(--color-info-bg);
    border: 1px solid var(--color-info);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.8rem;
    line-height: 1.5;
}

.hero-auth-info-aviso svg {
    flex-shrink: 0;
    stroke: var(--color-info);
    margin-top: 0.15rem;
}

.hero-auth-info-aviso strong {
    display: block;
    color: var(--color-info);
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.hero-auth-info-aviso span {
    color: var(--color-text-secondary);
    font-weight: 400;
}

/* ============================================
   INPUT DE CODIGO (6 digitos)
   ============================================ */
.hero-auth-codigo-input {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.4rem;
    padding-left: calc(0.75rem + 0.4rem);
    font-variant-numeric: tabular-nums;
}

.hero-auth-codigo-input::placeholder {
    letter-spacing: 0.4rem;
    font-weight: 400;
    color: var(--color-text-muted);
}

/* ============================================
   MIN-HEIGHT PARA EVITAR SALTOS ENTRE PANELES
   ============================================ */
.hero-auth-seccion {
    min-height: 300px;
}

@media (max-width: 991px) {
    .hero-auth-seccion {
        min-height: 0;
    }
}

/* ============================================
   TITULO CON EMAIL DESTACADO
   ============================================ */
.hero-auth-subtitulo strong {
    color: var(--color-gold);
    font-weight: 700;
    word-break: break-all;
}