/* ============================================================
   StockFlow — Auth Styles
   Estilo: Fondo completo con overlay — RafaelTeach Brand
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

body.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --spring-smooth: cubic-bezier(0.16, 1.00, 0.30, 1);
    --spring-snappy: cubic-bezier(0.40, 0.00, 0.20, 1);
}

/* ── Wrapper: ocupa toda la pantalla ──────────────────────── */
.auth-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    overflow: hidden;
}

/* ── Fondo: calle de Diriamba + red de negocios (Views/Shared/Partials/_FondoLogin) ── */
.auth-bg {
    position: fixed;
    inset: 0;
    background-color: #1B263B;
    background-image: url('/img/marca/fondo-login.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    overflow: hidden;
    transform-origin: 52% 30%;
    animation: auth-acercar 40s ease-in-out infinite alternate;
}

/* Capa oscura: más fuerte a la izquierda (texto) y abajo; deja ver la iglesia y los faroles. */
.auth-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(27, 38, 59, 0.10) 0%, rgba(27, 38, 59, 0) 45%, rgba(27, 38, 59, 0.70) 100%),
        linear-gradient(90deg,
            rgba(27, 38, 59, 0.94) 0%,
            rgba(27, 38, 59, 0.78) 28%,
            rgba(27, 38, 59, 0.30) 52%,
            rgba(27, 38, 59, 0.40) 75%,
            rgba(27, 38, 59, 0.72) 100%);
}

/* Red dorada encima de la capa oscura, con el mismo encuadre que la imagen (slice = cover). */
.auth-red {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.auth-red-lineas path {
    stroke-width: 1.4;
    stroke-opacity: 0.75;
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
    animation: auth-trazar 2.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.auth-red-lineas path:nth-child(2) { animation-delay: 0.15s; }
.auth-red-lineas path:nth-child(3) { animation-delay: 0.30s; }
.auth-red-lineas path:nth-child(4) { animation-delay: 0.45s; }
.auth-red-lineas path:nth-child(5) { animation-delay: 0.60s; }
.auth-red-lineas path:nth-child(6) { animation-delay: 0.75s; }

.auth-red-faroles circle {
    transform-box: fill-box;
    transform-origin: center;
    animation: auth-respirar 3.6s ease-in-out infinite;
}

.auth-red-pulsos { opacity: 0; animation: auth-aparecer 1s ease 2.2s forwards; }

.auth-red-nucleo circle:first-child {
    transform-box: fill-box;
    transform-origin: center;
    animation: auth-respirar 2.8s ease-in-out infinite;
}

@keyframes auth-acercar  { from { transform: scale(1); } to { transform: scale(1.07); } }
@keyframes auth-trazar   { to { stroke-dashoffset: 0; } }
@keyframes auth-respirar { 0%, 100% { transform: scale(0.75); opacity: 0.65; } 50% { transform: scale(1.25); opacity: 1; } }
@keyframes auth-aparecer { to { opacity: 1; } }

/* Celular: el formulario queda encima de la iglesia → capa más pareja y oscura para que se lea. */
@media (max-width: 820px) {
    /* Arriba se ve la red (iglesia y nodo); abajo, más oscuro, la tarjeta del formulario. */
    .auth-bg::after {
        background: linear-gradient(180deg,
            rgba(27, 38, 59, 0.30) 0%,
            rgba(27, 38, 59, 0.45) 22%,
            rgba(27, 38, 59, 0.82) 42%,
            rgba(27, 38, 59, 0.90) 100%);
    }
    .auth-red-lineas path { stroke-opacity: 0.85; stroke-width: 1.8; }
}

/* Quien pide menos movimiento: imagen quieta, líneas dibujadas, sin pulsos. */
@media (prefers-reduced-motion: reduce) {
    .auth-bg, .auth-red-faroles circle, .auth-red-nucleo circle:first-child { animation: none; }
    .auth-red-lineas path { animation: none; stroke-dashoffset: 0; }
    .auth-red-pulsos { display: none; }
}

/* ── Layout interior ──────────────────────────────────────── */
.auth-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 100vh;
}

/* ── Panel izquierdo (branding + redes) ───────────────────── */
.auth-panel-left {
    flex: 1;
    padding: 56px 52px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100vh;
}

@media (max-width: 820px) {
    .auth-panel-left { display: none; }
    .auth-divider    { display: none; }
}

/* Logo */
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.auth-brand-name {
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: -0.3px;
}

.auth-brand-name span {
    color: #D4A24C;
}

/* Titular */
.auth-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px 0;
    animation: authFadeUp 0.5s var(--spring-smooth) both;
}

@keyframes authFadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-hero h1 {
    font-size: clamp(28px, 4vw, 52px);
    font-weight: 800;
    color: #FFFFFF;
    margin: 0 0 16px;
    line-height: 1.1;
    letter-spacing: -1.5px;
}

