
/* Card border glow animation */
@keyframes loginGlow {
  0%, 100% { border-color: rgba(124,90,247,.15); box-shadow: 0 8px 60px rgba(0,0,0,.5), 0 0 40px rgba(124,90,247,.03); }
  50%      { border-color: rgba(56,189,248,.15); box-shadow: 0 8px 60px rgba(0,0,0,.5), 0 0 40px rgba(56,189,248,.04); }
}
/* ══════════════════════════════════════════════════════════════════════════════
   Login Page — Greeks Dashboard
   Premium glassmorphism card on animated dark gradient
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Reset & base ─────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg1, #06080f);
    background-image: radial-gradient(ellipse at 20% 50%, rgba(124,90,247,.06) 0%, transparent 50%), radial-gradient(ellipse at 80% 20%, rgba(56,189,248,.05) 0%, transparent 50%), radial-gradient(ellipse at 50% 80%, rgba(168,85,247,.04) 0%, transparent 50%);
    color: var(--text, #c8d0e0);
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CSS-only animated glow orbs (replaces heavy canvas animation) */
body::after {
    content: '';
    position: fixed;
    inset: -50%;
    width: 200%;
    height: 200%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 300px 300px at 20% 30%, color-mix(in srgb, var(--accent, #38bdf8) 6%, transparent) 0%, transparent 70%),
        radial-gradient(ellipse 350px 350px at 80% 70%, rgba(168, 85, 247, .05) 0%, transparent 70%),
        radial-gradient(ellipse 250px 250px at 50% 50%, rgba(34, 197, 94, .04) 0%, transparent 70%);
    animation: orb-drift 20s ease-in-out infinite alternate;
    will-change: transform;
}

@keyframes orb-drift {
    0% {
        transform: translate(0, 0);
    }

    33% {
        transform: translate(3%, -2%);
    }

    66% {
        transform: translate(-2%, 3%);
    }

    100% {
        transform: translate(1%, -1%);
    }
}

/* ── Canvas background ────────────────────────────────────────────────────── */
#grid-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ── Particles ────────────────────────────────────────────────────────────── */
.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    bottom: -10px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent, #38bdf8) 60%, transparent);
    animation: float-up linear infinite;
}

@keyframes float-up {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-110vh) scale(0.3);
        opacity: 0;
    }
}

