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

:root {
    --brand: #1a459c;
    --brand-dark: #102a5e;
    --brand-light: #3b6fd4;
    --accent: #4f8ef7;
    --text-primary: #f0f4ff;
    --text-muted: #94a3c4;
    --surface: rgba(15, 25, 60, 0.7);
    --surface-2: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.10);
    --radius: 16px;
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body,
.login-body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background: #060d1f;
    color: var(--text-primary);
    overflow: hidden;
}

/* ── Animated background ── */
.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 30%, rgba(26, 69, 156, .55) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 70%, rgba(79, 142, 247, .30) 0%, transparent 55%),
        radial-gradient(ellipse 40% 40% at 50% 0%, rgba(16, 42, 94, .80) 0%, transparent 60%),
        linear-gradient(160deg, #04091a 0%, #0a1531 50%, #040c22 100%);
}

/* floating blobs */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .18;
    z-index: 0;
    animation: float 14s ease-in-out infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: #1a459c;
    top: -120px;
    left: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: #4f8ef7;
    bottom: -80px;
    right: -80px;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #2563eb;
    top: 40%;
    left: 60%;
    animation-delay: -8s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.97);
    }
}

/* ── Grid dots overlay ── */
.bg-dots {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 36px 36px;
}

/* ── Page layout ── */
.login-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 480px;
}

/* ── Left branding panel ── */
.brand-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    gap: 32px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo img {
    width: 56px;
    height: 56px;
    filter: drop-shadow(0 4px 24px rgba(79, 142, 247, .5));
}

.brand-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, #94a3c4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-headline {
    font-size: clamp(2rem, 3.5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 0%, #7ba8f7 60%, #4f8ef7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 400px;
}

.brand-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-num {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}

/* ── Right login panel ── */
.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 48px;
    border-left: 1px solid var(--border);
    backdrop-filter: blur(24px);
    background: var(--surface);
}

.login-box {
    width: 100%;
    max-width: 360px;
}

.login-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 36px;
}

/* ── Form ── */
.field {
    position: relative;
    margin-bottom: 20px;
}

.field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    margin-bottom: 8px;
}

.field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: color var(--transition);
}

.field-input {
    width: 100%;
    padding: 13px 44px 13px 42px;
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: #fff;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.field-input::placeholder {
    color: rgba(255, 255, 255, .25);
}

.field-input:focus {
    border-color: var(--accent);
    background: rgba(79, 142, 247, .08);
    box-shadow: 0 0 0 3px rgba(79, 142, 247, .18);
}

.field-input:focus+.field-icon,
.field-wrap:focus-within .field-icon {
    color: var(--accent);
}

/* password toggle */
.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    transition: color var(--transition);
    padding: 0;
    display: flex;
}

.toggle-password:hover {
    color: var(--accent);
}

/* ── Error alerts ── */
.login-errors {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .3);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    color: #fca5a5;
}

.login-errors i {
    margin-right: 6px;
}

/* ── Submit button ── */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    box-shadow: 0 4px 20px rgba(26, 69, 156, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .12) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 30px rgba(26, 69, 156, .55);
}

.btn-login:hover::before {
    opacity: 1;
}

.btn-login:active {
    transform: translateY(0);
}

/* loading spinner inside button */
.btn-login .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-login.loading .btn-text {
    opacity: 0.6;
}

.btn-login.loading .spinner {
    display: block;
}

/* ── Footer note ── */
.login-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--accent);
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* ── Responsive: stack on small screens ── */
@media (max-width: 900px) {

    html,
    body,
    .login-body {
        overflow: auto;
    }

    .login-page {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        border-left: none;
        background: linear-gradient(160deg, #04091a 0%, #0a1531 100%);
    }
}