/* =========================================================
   ROOT
========================================================= */

:root {
    --auth-font: 'Inter', Arial, Helvetica, sans-serif;

    --auth-body-bg: #0f172a;
    --auth-body-gradient: linear-gradient(135deg, #0f172a, #1e3a8a);

    --auth-left-bg: linear-gradient(135deg, #1e3a8a, #3b82f6);
    --auth-left-text: #ffffff;
    --auth-left-muted: #e0e7ff;
    --auth-left-muted-2: #c7d2fe;

    --auth-right-bg: #f1f5f9;
    --auth-right-bg-mobile: #e5e7eb;

    --auth-card-bg: #ffffff;
    --auth-card-text: #0f172a;
    --auth-card-muted: #64748b;
    --auth-card-border: #e5e7eb;
    --auth-card-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    --auth-card-shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.10);
    --auth-card-shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.22);

    --auth-primary: #3b82f6;
    --auth-primary-hover: #2563eb;
    --auth-primary-dark: #1e40af;
    --auth-primary-soft: rgba(59, 130, 246, 0.15);
    --auth-primary-soft-2: rgba(59, 130, 246, 0.20);

    --auth-input-bg: #ffffff;
    --auth-input-bg-readonly: #f8fafc;
    --auth-input-border: #cbd5e1;
    --auth-input-border-2: #d1d5db;
    --auth-input-text: #0f172a;
    --auth-label-text: #334155;

    --auth-link: #2563eb;
    --auth-link-alt: #3b82f6;

    --auth-google-bg: #ffffff;
    --auth-google-hover: #f8fafc;
    --auth-google-text: #111827;
    --auth-google-icon: #ea4335;

    --auth-error-bg: #fee2e2;
    --auth-error-text: #991b1b;
    --auth-success-bg: #dcfce7;
    --auth-success-text: #166534;

    --auth-info-bg: #eef2ff;
    --auth-info-border: #c7d2fe;
    --auth-info-text: #334155;

    --auth-note-bg: #f8fafc;
    --auth-note-border: #e2e8f0;
    --auth-note-text: #64748b;

    --auth-overlay-bg: rgba(15, 23, 42, 0.38);
    --auth-overlay-bg-strong: rgba(15, 23, 42, 0.35);

    --auth-radius-sm: 10px;
    --auth-radius-md: 12px;
    --auth-radius-lg: 18px;
    --auth-radius-xl: 20px;

    --auth-transition: 0.2s ease;
    --auth-transition-slow: 0.3s ease;

    --auth-mobile-scale: 1.08;
}

/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--auth-font);
}

html,
body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    background: var(--auth-body-gradient);
    color: var(--auth-card-text);
    font-size: 15px;
}

/* =========================================================
   CONTENEDOR GENERAL
========================================================= */

.auth-container {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.auth-split {
    min-height: 100vh;
    width: 100%;
    display: flex;
}

/* =========================================================
   LADO IZQUIERDO
========================================================= */

.auth-left {
    width: 55%;
    background: var(--auth-left-bg);
    color: var(--auth-left-text);
    padding: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-left h1 {
    font-size: 42px;
    margin-bottom: 10px;
    color: var(--auth-left-text);
}

.auth-left h2 {
    font-size: 34px;
    margin-bottom: 20px;
    color: var(--auth-left-text);
    opacity: 0.95;
}

.auth-left p {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 30px;
    color: var(--auth-left-muted);
}

/* =========================================================
   FEATURES
========================================================= */

.feature {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.icon {
    width: 45px;
    height: 45px;
    border-radius: var(--auth-radius-md);
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.feature-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feature-text strong {
    font-size: 16px;
    color: var(--auth-left-text);
}

.feature-text span {
    font-size: 14px;
    color: var(--auth-left-muted-2);
}

/* =========================================================
   LADO DERECHO
========================================================= */

.auth-right,
.auth-rigth {
    width: 45%;
    background: var(--auth-right-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.auth-right-base {
    position: relative;
    overflow: hidden;
}

.auth-right-overlay {
    position: relative;
}

.auth-right-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--auth-overlay-bg-strong);
}

/* =========================================================
   LOGIN CARD
========================================================= */

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--auth-card-bg);
    padding: 32px 30px;
    border-radius: var(--auth-radius-xl);
    box-shadow: var(--auth-card-shadow);
}

.login-card-background {
    opacity: 0.35;
    transform: scale(0.98);
    pointer-events: none;
    filter: blur(1px);
}

/* =========================================================
   TÍTULOS
========================================================= */

.login-title {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--auth-card-text);
}

.login-subtitle {
    text-align: center;
    font-size: 15px;
    color: var(--auth-card-muted);
    margin-bottom: 24px;
}

/* =========================================================
   INPUTS
========================================================= */

.input-group {
    margin-bottom: 15px;
}

.input-label {
    display: block;
    margin-bottom: 6px;
    color: var(--auth-label-text);
    font-size: 14px;
    font-weight: 600;
}

.input-group input,
.form-input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border-radius: var(--auth-radius-md);
    border: 1px solid var(--auth-input-border);
    outline: none;
    font-size: 15px;
    transition: var(--auth-transition);
    background: var(--auth-input-bg);
    color: var(--auth-input-text);
}

.form-input {
    padding: 12px 14px;
}

.input-group input:focus,
.form-input:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px var(--auth-primary-soft);
}

.input-group input[readonly] {
    background: var(--auth-input-bg-readonly);
    color: var(--auth-card-muted);
}

/* =========================================================
   FILA DE OPCIONES
========================================================= */

.login-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 14px;
}

.remember-box {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
}

.login-link,
.switch-link {
    color: var(--auth-link);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.login-link:hover,
.switch-link:hover {
    text-decoration: underline;
}

/* =========================================================
   BOTONES
========================================================= */

.btn-primary-auth {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: var(--auth-radius-md);
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--auth-transition-slow);
}

