﻿/* ============================================================================
   AUTH.CSS — Login / Registro
   ----------------------------------------------------------------------------
   | Scope: login.aspx exclusivamente — sin MasterPage, sin base.css.
   | Este archivo es autónomo: redefine todas las variables del sistema
   |   global porque no tiene acceso a base.css en esta página.
   | Si se cambia un token en base.css, actualizar también este archivo.
   | Responsabilidades: Reset · Variables · Layout · Card · Campos ·
   |   Botones · Validación · Animaciones · Responsive · Print
   | Versión: 2.1 — font-family corregido a Inter (era Montserrat por
   |   descuido); .auth-button border-radius unificado con --radius-sm (8px).
   | Última actualización: 2026-03-10
   ============================================================================ */

/* ============================================================================
   § 1. VARIABLES
   ----------------------------------------------------------------------------
   Espejo exacto de base.css. Autónomo porque login.aspx no carga base.css.
   ============================================================================ */
:root {
    /* Fondos */
    --bg-main: #0b1220;
    --bg-panel: #0f172a;
    --bg-card: #111827;
    /* Bordes */
    --border-soft: #1e293b;
    --border-light: rgba(148, 163, 184, 0.15);
    /* Tipografía */
    --text-main: #e5e7eb;
    --text-muted: #94a3b8;
    --text-soft: #64748b;
    /* Colores de estado */
    --accent: #38bdf8;
    --accent-focus: #2563eb;
    --danger: #ef4444;
    --success: #22c55e;
    /* Radio */
    --radius-sm: 8px;
    --radius-lg: 14px;
    /* Transiciones */
    --transition-fast: 0.2s ease;
    /* Espaciado */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;
}

/* ============================================================================
   § 2. RESET & BASE
   ============================================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

    /* ============================================================================
   § 3. LAYOUT GENERAL
   ============================================================================ */
    body.auth-bg {
        margin: 0;
        min-height: 100vh;
        background: radial-gradient(circle at top, #111827, #020617);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: var(--space-lg);
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 420px;
}

/* ============================================================================
   § 4. SKIP TO CONTENT (Accesibilidad)
   ============================================================================ */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: var(--space-sm) var(--space-lg);
    text-decoration: none;
    border-radius: var(--radius-sm);
    z-index: 100;
    transition: top var(--transition-fast);
}

    .skip-to-content:focus {
        top: var(--space-sm);
    }

/* ============================================================================
   § 5. AUTH CARD
   ============================================================================ */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   § 6. CABECERA DEL FORMULARIO
   ============================================================================ */
.auth-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

    .auth-header img {
        width: 48px;
        height: 48px;
        margin-bottom: var(--space-sm);
        display: inline-block;
    }

    .auth-header h1 {
        margin: 0;
        font-size: 28px;
        font-weight: 700;
        color: var(--accent);
        letter-spacing: -0.5px;
    }

    .auth-header p {
        margin: var(--space-xs) 0 0;
        font-size: 14px;
        color: var(--text-muted);
        font-weight: 400;
    }

/* ============================================================================
   § 7. CAMPOS DE FORMULARIO
   ============================================================================ */
.auth-field {
    margin-bottom: var(--space-lg);
}

    .auth-field label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: var(--text-muted);
        margin-bottom: 6px;
    }

.auth-input {
    width: 100%;
    padding: 11px 14px;
    background: #020617;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

    .auth-input::placeholder {
        color: var(--text-soft);
        opacity: 0.6;
    }

    .auth-input:focus {
        border-color: var(--accent-focus);
        background: var(--bg-panel);
    }

    .auth-input:focus-visible {
        outline: 2px solid var(--accent-focus);
        outline-offset: 2px;
    }

    .auth-input.error {
        border-color: var(--danger);
        background-color: rgba(239, 68, 68, 0.05);
    }

/* Texto de ayuda bajo el campo */
.auth-help {
    display: block;
    margin-top: var(--space-xs);
    font-size: 12px;
    color: var(--text-soft);
}

    .auth-help.hidden {
        display: none;
    }

/* ============================================================================
   § 8. OPCIONES ADICIONALES (Recordarme)
   ============================================================================ */
.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

.auth-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    user-select: none;
}

    .auth-checkbox input[type="checkbox"] {
        width: 17px;
        height: 17px;
        cursor: pointer;
        accent-color: var(--accent);
    }

    .auth-checkbox label {
        cursor: pointer;
        font-weight: 400;
        margin: 0;
    }

/* ============================================================================
   § 9. BOTONES
   ============================================================================ */
.auth-button {
    width: 100%;
    padding: 13px var(--space-lg);
    background: var(--accent-focus);
    border: none;
    border-radius: var(--radius-sm); /* unificado con el sistema — era 10px */
    color: white;
    font-weight: 600;
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    outline: none;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

    .auth-button:hover {
        background: #1d4ed8;
        transform: translateY(-1px);
    }

    .auth-button:active {
        transform: translateY(0);
    }

    .auth-button:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
    }

    .auth-button:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

/* ============================================================================
   § 10. MENSAJES DE ERROR Y VALIDACIÓN
   ============================================================================ */
.auth-error {
    display: block;
    margin-bottom: var(--space-lg);
    padding: 12px var(--space-lg);
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-left: 3px solid var(--danger);
    color: #fca5a5;
    border-radius: var(--radius-sm);
    font-size: 13px;
    text-align: left;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Validación inline bajo el campo */
.auth-validation {
    display: block;
    margin-top: var(--space-xs);
    font-size: 12px;
    color: var(--danger);
}

/* ============================================================================
   § 11. FOOTER
   ============================================================================ */
.auth-footer {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-soft);
}

.auth-footer-text {
    text-align: center;
    font-size: 12px;
    color: var(--text-soft);
    margin: 0;
}

/* ============================================================================
   § 12. RESPONSIVE
   ============================================================================ */
@media (max-width: 480px) {
    body.auth-bg {
        padding: var(--space-md);
    }

    .auth-card {
        padding: var(--space-xl);
    }

    .auth-header h1 {
        font-size: 24px;
    }

    .auth-button {
        padding: 12px var(--space-md);
    }
}

@media (max-width: 360px) {
    .auth-card {
        padding: var(--space-lg);
    }
}

/* ============================================================================
   § 13. MODO OSCURO FORZADO
   ----------------------------------------------------------------------------
   Evita que el navegador sobreescriba el tema oscuro en modo claro del SO.
   ============================================================================ */
@media (prefers-color-scheme: light) {
    body.auth-bg {
        background: radial-gradient(circle at top, #111827, #020617);
        color: var(--text-main);
    }
}

/* ============================================================================
   § 14. ANIMACIONES REDUCIDAS (Accesibilidad)
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================================
   § 15. PRINT STYLES
   ============================================================================ */
@media print {
    body.auth-bg {
        background: white;
    }

    .auth-card {
        border: 1px solid black;
    }

    .auth-button {
        display: none;
    }
}
