/* ============================================================
   LOGIN PAGE — Ultra-Premium Dark Glassmorphism v4.0
   Aurora Borealis + Noise + Mesh Gradient + 3D Card
   ============================================================ */

/* ── Design Tokens ──────────────────────────────────── */
:root {
    --primary: #7c3aed;
    --primary-mid: #6d28d9;
    --primary-dark: #4c1d95;
    --primary-glow: rgba(124, 58, 237, 0.4);

    --accent: #06b6d4;
    --accent-glow: rgba(6, 182, 212, 0.3);

    --pink: #ec4899;
    --pink-glow: rgba(236, 72, 153, 0.35);

    --bg-void: #030014;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    /* Increased brightness */
    --text-dim: #64748b;
    /* Increased brightness from #334155 */

    --glass-bg: rgba(255, 255, 255, 0.025);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-blur: 32px;

    --input-bg: rgba(0, 0, 0, 0.4);
    --input-border: rgba(255, 255, 255, 0.06);
    --input-focus: rgba(124, 58, 237, 0.5);

    --error-bg: rgba(239, 68, 68, 0.08);
    --error-border: rgba(239, 68, 68, 0.2);
    --error-text: #fca5a5;

    --radius: 20px;
    --radius-sm: 14px;
    --radius-xs: 10px;

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset ──────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Outfit', 'Inter', system-ui, sans-serif;
    background: var(--bg-void);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════
   BACKGROUND SYSTEM — Multi-Layer Aurora
   ═══════════════════════════════════════════════════════ */

.ambient-light {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Aurora Orbs — rich, saturated, slow-floating */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    will-change: transform, opacity;
    mix-blend-mode: screen;
}

.orb-1 {
    top: -25%;
    left: -20%;
    width: 70vw;
    height: 70vw;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.5) 0%, rgba(124, 58, 237, 0) 70%);
    animation: aurora1 25s ease-in-out infinite;
}

.orb-2 {
    bottom: -30%;
    right: -15%;
    width: 65vw;
    height: 65vw;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.4) 0%, rgba(236, 72, 153, 0) 70%);
    animation: aurora2 30s ease-in-out infinite;
}

.orb-3 {
    top: 20%;
    right: 25%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.3) 0%, rgba(6, 182, 212, 0) 70%);
    animation: aurora3 20s ease-in-out infinite;
}

@keyframes aurora1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }

    25% {
        transform: translate(80px, -40px) scale(1.15);
        opacity: 0.8;
    }

    50% {
        transform: translate(30px, 60px) scale(0.95);
        opacity: 0.5;
    }

    75% {
        transform: translate(-50px, 20px) scale(1.08);
        opacity: 0.7;
    }
}

@keyframes aurora2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }

    30% {
        transform: translate(-60px, -80px) scale(1.12);
        opacity: 0.7;
    }

    60% {
        transform: translate(40px, -30px) scale(0.9);
        opacity: 0.4;
    }

    85% {
        transform: translate(-20px, 50px) scale(1.05);
        opacity: 0.6;
    }
}

@keyframes aurora3 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.35;
    }

    33% {
        transform: translate(-40px, 30px) scale(1.1);
        opacity: 0.5;
    }

    66% {
        transform: translate(50px, -40px) scale(0.88);
        opacity: 0.3;
    }
}

/* Grid overlay — subtle perspective grid */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 60% 55% at 50% 50%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 50%, black 20%, transparent 100%);
    animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* Floating particles — stardust effect */
.particle {
    position: absolute;
    border-radius: 50%;
    background: white;
    animation: stardust var(--dur, 12s) var(--delay, 0s) infinite linear;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

@keyframes stardust {
    0% {
        transform: translateY(110vh) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.3;
    }

    90% {
        opacity: 0.1;
    }

    100% {
        transform: translateY(-15vh) scale(1.2);
        opacity: 0;
    }
}

/* Noise texture overlay */
.ambient-light::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    opacity: 0.4;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   LOGIN CARD — Frosted Glass + Glow Border
   ═══════════════════════════════════════════════════════ */

.login-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 440px;
    padding: 1.25rem;
    perspective: 800px;
}

.login-card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2.75rem 2.5rem 2.25rem;
    position: relative;
    overflow: hidden;

    /* Entrance animation */
    opacity: 0;
    transform: translateY(40px) scale(0.96);
    animation: cardEntrance 0.9s var(--ease-spring) 0.15s forwards;

    /* Glow shadow */
    box-shadow:
        0 0 0 1px rgba(124, 58, 237, 0.08),
        0 20px 60px -10px rgba(0, 0, 0, 0.7),
        0 0 80px -20px var(--primary-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);

    transition: box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}

.login-card:hover {
    box-shadow:
        0 0 0 1px rgba(124, 58, 237, 0.15),
        0 25px 70px -10px rgba(0, 0, 0, 0.8),
        0 0 100px -15px var(--primary-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@keyframes cardEntrance {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Top edge highlight — animated gradient border */
.login-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--primary) 20%,
            var(--accent) 50%,
            var(--pink) 80%,
            transparent 100%);
    background-size: 200% 100%;
    animation: borderShimmer 4s ease infinite;
    opacity: 0.7;
}