.btn-primary-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.30);
}

.btn-secondary-auth {
    width: 100%;
    height: 48px;
    border: 1px solid var(--auth-input-border);
    border-radius: var(--auth-radius-sm);
    background: var(--auth-card-bg);
    color: var(--auth-card-text);
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--auth-transition);
}

.btn-secondary-auth:hover {
    background: var(--auth-note-bg);
}

/* =========================================================
   DIVIDER
========================================================= */

.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    font-size: 14px;
    color: #94a3b8;
}

.divider::before,
.divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--auth-card-border);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    position: relative;
    display: inline-block;
    padding: 0 12px;
    background: var(--auth-card-bg);
    z-index: 1;
}

/* =========================================================
   GOOGLE BUTTON
========================================================= */

.google-button {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--auth-google-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: var(--auth-radius-md);
    font-size: 15px;
    font-weight: 600;
    color: var(--auth-google-text);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.google-button img {
    width: 20px;
    height: 20px;
}

.google-button:hover {
    background: var(--auth-google-hover);
    border-color: var(--auth-input-border-2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.google-button:active {
    transform: scale(0.98);
    box-shadow: none;
}

.google-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--auth-google-icon);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 1px solid var(--auth-card-border);
    font-size: 14px;
}

/* =========================================================
   REGISTRO
========================================================= */

.register-text {
    text-align: center;
    margin-top: 18px;
    font-size: 14px;
    color: var(--auth-card-muted);
}

.register-text a {
    color: var(--auth-link);
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.register-text a:hover {
    text-decoration: underline;
}

/* =========================================================
   ALERTAS
========================================================= */

.error-box {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: var(--auth-radius-sm);
    background: var(--auth-error-bg);
    color: var(--auth-error-text);
    font-size: 14px;
}

.success-box {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: var(--auth-radius-sm);
    background: var(--auth-success-bg);
    color: var(--auth-success-text);
    font-size: 14px;
}

/* =========================================================
   RECUPERACIÓN / MODALES AUTH
========================================================= */

.auth-modal-page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
}

.auth-modal-card {
    width: 100%;
    max-width: 460px;
    background: var(--auth-card-bg);
    border-radius: var(--auth-radius-xl);
    box-shadow: var(--auth-card-shadow-strong);
    padding: 28px;
    position: relative;
    z-index: 6;
}

.auth-right-overlay .auth-modal-card {
    position: relative;
    z-index: 2;
}

.auth-overlay {
    position: absolute;
    inset: 0;
    background: var(--auth-overlay-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    z-index: 5;
}

.challenge-divider {
    text-align: center;
    margin: 14px 0;
    color: var(--auth-card-muted);
    font-weight: 600;
}

.modal-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
}

.modal-title-left {
    text-align: left;
    font-size: 24px;
    margin-bottom: 6px;
}

.modal-subtitle-left {
    text-align: left;
    margin-bottom: 0;
}

.left-title,
.left-subtitle {
    text-decoration: none;
    color: var(--auth-card-muted);
    font-size: 32px;
    line-height: 1;
}

.modal-close-btn {
    text-decoration: none;
    color: var(--auth-card-muted);
    font-size: 34px;
    line-height: 1;
    flex-shrink: 0;
}

.modal-close-btn:hover {
    color: var(--auth-card-text);
}

.info-box-auth {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: var(--auth-radius-md);
    background: var(--auth-info-bg);
    border: 1px solid var(--auth-info-border);
    color: var(--auth-info-text);
    font-size: 14px;
    line-height: 1.5;
}

.note-box-auth {
    margin-top: 8px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: var(--auth-radius-md);
    background: var(--auth-note-bg);
    border: 1px solid var(--auth-note-border);
    color: var(--auth-note-text);
    font-size: 14px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {
    html,
    body {
        height: 100%;
        margin: 0;
        padding: 0;
    }

    .auth-split {
        display: flex !important;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
    }

    .auth-left {
        display: none !important;
    }

    .auth-right,
    .auth-rigth {
        width: 100%;
        min-height: 100vh;
        height: 100vh;
        padding: 0 !important;
        display: flex;
        justify-content: center;
        align-items: stretch;
        background: var(--auth-right-bg-mobile);
    }

    .login-card {
        width: 100%;
        max-width: 95%;
        margin: 0;
        padding: 25px 20px;
        border-radius: var(--auth-radius-lg);
        display: flex;
        flex-direction: column;
        justify-content: center;
        transform: scale(var(--auth-mobile-scale));
        transform-origin: center;
    }

    .login-title {
        font-size: 32px;
    }

    .login-subtitle {
        font-size: 16px;
    }

    .input-group input,
    .form-input {
        font-size: 16px;
    }

    .btn-primary-auth,
    .btn-secondary-auth {
        font-size: 17px;
    }

    .google-button {
        font-size: 16px;
    }

    .auth-overlay {
        position: static;
        background: transparent;
        padding: 0;
    }

    .login-card-background {
        display: none;
    }

    .auth-modal-card {
        max-width: 420px;
    }
}

@media (max-width: 520px) {
    :root {
        --auth-mobile-scale: 1;
    }

    .auth-right,
    .auth-rigth {
        align-items: center;
        padding: 18px !important;
    }

    .login-card,
    .auth-modal-card {
        max-width: 100%;
        padding: 24px 20px;
        border-radius: var(--auth-radius-lg);
    }

    .login-title {
        font-size: 28px;
    }

    .login-subtitle {
        font-size: 15px;
    }

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

    .modal-actions {
        flex-direction: column;
    }

    .divider::before,
    .divider::after {
        width: 35%;
    }
}