/**
 * Solo pantallas de acceso (login / primer usuario).
 * No incluir en app.css del panel: evita capas fixed/pseudo que pudieran interferir tras el redirect.
 */

html {
    height: 100%;
    scrollbar-gutter: stable;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.auth-login-body {
    margin: 0;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 4vw, 40px) 16px;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    color: #e2e8f0;
    background:
        radial-gradient(ellipse 100% 80% at 50% -20%, rgba(56, 189, 248, 0.45), transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 30%, rgba(139, 92, 246, 0.35), transparent 50%),
        radial-gradient(ellipse 60% 45% at 0% 80%, rgba(34, 211, 238, 0.22), transparent 45%),
        linear-gradient(168deg, #020617 0%, #0c1222 35%, #1e1b4b 70%, #0f172a 100%);
}

/* Fondo decorativo estático (sin rotación): evita parpadeo / “salto” al recargar y menos trabajo del GPU */
.auth-login-aurora {
    position: absolute;
    inset: -20%;
    z-index: 0;
    background: conic-gradient(
        from 210deg at 50% 50%,
        rgba(56, 189, 248, 0.15),
        rgba(129, 140, 248, 0.2),
        rgba(192, 132, 252, 0.15),
        rgba(34, 211, 238, 0.12),
        rgba(56, 189, 248, 0.15)
    );
    pointer-events: none;
}

.auth-login-noise {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.04;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.auth-login-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.auth-login-shell--wide {
    max-width: 520px;
}

.auth-login-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-login-badge {
    display: inline-block;
    margin: 0 0 14px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #bae6fd;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 999px;
}

.auth-login-brand {
    margin: 0;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: clamp(2rem, 6vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: #f8fafc;
    text-shadow: 0 0 60px rgba(56, 189, 248, 0.35);
}

.auth-login-brand-plus {
    background: linear-gradient(120deg, #38bdf8 0%, #a78bfa 45%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

.auth-login-tagline {
    margin: 14px 0 0;
    font-size: 15px;
    font-weight: 500;
    color: #94a3b8;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.45;
}

.auth-login-card {
    position: relative;
    padding: clamp(22px, 4vw, 32px);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04) inset,
        0 24px 48px -12px rgba(0, 0, 0, 0.55),
        0 0 80px -20px rgba(56, 189, 248, 0.15);
}

.auth-login-card-head {
    margin-bottom: 22px;
}

.auth-login-title {
    margin: 0;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #f1f5f9;
}

.auth-login-sub {
    margin: 6px 0 0;
    font-size: 14px;
    color: #94a3b8;
}

.auth-login-alert {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: 14px;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fecaca;
}

.auth-login-alert-icon {
    flex-shrink: 0;
    margin-top: 2px;
    opacity: 0.95;
}

.auth-login-alert-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #fecaca;
}

.auth-login-alert-msg {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: #fca5a5;
}

.auth-login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.auth-field-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 4px 4px 14px;
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid rgba(71, 85, 105, 0.5);
}

.auth-field-input-wrap:focus-within {
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
    background: rgba(2, 6, 23, 0.75);
}

.auth-field-icon {
    display: flex;
    color: #64748b;
    flex-shrink: 0;
}

.auth-field-input-wrap:focus-within .auth-field-icon {
    color: #38bdf8;
}

.auth-field-input {
    flex: 1;
    min-width: 0;
    padding: 14px 14px 14px 0;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 15px;
    color: #f1f5f9;
    outline: none;
}

.auth-field-input::placeholder {
    color: #475569;
}

.auth-login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 6px;
    padding: 16px 22px;
    border: none;
    border-radius: 14px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.12) inset,
        0 4px 16px rgba(37, 99, 235, 0.45),
        0 12px 32px -8px rgba(79, 70, 229, 0.5);
    transition: box-shadow 0.18s ease, filter 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {
    .auth-login-submit:hover {
        transform: translateY(-2px);
    }
}

.auth-login-submit:hover {
    filter: brightness(1.06);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 8px 24px rgba(37, 99, 235, 0.5),
        0 20px 40px -10px rgba(124, 58, 237, 0.45);
}

.auth-login-submit:active {
    transform: translateY(0);
}

a.auth-login-submit--link {
    text-decoration: none;
    box-sizing: border-box;
    text-align: center;
}

a.auth-login-submit--link .auth-login-submit-arrow {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .auth-login-submit:hover .auth-login-submit-arrow {
        transform: translateX(4px);
    }
}

.auth-login-footer {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(51, 65, 85, 0.6);
    text-align: center;
}

.auth-login-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #7dd3fc;
    text-decoration: none;
}

.auth-login-link:hover {
    color: #bae6fd;
}

@media (hover: hover) and (pointer: fine) {
    .auth-login-link:hover {
        transform: translateY(-1px);
    }
}

.auth-login-legal {
    margin: 24px 0 0;
    text-align: center;
    font-size: 12px;
    color: #64748b;
    letter-spacing: 0.02em;
}

@media (prefers-reduced-motion: reduce) {
    .auth-login-submit:hover,
    .auth-login-submit:hover .auth-login-submit-arrow,
    .auth-login-link:hover {
        transform: none !important;
    }
}
