/* ── Reset ─────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0b0e14;
    --surface: #13171f;
    --surface2: #1a1f2a;
    --border: #252b38;
    --border-bright: #2e3748;
    --text: #e2e8f2;
    --text-muted: #6b7a96;
    --text-dim: #3a4558;
    --accent-blue: #4d9ef6;
    --accent-blue-dim: #1a3a5c;
    --accent-green: #3dd68c;
    --accent-green-dim: #0d3d26;
    --accent-purple: #9b7ff4;
    --accent-red: #f06a6a;
    --font-display: 'Syne', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

html,
body {
    height: 100%;
    font-family: var(--font-display);
    background: var(--bg);
    color: var(--text);
    overflow: hidden;
}

/* ── Canvas background ─────────────────────────────── */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* ── Grid overlay ──────────────────────────────────── */
.grid-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(77, 158, 246, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(77, 158, 246, .03) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {

    0%,
    100% {
        opacity: .6;
    }

    50% {
        opacity: 1;
    }
}

/* ── Glows ─────────────────────────────────────────── */
.glow-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 1;
}

.glow-blob.blue {
    width: 500px;
    height: 500px;
    background: rgba(77, 158, 246, .08);
    top: -100px;
    left: -100px;
    animation: blobMove1 12s ease-in-out infinite;
}

.glow-blob.green {
    width: 400px;
    height: 400px;
    background: rgba(61, 214, 140, .06);
    bottom: -80px;
    right: -80px;
    animation: blobMove2 15s ease-in-out infinite;
}

.glow-blob.purple {
    width: 300px;
    height: 300px;
    background: rgba(155, 127, 244, .05);
    top: 50%;
    right: 20%;
    animation: blobMove3 10s ease-in-out infinite;
}

@keyframes blobMove1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(60px, 40px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 70px) scale(.95);
    }
}

@keyframes blobMove2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(-50px, -30px) scale(1.08);
    }

    66% {
        transform: translate(40px, -60px) scale(.93);
    }
}

@keyframes blobMove3 {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-40px) scale(1.05);
    }
}

/* ── Layout ────────────────────────────────────────── */
.login-shell {
    position: relative;
    z-index: 10;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ── Card ──────────────────────────────────────────── */
.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(19, 23, 31, .85);
    border: 1px solid var(--border-bright);
    border-radius: 20px;
    padding: 40px 40px 36px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 0 0 1px rgba(77, 158, 246, .08),
        0 32px 64px rgba(0, 0, 0, .5),
        0 0 80px rgba(77, 158, 246, .06);
    animation: cardIn .6s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(28px) scale(.97);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ── Logo area ─────────────────────────────────────── */
.logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 32px;
}

.logo-img-wrap {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: var(--accent-blue-dim);
    border: 1px solid rgba(77, 158, 246, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 32px rgba(77, 158, 246, .18);
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {

    0%,
    100% {
        box-shadow: 0 0 24px rgba(77, 158, 246, .15);
    }

    50% {
        box-shadow: 0 0 40px rgba(77, 158, 246, .32);
    }
}

/* Shimmer sweep across logo */
.logo-img-wrap::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: linear-gradient(105deg,
            transparent 40%,
            rgba(255, 255, 255, .12) 50%,
            transparent 60%);
    animation: shimmer 4s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        left: -75%;
    }

    60%,
    100% {
        left: 130%;
    }
}

/* Logo image — replace src with your actual logo */
.logo-img-wrap img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    display: block;
    /* If no image, the default SVG icon shows instead */
}

.logo-img-wrap img.hidden {
    display: none;
}

.logo-img-wrap .logo-default-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-img-wrap .logo-default-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--accent-blue);
}

.brand-name {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--text);
}

.brand-tagline {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
    letter-spacing: .06em;
}

/* Animated dots in tagline */
.typing-dots::after {
    content: '';
    animation: typeDots 1.5s steps(4, end) infinite;
}

@keyframes typeDots {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }

    100% {
        content: '';
    }
}

/* ── Divider ───────────────────────────────────────── */
.card-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-bright), transparent);
    margin-bottom: 28px;
}

/* ── Form ──────────────────────────────────────────── */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-wrap {
    position: relative;
}

.input-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: var(--text-dim);
    pointer-events: none;
    transition: color .2s;
}

.form-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 12px 42px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    -webkit-appearance: none;
}

.form-input::placeholder {
    color: var(--text-dim);
}

.form-input:focus {
    border-color: var(--accent-blue);
    background: rgba(77, 158, 246, .04);
    box-shadow: 0 0 0 3px rgba(77, 158, 246, .12);
}

.form-input:focus+.input-icon-right,
.input-wrap:focus-within .input-icon {
    color: var(--accent-blue);
}

/* eye toggle */
.input-icon-right {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: var(--text-dim);
    cursor: pointer;
    transition: color .2s;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.input-icon-right:hover {
    color: var(--text-muted);
}

/* ── Error ─────────────────────────────────────────── */
.error-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(240, 106, 106, .1);
    border: 1px solid rgba(240, 106, 106, .35);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-red);
    animation: shakeX .4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shakeX {

    10%,
    90% {
        transform: translateX(-2px);
    }

    20%,
    80% {
        transform: translateX(3px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-4px);
    }

    40%,
    60% {
        transform: translateX(4px);
    }
}

/* ── Submit button ─────────────────────────────────── */
.login-btn {
    width: 100%;
    padding: 13px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #3a7bd5, var(--accent-blue) 60%, #5ab4ff);
    color: #fff;
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 20px rgba(77, 158, 246, .3);
    margin-top: 6px;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 28px rgba(77, 158, 246, .42);
}

.login-btn:active {
    transform: scale(.98);
}

/* Ripple on click */
.login-btn .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255, 255, 255, .25);
    animation: rippleAnim .55s linear;
    pointer-events: none;
}

@keyframes rippleAnim {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Button loading state */
.login-btn.loading {
    pointer-events: none;
    opacity: .8;
}

.login-btn .btn-text {
    transition: opacity .2s;
}

.login-btn .btn-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}

.login-btn.loading .btn-text {
    opacity: 0;
}

.login-btn.loading .btn-loader {
    opacity: 1;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

/* ── Status bar ────────────────────────────────────── */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 22px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .35
    }
}

/* ── Floating particles ────────────────────────────── */
.particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }

    10% {
        opacity: .6;
    }

    90% {
        opacity: .3;
    }

    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1);
    }
}