/* ── Login wrapper ────────────────────────────────────────────────────────── */
.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    animation: card-in .8s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes card-in {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Glassmorphism card ───────────────────────────────────────────────────── */
.login-card {
    animation: loginGlow 6s ease-in-out infinite;
    background: color-mix(in srgb, var(--bg2, #0c101c) 85%, transparent);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid color-mix(in srgb, var(--accent, #38bdf8) 10%, transparent);
    border-radius: 20px;
    padding: 44px 36px 32px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, .03),
        0 8px 40px rgba(0, 0, 0, .5),
        0 0 80px color-mix(in srgb, var(--accent, #38bdf8) 4%, transparent);
    transition: border-color .3s, box-shadow .3s;
}

.login-card:hover {
    border-color: rgba(56, 189, 248, .18);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, .05),
        0 12px 50px rgba(0, 0, 0, .6),
        0 0 100px color-mix(in srgb, var(--accent, #38bdf8) 6%, transparent);
}

/* Top glow line */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            color-mix(in srgb, var(--accent, #38bdf8) 40%, transparent) 30%,
            color-mix(in srgb, var(--accent2, #a855f7) 40%, transparent) 70%,
            transparent);
}

/* ── Brand ────────────────────────────────────────────────────────────────── */
.brand {
    text-align: center;
    margin-bottom: 36px;
}

.brand-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    animation: icon-glow 3s ease-in-out infinite alternate;
}

@keyframes icon-glow {
    0% {
        filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent, #38bdf8) 30%, transparent));
    }

    100% {
        filter: drop-shadow(0 0 14px color-mix(in srgb, var(--accent2, #a855f7) 40%, transparent));
    }
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.02em;
    background: linear-gradient(135deg, #e0e8f0, var(--accent, #38bdf8) 60%, var(--accent2, #a855f7));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-sub {
    font-size: .78rem;
    color: rgba(148, 163, 194, .7);
    margin-top: 4px;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-weight: 500;
}

/* ── Inputs ───────────────────────────────────────────────────────────────── */
.input-group {
    position: relative;
    margin-bottom: 24px;
}

.input-group input {
    width: 100%;
    background: color-mix(in srgb, var(--bg2, #0f1423) 60%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent, #38bdf8) 8%, transparent);
    border-radius: 12px;
    padding: 20px 16px 8px;
    font-family: 'Inter', sans-serif;
    font-size: .92rem;
    color: #e0e8f0;
    outline: none;
    transition: border-color .3s, background .3s, box-shadow .3s;
}

/* Password visibility toggle */
.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: .4;
    transition: opacity .2s;
    padding: 4px;
    z-index: 2;
}

.pw-toggle:hover {
    opacity: .8;
}

.input-group input:focus {
    border-color: color-mix(in srgb, var(--accent, #38bdf8) 35%, transparent);
    background: color-mix(in srgb, var(--bg2, #0f1423) 80%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #38bdf8) 6%, transparent);
}

.input-group label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: .88rem;
    color: rgba(148, 163, 194, .5);
    pointer-events: none;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
}

.input-group input:focus+label,
.input-group input:not(:placeholder-shown)+label {
    top: 6px;
    transform: translateY(0);
    font-size: .68rem;
    color: color-mix(in srgb, var(--accent, #38bdf8) 70%, transparent);
    letter-spacing: .04em;
    font-weight: 600;
}

.input-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent, #38bdf8), var(--accent2, #a855f7));
    border-radius: 1px;
    transition: width .3s, left .3s;
}

.input-group input:focus~.input-line {
    width: 100%;
    left: 0;
}

/* ── Form meta (remember / forgot) ────────────────────────────────────────── */
.form-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    font-size: .78rem;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(148, 163, 194, .6);
    cursor: pointer;
    user-select: none;
}

.remember input {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 1.5px solid color-mix(in srgb, var(--accent, #38bdf8) 20%, transparent);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, background .2s;
}

.remember input:checked+.checkmark {
    background: color-mix(in srgb, var(--accent, #38bdf8) 20%, transparent);
    border-color: color-mix(in srgb, var(--accent, #38bdf8) 60%, transparent);
}

.remember input:checked+.checkmark::after {
    content: '✓';
    font-size: 10px;
    color: var(--accent, #38bdf8);
}

.forgot {
    color: color-mix(in srgb, var(--accent, #38bdf8) 50%, transparent);
    text-decoration: none;
    transition: color .2s;
}

.forgot:hover {
    color: color-mix(in srgb, var(--accent, #38bdf8) 90%, transparent);
}

/* ── Submit button ────────────────────────────────────────────────────────── */
.login-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #38bdf8) 20%, var(--bg2, #1a2d4a)) 0%, var(--bg2, #1a2d4a) 50%, color-mix(in srgb, var(--accent, #38bdf8) 20%, var(--bg2, #1a2d4a)) 100%);
    color: var(--accent, #38bdf8);
    border: 1px solid color-mix(in srgb, var(--accent, #38bdf8) 15%, transparent);
    transition: all .3s;
    letter-spacing: .02em;
}

.login-btn:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #38bdf8) 25%, var(--bg2, #1a2d4a)) 0%, color-mix(in srgb, var(--accent, #38bdf8) 15%, var(--bg2, #1a3560)) 50%, color-mix(in srgb, var(--accent, #38bdf8) 25%, var(--bg2, #1a2d4a)) 100%);
    border-color: color-mix(in srgb, var(--accent, #38bdf8) 30%, transparent);
    box-shadow: 0 4px 20px color-mix(in srgb, var(--accent, #38bdf8) 15%, transparent);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

/* Button shimmer */
.login-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            color-mix(in srgb, var(--accent, #38bdf8) 8%, transparent),
            transparent);
    animation: shimmer 3s ease infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

/* Loading state */
.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-spinner {
    display: inline-block;
}

.btn-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid color-mix(in srgb, var(--accent, #38bdf8) 20%, transparent);
    border-top-color: var(--accent, #38bdf8);
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ── Error message ────────────────────────────────────────────────────────── */
.error-msg {
    text-align: center;
    color: #ef4444;
    font-size: .82rem;
    margin-top: 14px;
    min-height: 20px;
}

/* ── Shake animation ──────────────────────────────────────────────────────── */
.shake {
    animation: shake .4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-6px);
    }

    80% {
        transform: translateX(6px);
    }
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid color-mix(in srgb, var(--accent, #38bdf8) 6%, transparent);
    font-size: .72rem;
    color: rgba(148, 163, 194, .35);
    letter-spacing: .03em;
}

/* ── Page fade-out transition ─────────────────────────────────────────────── */
body.fade-out {
    animation: fade-scale-out .6s cubic-bezier(.4, 0, .2, 1) forwards;
}

@keyframes fade-scale-out {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.02);
        filter: blur(4px);
    }
}
/* Enhanced input focus */
.input-group input:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #38bdf8) 15%, transparent);
}

/* Submit button gradient shine */
.login-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.1) 50%, transparent 100%);
  transition: left .5s;
}
.login-btn:hover::after {
  left: 100%;
}
.login-btn {
  position: relative;
  overflow: hidden;
}