@keyframes borderShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Hover light sweep */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.03),
            rgba(255, 255, 255, 0.05),
            rgba(255, 255, 255, 0.03),
            transparent);
    pointer-events: none;
    transition: left 0.9s var(--ease);
    z-index: 1;
}

.login-card:hover::before {
    left: 150%;
}

/* ═══════════════════════════════════════════════════════
   BRAND HEADER — Logo + Badge
   ═══════════════════════════════════════════════════════ */

.brand-header {
    text-align: center;
    margin-bottom: 2.25rem;
    position: relative;
    z-index: 2;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow:
        0 8px 32px var(--primary-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    margin-bottom: 1.25rem;
    font-size: 2rem;
    animation: iconFloat 6s ease-in-out infinite;
    position: relative;
}

/* Pulse ring behind icon */
.brand-icon::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 28px;
    border: 2px solid rgba(124, 58, 237, 0.2);
    animation: pulseRing 3s ease-in-out infinite;
}

@keyframes pulseRing {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.12);
        opacity: 0;
    }
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.brand-logo {
    display: block;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, #ffffff 0%, #a78bfa 50%, #06b6d4 100%);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.brand-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    /* Brighter than dim */
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
    padding: 5px 16px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.12);
    border-radius: 100px;
}

/* ═══════════════════════════════════════════════════════
   ERROR MESSAGE
   ═══════════════════════════════════════════════════════ */

.error-msg {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
    padding: 0.9rem 1.15rem;
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    animation: errorSlideIn 0.4s var(--ease-spring);
    position: relative;
    z-index: 2;
    backdrop-filter: blur(8px);
}

.error-msg i {
    flex-shrink: 0;
    font-size: 1rem;
    animation: errorPulse 2s ease-in-out infinite;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes errorPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ═══════════════════════════════════════════════════════
   FORM FIELDS — Floating Labels + Glow
   ═══════════════════════════════════════════════════════ */

.field {
    position: relative;
    margin-bottom: 1.25rem;
    z-index: 2;
}

.field-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    /* Brighter than dim */
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
    transition: color 0.3s var(--ease);
}

.field:focus-within .field-label {
    color: var(--primary);
}

.field-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    padding: 0.95rem 1rem 0.95rem 3.25rem;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 400;
    outline: none;
    transition:
        border-color 0.3s var(--ease),
        box-shadow 0.3s var(--ease),
        background 0.3s var(--ease);
}

.field-input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}

.field-input:focus {
    background: rgba(0, 0, 0, 0.55);
    border-color: rgba(124, 58, 237, 0.6);
    box-shadow:
        0 0 0 4px rgba(124, 58, 237, 0.1),
        0 0 20px -5px rgba(124, 58, 237, 0.25);
}

/* Input underline glow */
.field::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    transition: width 0.4s var(--ease), left 0.4s var(--ease);
    z-index: 3;
}

.field:focus-within::after {
    width: 92%;
    left: 4%;
}

.field-icon {
    position: absolute;
    left: 1.15rem;
    bottom: 1rem;
    color: var(--text-dim);
    font-size: 1rem;
    transition: color 0.3s var(--ease), transform 0.3s var(--ease);
    pointer-events: none;
}

.field-input:focus~.field-icon {
    color: var(--primary);
    transform: scale(1.1);
}

/* Password toggle */
.field-toggle {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    color: var(--text-dim);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.25s, transform 0.25s;
    line-height: 1;
    z-index: 3;
}

.field-toggle:hover {
    color: var(--text-muted);
    transform: scale(1.15);
}

/* ═══════════════════════════════════════════════════════
   SUBMIT BUTTON — Gradient + Animated Glow
   ═══════════════════════════════════════════════════════ */

.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: 1.05rem;
    margin-top: 1.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, var(--primary-mid) 100%);
    background-size: 200% 200%;
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 2;

    box-shadow:
        0 4px 24px var(--primary-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition:
        transform 0.25s var(--ease),
        box-shadow 0.25s var(--ease),
        background-position 0.4s var(--ease);

    animation: btnGradient 5s ease infinite;
}

@keyframes btnGradient {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 40px rgba(124, 58, 237, 0.5),
        0 0 60px -10px rgba(124, 58, 237, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-login:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-login:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

/* Shimmer sweep on button */
.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.15),
            transparent);
    animation: btnShimmer 3s ease-in-out infinite;
}

@keyframes btnShimmer {
    0% {
        left: -100%;
    }

    50% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* Ripple on click */
.btn-login .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════
   FOOTER — Minimal
   ═══════════════════════════════════════════════════════ */

.card-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-muted);
    /* Brighter than dim */
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 2;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .login-card {
        padding: 2.25rem 1.75rem 2rem;
        border-radius: 16px;
    }

    .brand-logo {
        font-size: 2rem;
    }

    .brand-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }

    .orb {
        filter: blur(80px);
    }
}

/* ═══════════════════════════════════════════════════════
   ACCESSIBILITY
   ═══════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .login-card {
        opacity: 1;
        transform: none;
    }
}

/* Focus visible for keyboard nav */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.field-input:focus-visible {
    outline: none;
    /* uses the box-shadow focus ring instead */
}