/*
 * Aurora Login — Auth Pages (Login, Recover, Reset Password)
 * Design: Glassmorphism card with background image, modern CRM style.
 * Font Barlow is loaded via @font-face from local files.
 */

/* ═══ @FONT-FACE: Barlow (local) ═══ */
@font-face {
    font-family: 'Barlow';
    src: url('../fonts/Barlow-ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Barlow';
    src: url('../fonts/Barlow-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Barlow';
    src: url('../fonts/Barlow-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Barlow';
    src: url('../fonts/Barlow-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Barlow';
    src: url('../fonts/Barlow-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Barlow';
    src: url('../fonts/Barlow-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ═══ CSS CUSTOM PROPERTIES ═══ */
:root {
    --font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                   sans-serif;
    --color-surface: #ffffff;
    --color-text-primary: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-light: #475569;
    --color-text-muted: #94a3b8;
    --color-primary: #2d6a4f;
    --color-primary-dark: #1b4332;
    --radius-md: 10px;
    --radius-xl: 20px;
    --shadow-card: 0 8px 32px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
}

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

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: var(--font-family);
    background: var(--color-surface);
    color: var(--color-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

/* ═══ APP CONTAINER ═══ */
.app {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 0;
}

.app::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        url('https://auroracpsas.com/wp-content/uploads/2026/06/Fondo-Inicio-1.png') center/cover no-repeat fixed;
    pointer-events: none;
}

/* ═══ CARD ═══ */
.card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 28px;
    padding: 40px 36px 32px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-card);
    animation: cardFadeIn 0.5s ease;
}

/* @supports not (backdrop-filter): fallback sólido para navegadores sin soporte */
@supports not (backdrop-filter: blur(1px)) {
    .card {
        background: rgba(255, 255, 255, 0.95);
        border: 1px solid rgba(0, 0, 0, 0.08);
    }
}

/* ═══ LOGO ═══ */
.card-header-logo {
    text-align: center;
    margin-bottom: 6px;
}

.logo {
    max-width: 180px;
    height: auto;
    display: inline-block;
}

/* ═══ TITLE ═══ */
.card-header-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-primary);
    text-align: center;
    margin: 6px 0 4px;
    letter-spacing: -0.3px;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ═══ ALERTS ═══ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 18px;
    animation: contentFadeIn 0.35s ease;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ═══ FORM ═══ */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: var(--font-family);
    color: var(--color-text-primary);
    background: var(--color-surface);
    transition: all 0.2s ease;
    outline: none;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus {
    border-color: #2d6a4f;
    box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

.form-group input[type="text"]::placeholder,
.form-group input[type="password"]::placeholder,
.form-group input[type="email"]::placeholder {
    color: var(--color-text-muted);
    font-weight: 400;
}

.password-hint {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-top: 5px;
    font-weight: 400;
}

/* ═══ REMEMBER ROW ═══ */
.remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    font-size: 0.82rem;
}

.remember-row label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--color-text-light);
    font-weight: 500;
    cursor: pointer;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #2d6a4f;
    border-radius: 4px;
    cursor: pointer;
}

.remember-row a {
    color: #2d6a4f;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: color 0.15s;
}

.remember-row a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ═══ BUTTONS ═══ */
.btn-login,
.btn-auth-primary {
    width: 100%;
    padding: 13px 24px;
    background: linear-gradient(135deg, #2d6a4f 0%, #40916c 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.2px;
    position: relative;
    overflow: hidden;
}

.btn-login:hover,
.btn-auth-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(45, 106, 79, 0.35);
}

.btn-login:active,
.btn-auth-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(45, 106, 79, 0.25);
}

.btn-login:disabled,
.btn-auth-primary:disabled,
.btn-login.btn-loading,
.btn-auth-primary.btn-loading {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
    pointer-events: none;
}

.btn-login::after,
.btn-auth-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.08) 100%);
    pointer-events: none;
}

/* ═══ FOOTER ═══ */
.footer-text {
    text-align: center;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-top: 22px;
    font-weight: 400;
}

.footer-text a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}

.footer-text a:hover {
    color: #1e293b;
}

/* ═══ BACK LINK (Recover & Reset) ═══ */
.back-link {
    text-align: center;
    margin-top: 18px;
    font-size: 0.85rem;
}

.back-link a {
    color: #2d6a4f;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}

.back-link a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

.separator {
    color: var(--color-text-muted);
    margin: 0 8px;
    font-weight: 300;
}

/* ═══ ICON CIRCLE (Recover success) ═══ */
.icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d8f3dc 0%, #b7e4c7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px auto 14px;
    animation: iconBounceIn 0.5s ease;
}

.icon-circle svg {
    width: 32px;
    height: 32px;
}

/* ═══ PREFERS-REDUCED-MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
    .card,
    .alert,
    .icon-circle {
        animation: none !important;
    }
    .btn-login,
    .btn-auth-primary {
        transition: none !important;
    }
    .btn-login:hover,
    .btn-auth-primary:hover {
        transform: none !important;
    }
    .remember-row a {
        transition: none !important;
    }
    .back-link a {
        transition: none !important;
    }
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes iconBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.6);
    }
    60% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* ═══ SCROLLBAR ═══ */
/* ═══ RESPONSIVE ═══ */
@media (max-width: 480px) {
    .app {
        padding: 16px;
    }

    .card {
        padding: 28px 22px 24px;
        border-radius: 16px;
        max-width: 100%;
    }

    .logo {
        max-width: 150px;
    }

    .card-header-title {
        font-size: 1.15rem;
    }

    .form-group input[type="text"],
    .form-group input[type="password"],
    .form-group input[type="email"] {
        padding: 11px 12px;
        font-size: 16px; /* Previene zoom en iOS */
    }

    .btn-login,
    .btn-auth-primary {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .remember-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .icon-circle {
        width: 54px;
        height: 54px;
    }

    .icon-circle svg {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 360px) {
    .card {
        padding: 22px 16px 20px;
    }

    .back-link {
        font-size: 0.8rem;
    }

    .separator {
        margin: 0 5px;
    }
}