.auth-hero-acento { color: #D4A24C; }

.auth-hero p {
    font-size: clamp(13px, 1.5vw, 15px);
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.75;
    margin: 0;
    max-width: 400px;
    text-shadow: 0 1px 8px rgba(27, 38, 59, 0.6);
}

/* Footer izquierdo */
.auth-footer-left {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 24px;
}

.auth-footer-left .brand-accent {
    color: #D4A24C;
    font-weight: 500;
}

a.brand-accent {
    text-decoration: none;
    border-bottom: 1px solid rgba(212, 162, 76, 0.35);
    transition: color 150ms ease, border-color 150ms ease;
}

a.brand-accent:hover,
a.brand-accent:focus-visible {
    color: #E5BC72;
    border-bottom-color: #E5BC72;
    outline: none;
}

/* ── Divisor vertical (ya no se usa: el formulario va en su propia tarjeta) ── */
.auth-divider {
    display: none;
    width: 1px;
    background: rgba(255, 255, 255, 0.1);
    align-self: stretch;
    margin: 40px 0;
}

/* ── Panel derecho (formulario): tarjeta sólida sobre el fondo ── */
.auth-panel-right {
    width: clamp(340px, 34vw, 430px);
    flex-shrink: 0;
    margin: 32px clamp(24px, 5vw, 64px) 32px 0;
    padding: clamp(32px, 4vw, 44px) clamp(26px, 3.5vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(17, 26, 43, 0.88);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    backdrop-filter: blur(16px) saturate(120%);
    border: 1px solid rgba(212, 162, 76, 0.22);
    border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    animation: authFadeUp 0.5s 0.08s var(--spring-smooth) both;
}

@media (max-width: 820px) {
    /* Celular y tableta: la tarjeta baja y deja ver arriba la red que converge sobre la iglesia. */
    .auth-inner {
        align-items: flex-end;
        justify-content: center;
        padding-top: clamp(150px, 27vh, 260px);
    }
    .auth-panel-right {
        width: calc(100% - 32px);
        max-width: 440px;
        margin: 0 auto 20px;
        padding: 28px 22px;
    }
    .auth-card-logo { width: 60px; height: 60px; }
}

/* Encabezado de la tarjeta: logo + nombre (Views/Auth/_EncabezadoTarjeta). */
.auth-card-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
}

.auth-card-logo {
    width: 76px;
    height: 76px;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

/* Nombre en dos tonos: "Güegüense" blanco + "App" dorado (el mismo estilo del logo de texto). */
.auth-card-brand {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #FFFFFF;
    line-height: 1.1;
    text-align: center;
}

.auth-card-brand span { color: #D4A24C; }

.auth-system-badge {
    display: inline-block;
    align-self: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #D4A24C;
    border: 1px solid rgba(212,162,76, 0.35);
    border-radius: 20px;
    padding: 4px 12px;
    margin: 0 0 14px;
}

.auth-form-title {
    font-size: clamp(17px, 2vw, 19px);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 28px;
    text-align: center;
    letter-spacing: -0.4px;
    line-height: 1.25;
}

/* ── Alerta de error ──────────────────────────────────────── */
.auth-alert-error {
    background: rgba(200,49,43, 0.12);
    border: 1px solid rgba(200,49,43, 0.35);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: #FCA5A5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
}

.auth-alert-error i {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Campos ───────────────────────────────────────────────── */
.auth-field {
    margin-bottom: 16px;
}

.auth-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 7px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.auth-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    background: #22304B;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    font-size: 15px;
    color: #FFFFFF;
    outline: none;
    transition:
        border-color 150ms var(--spring-snappy),
        background   150ms var(--spring-snappy),
        box-shadow   150ms var(--spring-snappy);
    font-family: inherit;
}

.auth-input::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.auth-input:hover {
    border-color: rgba(255, 255, 255, 0.45);
}

.auth-input:focus {
    border-color: #D4A24C;
    background: #273657;
    box-shadow: 0 0 0 3px rgba(212,162,76, 0.28);
}

/* Autocompletar del navegador: que no lo pinte de blanco/amarillo. */
.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #FFFFFF;
    -webkit-box-shadow: 0 0 0 1000px #22304B inset;
    caret-color: #FFFFFF;
    transition: background-color 9999s ease 0s;
}

.auth-input.input-validation-error {
    border-color: rgba(200,49,43, 0.6);
}

.field-validation-error {
    display: block;
    font-size: 12px;
    color: #FCA5A5;
    margin-top: 5px;
}

/* ── Requisitos de la contraseña en vivo (wwwroot/js/clave-requisitos.js) ── */
.clave-requisitos {
    list-style: none;
    margin: 10px 0 0;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    display: grid;
    gap: 6px;
}

.clave-requisitos li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    line-height: 1.35;
    color: #F2A7A3;                 /* falta: rojo claro, legible sobre la tarjeta oscura */
    transition: color 150ms ease;
}

.clave-requisitos li i { color: #E0574F; font-size: 14px; width: 16px; text-align: center; }

.clave-requisitos li.ok { color: #9FE3C2; }
.clave-requisitos li.ok i { color: #2FBF83; }
.clave-requisitos li.ok span { text-decoration: line-through; text-decoration-color: rgba(159, 227, 194, 0.55); }

/* ── "o" + botón "Continuar con Google" (estilo claro de Google) ── */
.auth-separador {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-separador::before,
.auth-separador::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.16);
}

.auth-btn-google {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #FFFFFF;
    color: #1F1F1F;
    border: 1px solid #DADCE0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, box-shadow 150ms ease;
}

.auth-btn-google:hover { background: #F7F8F8; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25); }
.auth-btn-google:focus-visible { outline: 3px solid rgba(212, 162, 76, 0.6); outline-offset: 2px; }

/* ── Modo invitado: "Conocer la plataforma" ── */
/* PC: en el panel izquierdo, bajo la descripción. Celular (el panel no se ve): una línea en la tarjeta. */
.auth-hero-invitado { margin-top: 26px; max-width: 420px; }
.auth-hero-invitado .auth-btn-invitado { width: auto; padding: 0 22px; }
.auth-hero-invitado small { display: block; margin-top: 10px; font-size: 12.5px; color: rgba(255, 255, 255, 0.6); }

.auth-invitado {
    display: none;
    margin-top: 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}
.auth-link-invitado {
    background: none;
    border: none;
    padding: 2px 0;
    font: inherit;
    font-weight: 700;
    color: #E5BC72;
    cursor: pointer;
}
.auth-link-invitado:hover { color: #F2D296; text-decoration: underline; }
.auth-link-invitado:focus-visible { outline: 3px solid rgba(212, 162, 76, 0.6); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 820px) {
    .auth-invitado { display: block; }
}

.auth-btn-invitado {
    width: 100%;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: transparent;
    color: #E5BC72;
    border: 1.5px solid rgba(212, 162, 76, 0.7);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}

.auth-btn-invitado:hover { background: rgba(212, 162, 76, 0.14); color: #F2D296; }
.auth-btn-invitado:focus-visible { outline: 3px solid rgba(212, 162, 76, 0.6); outline-offset: 2px; }

/* ── Password toggle ──────────────────────────────────────── */
.auth-pass-wrapper {
    position: relative;
}

.auth-pass-wrapper .auth-input {
    padding-right: 44px;
}

.auth-pass-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}

.auth-pass-toggle:hover {
    color: #E5BC72;
}

.auth-pass-toggle i {
    font-size: 17px;
}

/* ── Fila Remember + Forgot ───────────────────────────────── */
.auth-options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 24px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.auth-remember input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #D4A24C;
    cursor: pointer;
}

/* "Confiar en este dispositivo" (verificación en dos pasos): texto claro sobre la tarjeta oscura. */
.auth-confiar { display: flex; gap: 10px; align-items: flex-start; margin: -4px 0 16px; cursor: pointer; }
.auth-confiar input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; }
.auth-confiar-titulo { display: block; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.92); }
.auth-confiar-nota { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: rgba(255, 255, 255, 0.68); }

.auth-remember-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.82);
}

