:root {
    --auth-font-heading: 'Outfit', sans-serif;
    --auth-font-body: 'Outfit', sans-serif;
    --auth-primary: #183B66; /* Azul Profundo */
    --auth-accent: #2F80ED; /* Azul Eléctrico */
    --auth-success: #20C6B7; /* Turquesa Tecnológico */
    --auth-danger: #E85D5D; /* Rojo Coral */
    --auth-warning: #F5B942; /* Amarillo Ámbar */
}

html[data-theme='dark'] {
    --auth-primary: #2F80ED; /* Azul Eléctrico */
    --auth-accent: #20C6B7; /* Turquesa Tecnológico */
    
    --auth-bg: #171d22; /* Tono Grafito */
    --auth-surface: #263238; /* Gris Grafito */
    --auth-surface-strong: #303f47;
    --auth-border: rgba(255, 255, 255, 0.05);
    --auth-text: #f1f5f9;
    --auth-muted: #b0bec5;
    --auth-input: rgba(255, 255, 255, 0.02);
}

html[data-theme='light'] {
    --auth-primary: #183B66; /* Azul Profundo */
    --auth-accent: #2F80ED; /* Azul Eléctrico */

    --auth-bg: #f8fafc;
    --auth-surface: #ffffff;
    --auth-surface-strong: #f1f5f9;
    --auth-border: rgba(0, 0, 0, 0.04);
    --auth-text: #263238; /* Gris Grafito */
    --auth-muted: #475569;
    --auth-input: #f8fafc;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--auth-font-body);
    background-color: var(--auth-bg);
    color: var(--auth-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
}

.auth-showcase {
    position: relative;
    padding: 3rem;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: radial-gradient(circle at top left, rgba(32, 198, 183, 0.15), transparent 40%),
                radial-gradient(circle at bottom right, rgba(47, 128, 237, 0.1), transparent 30%),
                var(--auth-bg);
}

html[data-theme='light'] .auth-showcase {
    background: radial-gradient(circle at 10% 20%, rgba(24, 59, 102, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 90% 80%, rgba(47, 128, 237, 0.12) 0%, transparent 50%),
                linear-gradient(135deg, #183B66 0%, #2F80ED 100%);
}

html[data-theme='dark'] .auth-showcase {
    background: radial-gradient(circle at top left, rgba(32, 198, 183, 0.2), transparent 50%),
                radial-gradient(circle at bottom right, rgba(47, 128, 237, 0.12), transparent 40%),
                #171d22;
}

.auth-showcase::before {
    content: '';
    position: absolute;
    inset: 2rem;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(32, 198, 183, 0.04), rgba(47, 128, 237, 0.02));
    border: 1px solid var(--auth-border);
    backdrop-filter: blur(12px);
}

html[data-theme='light'] .auth-showcase::before {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-showcase::after {
    content: '';
    position: absolute;
    inset: 2rem;
    background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 26px 26px;
    border-radius: 24px;
    opacity: 0.12;
}

.auth-showcase-inner {
    position: relative;
    z-index: 1;
    padding: 1.5rem 2rem;
    max-width: 620px;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #20C6B7;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
}

.auth-showcase h1 {
    margin: 0 0 1rem;
    font-family: var(--auth-font-heading);
    font-size: clamp(2.2rem, 3.5vw, 3.8rem);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.auth-showcase p {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 1rem;
    line-height: 1.7;
}

.auth-showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.auth-showcase-card {
    padding: 1.25rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

html[data-theme='light'] .auth-showcase-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(24, 59, 102, 0.1);
}

.auth-showcase-card:hover {
    transform: translateY(-4px);
    border-color: rgba(32, 198, 183, 0.5);
    box-shadow: 0 12px 40px 0 rgba(32, 198, 183, 0.2);
}

.auth-showcase-card strong {
    display: block;
    font-family: var(--auth-font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: #ffffff;
}

.auth-showcase-card span {
    display: block;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.8rem;
    line-height: 1.5;
}

.auth-showcase-watermark {
    position: absolute;
    bottom: -80px;
    right: -80px;
    width: 520px;
    height: 520px;
    background: url('../logo.png') no-repeat center center;
    background-size: contain;
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

.auth-panel-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-panel {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 2.5rem 2rem;
    border-radius: 24px;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.1);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 2rem;
}

.auth-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-primary), #6366f1);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--auth-font-heading);
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 8px 16px -4px rgba(79, 70, 229, 0.3);
}

.auth-brand-text strong {
    display: block;
    font-family: var(--auth-font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--auth-text);
}

.auth-brand-text span {
    display: block;
    margin-top: 0.15rem;
    color: var(--auth-muted);
    font-size: 0.78rem;
}

.auth-title {
    margin: 0;
    font-family: var(--auth-font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--auth-text);
}

.auth-subtitle {
    margin: 0.5rem 0 1.75rem;
    color: var(--auth-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

@keyframes authAlertFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert {
    padding: 0.85rem 1.1rem 0.85rem 2.85rem;
    border-radius: 12px;
    border: 1px solid transparent;
    margin-bottom: 1.25rem;
    font-size: 0.86rem;
    line-height: 1.5;
    position: relative;
    font-weight: 500;
    display: flex;
    align-items: center;
    min-height: 44px;
    animation: authAlertFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transition: all 0.2s ease;
}

.auth-alert::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

.auth-alert-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), rgba(239, 68, 68, 0.02));
    border-color: rgba(239, 68, 68, 0.18);
    border-left: 4px solid var(--auth-danger);
    color: var(--auth-danger);
    box-shadow: 0 8px 20px -8px rgba(239, 68, 68, 0.08);
}

.auth-alert-error::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='15' y1='9' x2='9' y2='15'%3E%3C/line%3E%3Cline x1='9' y1='9' x2='15' y2='15'%3E%3C/line%3E%3C/svg%3E");
}

.auth-alert-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(16, 185, 129, 0.02));
    border-color: rgba(16, 185, 129, 0.18);
    border-left: 4px solid var(--auth-success);
    color: var(--auth-success);
    box-shadow: 0 8px 20px -8px rgba(16, 185, 129, 0.08);
}

