/* ==========================================================================
   Autenticación y páginas simples (login, recuperar/restablecer, home).
   Skin moderno, profesional y CSP-safe (self-hosted, sin build, sin fuentes
   externas). Tema claro/oscuro automático. Comparte lenguaje visual con el
   panel (admin.css): índigo→violeta, tipografía del sistema, tarjetas suaves.
   ========================================================================== */

:root {
    --accent: #4f46e5;
    --accent-600: #4338ca;
    --accent-2: #7c3aed;
    --accent-soft: #eef2ff;
    --bg: #eef1f8;
    --surface: #ffffff;
    --text: #1e293b;
    --text-soft: #64748b;
    --border: #e6e9f0;
    --danger: #e11d48;
    --success: #16a34a;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(15,23,42,.05), 0 18px 50px -12px rgba(30,27,75,.22);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #070b16;
        --surface: #111a2e;
        --text: #e2e8f0;
        --text-soft: #94a3b8;
        --border: #1e293b;
        --accent-soft: #1e2749;
        --shadow: 0 1px 2px rgba(0,0,0,.3), 0 24px 60px -12px rgba(0,0,0,.55);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    /* Malla de gradientes sutil (marca) */
    background-image:
        radial-gradient(60rem 40rem at 15% -10%, rgba(79,70,229,.16), transparent 60%),
        radial-gradient(50rem 40rem at 100% 0%, rgba(124,58,237,.14), transparent 55%),
        radial-gradient(50rem 40rem at 50% 120%, rgba(37,99,235,.10), transparent 55%);
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: 460px;
    margin: 0 auto;
    padding: clamp(1.5rem, 6vh, 4rem) 1.25rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

a { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

h1 { margin: 0; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
p { color: var(--text-soft); margin: .4rem 0 0; }
code { background: var(--accent-soft); color: var(--accent); padding: .1rem .4rem; border-radius: 6px; font-size: .85em; }

/* --- Tarjeta ------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    animation: card-in .5s cubic-bezier(.16,.84,.44,1) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }

.badge {
    display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em;
    text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
    border-radius: 999px; padding: .25rem .7rem;
}

/* --- Marca y cabecera de login ------------------------------------------ */
.auth-brand { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.5rem; }
.auth-logo {
    width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
    font-size: 1.25rem; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 20px -6px rgba(79,70,229,.6);
}
.auth-brand__name { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.auth-head { margin-bottom: 1.5rem; }
.auth-head h1 { font-size: 1.6rem; }

/* --- Formularios --------------------------------------------------------- */
label { display: block; margin: 1rem 0 0; font-size: .85rem; font-weight: 600; color: var(--text); }
input[type=text], input[type=email], input[type=password], select {
    display: block; width: 100%; margin-top: .4rem; padding: .7rem .85rem; font-size: .95rem;
    color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--text-soft); opacity: .6; }
input:focus, select:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}

/* --- Botón --------------------------------------------------------------- */
button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    margin-top: 1.5rem; padding: .75rem 1.25rem; border: 0; border-radius: 10px; cursor: pointer;
    color: #fff; font-size: .95rem; font-weight: 700; font-family: inherit; text-decoration: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 24px -10px rgba(79,70,229,.8); transition: transform .06s, box-shadow .15s, filter .15s;
}
button:hover, .btn:hover { filter: brightness(1.05); text-decoration: none; }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
.btn-block { width: 100%; }

/* --- Flashes ------------------------------------------------------------- */
.flash { margin: 1rem 0 0; padding: .75rem 1rem; border-radius: 10px; font-size: .9rem; border: 1px solid transparent; }
.flash-success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.flash-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* --- Enlaces auxiliares y pie ------------------------------------------- */
.auth-alt { margin-top: 1.5rem; font-size: .9rem; text-align: center; color: var(--text-soft); }
footer { margin-top: 2rem; font-size: .78rem; color: var(--text-soft); text-align: center; }
