:root {
    --auth-tarjeta-bg: #ffffff;
    --auth-texto: #111827;
    --auth-subtitulo: #6b7280;
    --auth-label: #374151;
    --auth-input-bg: #ffffff;
    --auth-input-borde: #d1d5db;
    --auth-mensaje-error-bg: #fee2e2; --auth-mensaje-error-fg: #991b1b;
    --auth-mensaje-exito-bg: #dcfce7; --auth-mensaje-exito-fg: #166534;
}
:root[data-theme="dark"] {
    --auth-tarjeta-bg: #161d2e;
    --auth-texto: #e5e7eb;
    --auth-subtitulo: #9ca3af;
    --auth-label: #cbd5e1;
    --auth-input-bg: #101728;
    --auth-input-borde: #3a4358;
    --auth-mensaje-error-bg: #3d1414; --auth-mensaje-error-fg: #fca5a5;
    --auth-mensaje-exito-bg: #103524; --auth-mensaje-exito-fg: #6ee7a0;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --auth-tarjeta-bg: #161d2e;
        --auth-texto: #e5e7eb;
        --auth-subtitulo: #9ca3af;
        --auth-label: #cbd5e1;
        --auth-input-bg: #101728;
        --auth-input-borde: #3a4358;
        --auth-mensaje-error-bg: #3d1414; --auth-mensaje-error-fg: #fca5a5;
        --auth-mensaje-exito-bg: #103524; --auth-mensaje-exito-fg: #6ee7a0;
    }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: light dark; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #0B2447 0%, #19376D 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.btn-tema-auth {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}
.btn-tema-auth:hover { background: rgba(255,255,255,0.25); }

.auth-card {
    background: var(--auth-tarjeta-bg);
    color: var(--auth-texto);
    width: 100%;
    max-width: 380px;
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}

.auth-card h1 {
    font-size: 22px;
    color: #4a7fd6;
    margin-bottom: 4px;
    text-align: center;
}
:root:not([data-theme="dark"]) .auth-card h1 { color: #0B2447; }

.auth-card p.subtitulo {
    color: var(--auth-subtitulo);
    text-align: center;
    font-size: 13px;
    margin-bottom: 24px;
}

.campo { margin-bottom: 16px; }

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

.campo input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--auth-input-borde);
    border-radius: 8px;
    font-size: 14px;
    background: var(--auth-input-bg);
    color: var(--auth-texto);
    transition: border-color .15s;
}

.campo input:focus {
    outline: none;
    border-color: #19376D;
    box-shadow: 0 0 0 3px rgba(25,55,109,0.25);
}

.btn-primario {
    width: 100%;
    background: #0B2447;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.btn-primario:hover { background: #19376D; }

.mensaje {
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
}

.mensaje.error   { background: var(--auth-mensaje-error-bg); color: var(--auth-mensaje-error-fg); }
.mensaje.exito   { background: var(--auth-mensaje-exito-bg); color: var(--auth-mensaje-exito-fg); }

.enlace-secundario {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
}

.enlace-secundario a {
    color: #6ea8fe;
}
:root:not([data-theme="dark"]) .enlace-secundario a { color: #19376D; }

.enlace-secundario a:hover { text-decoration: underline; }

@media (max-width: 420px) {
    .auth-card { padding: 32px 22px; }
}