.auth-alert-success::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 11.08V12a10 10 0 1 1-5.93-9.14'%3E%3C/path%3E%3Cpolyline points='22 4 12 14.01 9 11.01'%3E%3C/polyline%3E%3C/svg%3E");
}

.auth-form {
    display: grid;
    gap: 1.25rem;
}

.auth-field label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--auth-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.auth-field input {
    width: 100%;
    min-height: 46px;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--auth-border);
    background: var(--auth-input);
    color: var(--auth-text);
    font-family: inherit;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
    background-color: rgba(79, 70, 229, 0.01);
}

.auth-submit {
    width: 100%;
    min-height: 48px;
    padding: 0.85rem 1.25rem;
    border: none;
    border-radius: 12px;
    background: var(--auth-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 0.5rem;
}

.auth-submit:hover {
    background-color: #4338ca;
    transform: translateY(-1px);
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--auth-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

.auth-footer a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-link {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
    transition: all 0.2s ease;
}

.auth-link:hover {
    color: #4338ca;
    text-decoration: underline;
}

.auth-theme-toggle-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: 1px solid var(--auth-border);
    color: var(--auth-muted);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-theme-toggle-btn:hover {
    color: var(--auth-text);
    background-color: var(--auth-surface-strong);
    border-color: var(--auth-primary);
    transform: scale(1.05);
}

.auth-theme-toggle-btn svg {
    stroke: currentColor;
    fill: none;
    width: 18px;
    height: 18px;
}

.auth-validation ul {
    margin: 0.5rem 0 0 1.25rem;
    padding: 0;
}

@media (max-width: 1100px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }
    .auth-showcase {
        display: none;
    }
    .auth-panel-wrap {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-panel {
        padding: 1.75rem 1.25rem;
        border-radius: 20px;
    }
    .auth-title {
        font-size: 1.5rem;
    }
}
