/* ── Login page — animated, rich dark UI ──────────────────────── */

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

body.login-page {
    min-height: 100vh;
    background: #080a12;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    padding: 20px;
    overflow: hidden;
    position: relative;
}

/* ── Animated background ───────────────────────────────────────── */
.login-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

#loginParticles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
}
.b1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(108,99,255,.55) 0%, transparent 65%);
    top: -160px; left: -120px;
    animation: blobDrift 12s ease-in-out infinite alternate;
}
.b2 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(0,212,170,.4) 0%, transparent 65%);
    bottom: -100px; right: -80px;
    animation: blobDrift 16s ease-in-out infinite alternate-reverse;
}
.b3 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(167,139,250,.35) 0%, transparent 65%);
    top: 45%; left: 55%;
    animation: blobDrift 10s ease-in-out infinite alternate;
}
@keyframes blobDrift {
    0%   { transform: translate(0,   0)   scale(1); }
    33%  { transform: translate(30px,-20px) scale(1.05); }
    66%  { transform: translate(-20px,30px) scale(.97); }
    100% { transform: translate(15px, 15px) scale(1.03); }
}

.login-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.055) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 100%);
}

/* ── Wrap & card ───────────────────────────────────────────────── */
.login-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    animation: wrapIn .5s cubic-bezier(.4,0,.2,1) both;
}
@keyframes wrapIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo .brand {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.04em;
    color: #fff;
    text-shadow: 0 0 40px rgba(108,99,255,.5);
}
.login-logo .brand span {
    background: linear-gradient(135deg, #a78bfa, #6c63ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-logo p {
    margin-top: 7px;
    font-size: 0.8rem;
    color: rgba(255,255,255,.35);
    letter-spacing: .04em;
}

.login-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 36px 32px 32px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 0 0 1px rgba(255,255,255,.04) inset,
        0 24px 64px rgba(0,0,0,.5),
        0 4px 16px rgba(108,99,255,.12);
    position: relative;
    overflow: hidden;
}

/* Subtle shimmer line at top of card */
.login-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(167,139,250,.6), transparent);
}

.login-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
    letter-spacing: -.02em;
}
.login-card .sub {
    font-size: 0.8rem;
    color: rgba(255,255,255,.38);
    margin-bottom: 28px;
}

/* ── Fields ────────────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,.4);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 8px;
}
.field input {
    width: 100%;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    font-family: inherit;
}
.field input:focus {
    border-color: rgba(108,99,255,.7);
    background: rgba(108,99,255,.07);
    box-shadow:
        0 0 0 3px rgba(108,99,255,.2),
        0 2px 8px rgba(108,99,255,.15);
}
.field input::placeholder { color: rgba(255,255,255,.2); }

.field-error {
    color: #f87171;
    font-size: 0.73rem;
    margin-top: 5px;
    display: block;
}

/* Password wrapper */
.field-pw-wrap { position: relative; }
.field-pw-wrap input { padding-right: 46px; }
.pw-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.25);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color .15s;
    border-radius: 6px;
}
.pw-eye:hover { color: rgba(255,255,255,.7); }

/* ── Sign in button ────────────────────────────────────────────── */
.login-btn {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #6c63ff 0%, #a78bfa 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(108,99,255,.45);
    transition: opacity .15s, transform .12s, box-shadow .2s;
}
.login-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 60%);
    opacity: 0;
    transition: opacity .2s;
}
.login-btn:hover { box-shadow: 0 10px 32px rgba(108,99,255,.55); }
.login-btn:hover::before { opacity: 1; }
.login-btn:active { transform: scale(.98); }
.login-btn.loading { opacity: .8; cursor: not-allowed; }

/* ── Spinner ───────────────────────────────────────────────────── */
.login-spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255,255,255,.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error banner ──────────────────────────────────────────────── */
.login-error {
    background: rgba(248,113,113,.08);
    border: 1px solid rgba(248,113,113,.25);
    border-radius: 10px;
    padding: 11px 14px;
    margin-bottom: 20px;
    font-size: 0.8rem;
    color: #f87171;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* ── Footer ────────────────────────────────────────────────────── */
.login-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 0.75rem;
    color: rgba(255,255,255,.2);
}
