/*
 * Pantallas de acceso de allauth (entrar con código, crear cuenta, confirmar el correo) y de error
 * (templates/errors/_layout.html: 400, 403, 404, 429, 500 y formulario vencido).
 * Mismo look oscuro que la portada (login-landing.css). Los formularios los pinta allauth con
 * form.as_p, por eso se estilizan las etiquetas directamente dentro de .auth-card.
 */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: #000;
    color: #f5f5f7;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 3rem 1rem;
    overflow: hidden;
}

.auth-shell::before {
    content: '';
    position: absolute;
    top: -30%;
    left: 50%;
    width: 760px;
    height: 760px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    transform: translateX(-50%);
    pointer-events: none;
}

.auth-brand {
    position: relative;
    margin-bottom: 1.75rem;
    color: #10b981;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-decoration: none;
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    padding: 2rem 1.75rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    background: #0d0f0e;
}

.auth-card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.auth-card > p,
.auth-card form > p:not(:has(input)) {
    margin: 0 0 1.25rem;
    color: #a1a1a6;
    font-size: 0.93rem;
    line-height: 1.55;
}

.auth-card a { color: #6ee7b7; }

/* Campos (form.as_p): etiqueta arriba, input a lo ancho */
.auth-card form { margin: 0; }
.auth-card form p { margin: 0 0 1rem; }

.auth-card label {
    display: block;
    margin-bottom: 0.4rem;
    color: #a1a1a6;
    font-size: 0.8rem;
    font-weight: 600;
}

.auth-card input[type="email"],
.auth-card input[type="text"],
.auth-card input[type="password"] {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    color: #f5f5f7;
    font-family: inherit;
    font-size: 1rem;
}

/* El código se lee mejor grande y espaciado */
.auth-card input[name="code"] {
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: 1.5rem;
    letter-spacing: 0.4em;
    text-align: center;
}

.auth-card input:focus {
    border-color: #10b981;
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.auth-card .helptext,
.auth-card form p span { display: block; margin-top: 0.35rem; color: #6e6e73; font-size: 0.78rem; }

.auth-card .errorlist {
    margin: 0 0 0.6rem;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    font-size: 0.85rem;
    list-style: none;
}

/* Botones: is-prominent = acción principal; outline/cancel/link = secundarias */
.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.85rem 1.25rem;
    border: none;
    border-radius: 980px;
    background: #10b981;
    color: #fff;
    font-family: inherit;
    font-size: 0.97rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-btn:hover { background: #059669; color: #fff; }

/* Un botón que es link no toma el color de los links de la tarjeta */
.auth-card a.auth-btn { color: #fff; }
.auth-card a.auth-btn.is-link { color: #6ee7b7; }
.auth-card a.auth-btn.is-outline { color: #f5f5f7; }

.auth-btn.is-outline,
.auth-btn.is-cancel {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: transparent;
    color: #f5f5f7;
}

.auth-btn.is-outline:hover,
.auth-btn.is-cancel:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }

.auth-btn.is-link {
    width: auto;
    padding: 0.5rem 0;
    background: none;
    color: #6ee7b7;
    font-size: 0.88rem;
}

.auth-btn.is-link:hover { background: none; text-decoration: underline; }
.auth-btn.is-google { margin-top: 0.75rem; }

.auth-card form > div { display: flex; flex-direction: column; gap: 0.6rem; }

.auth-card details { margin-top: 1rem; color: #a1a1a6; font-size: 0.88rem; }
.auth-card summary { cursor: pointer; }

.auth-switch {
    margin: 1.25rem 0 0;
    color: #86868b;
    font-size: 0.85rem;
    text-align: center;
}

.auth-switch a { font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

.auth-messages { margin: 0 0 1rem; padding: 0; list-style: none; }

.auth-message {
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    font-size: 0.87rem;
    line-height: 1.45;
}

.auth-message + .auth-message { margin-top: 0.5rem; }
.auth-message.is-error { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }

.auth-help {
    position: relative;
    margin: 1.5rem 0 0;
    color: #6e6e73;
    font-size: 0.78rem;
    text-align: center;
}

.auth-help a { color: #a1a1a6; }

@media (max-width: 480px) {
    .auth-card { padding: 1.5rem 1.25rem; border-radius: 20px; }
    .auth-card h1 { font-size: 1.4rem; }
}

.auth-lead strong { color: #f5f5f7; font-weight: 600; word-break: break-all; }

/* Pantallas de error */
.error-card { text-align: center; }

.auth-card .error-code {
    margin: 0 0 0.5rem;
    color: #10b981;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.error-actions { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; margin-top: 0.5rem; }