.auth-forgot {
    font-size: 13px;
    color: #D4A24C;
    text-decoration: none;
    transition: color 0.15s;
}

.auth-forgot:hover {
    color: #E5BC72;
}

/* ── Botón principal ──────────────────────────────────────── */
.auth-btn {
    width: 100%;
    height: 48px;
    background: #D4A24C;
    color: #1B263B;
    border: none;
    border-radius: 8px;
    font-size: clamp(13px, 1.5vw, 14px);
    font-weight: 700;
    cursor: pointer;
    transition:
        background 150ms var(--spring-snappy),
        box-shadow 200ms var(--spring-snappy),
        transform  200ms var(--spring-bounce);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.auth-btn:hover:not(:disabled) {
    background: #E5BC72;
    box-shadow: 0 4px 16px rgba(212,162,76, 0.4);
    transform: translateY(-1px);
}

.auth-btn:active:not(:disabled) {
    transform: scale(0.98) translateY(0);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner */
.auth-btn .btn-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(27, 38, 59, 0.3);
    border-top-color: #1B263B;
    border-radius: 50%;
    animation: authSpin 0.7s linear infinite;
    display: none;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

.auth-btn.btn-loading .btn-text  { display: none; }
.auth-btn.btn-loading .btn-spinner { display: block; }

/* ── Pie de formulario ────────────────────────────────────── */
.auth-form-footer {
    text-align: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 20px;
    line-height: 1.7;
}

.auth-form-footer a {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: color 0.15s;
}

.auth-form-footer a:hover {
    color: #D4A24C;
}

/* ── Modal: aparece desde el centro con scale ─────────────── */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: modalOverlayIn 0.2s ease-out both;
}

@keyframes modalOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.auth-modal {
    background: #1B263B;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: clamp(24px, 4vw, 32px);
    width: 100%;
    max-width: 400px;
    animation: modalIn 0.35s var(--spring-smooth) both;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.93) translateY(8px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}
