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

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
}

body.login-page {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f8fafc;
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.login-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    opacity: 0;
    animation: pageFadeIn 0.7s ease forwards;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Left brand panel ── */

.login-brand {
    position: relative;
    flex: 0 0 40%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    background: linear-gradient(145deg, #0f172a 0%, #111827 45%, #1e293b 100%);
    color: #f8fafc;
}

.login-brand-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.login-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, black 20%, transparent 75%);
}

.login-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
}

.login-glow-a {
    width: 320px;
    height: 320px;
    top: 10%;
    left: -8%;
    background: #6366f1;
    animation: glowPulse 8s ease-in-out infinite;
}

.login-glow-b {
    width: 280px;
    height: 280px;
    bottom: 8%;
    right: -5%;
    background: #8b5cf6;
    animation: glowPulse 10s ease-in-out infinite reverse;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.28; transform: scale(1); }
    50% { opacity: 0.42; transform: scale(1.08); }
}

.login-brand-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 56px 48px;
    max-width: 520px;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.login-logo-mark {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.login-logo-mark svg {
    width: 100%;
    height: 100%;
    display: block;
}

.login-logo-text {
    font-family: "Manrope", sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #e2e8f0;
}

.login-headline {
    font-family: "Manrope", sans-serif;
    font-size: clamp(2.5rem, 4vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.05;
    margin: 0 0 12px;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subheadline {
    font-family: "Manrope", sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: #94a3b8;
    margin: 0 0 28px;
    letter-spacing: -0.01em;
}

.login-description {
    font-size: 1rem;
    line-height: 1.85;
    color: #64748b;
    margin: 0 0 40px;
    font-weight: 400;
}

.login-description-accent {
    display: inline-block;
    margin-top: 6px;
    color: #cbd5e1;
    font-weight: 500;
}

.login-floating-cards {
    position: relative;
    height: 140px;
    margin-bottom: 36px;
}

.login-float-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    font-size: 13px;
    font-weight: 500;
    color: #e2e8f0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    animation: floatCard 6s ease-in-out infinite;
}

.login-float-icon {
    font-size: 14px;
    opacity: 0.85;
}

.login-float-card-1 { top: 0; left: 0; animation-delay: 0s; }
.login-float-card-2 { top: 12px; left: 38%; animation-delay: 1.2s; }
.login-float-card-3 { top: 56px; left: 8%; animation-delay: 2.4s; }
.login-float-card-4 { top: 48px; left: 52%; animation-delay: 0.8s; }

@keyframes floatCard {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.login-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

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

.login-stat-value {
    font-family: "Manrope", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.02em;
}

.login-stat-label {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Right form panel ── */

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: #f8fafc;
}

.login-form-wrap {
    width: 100%;
    max-width: 420px;
    animation: formSlideIn 0.8s ease 0.15s both;
}

@keyframes formSlideIn {
    from {
        opacity: 0;
        transform: translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-form-header {
    margin-bottom: 32px;
}

.login-form-header h2 {
    font-family: "Manrope", sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 8px;
    color: #0f172a;
}

.login-form-header p {
    margin: 0;
    font-size: 0.95rem;
    color: #64748b;
}

.login-field {
    display: block;
    margin-bottom: 20px;
}

.login-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
    letter-spacing: 0.01em;
}

.login-field input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 0.9375rem;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.login-field input::placeholder {
    color: #94a3b8;
}

.login-field input:hover {
    border-color: #cbd5e1;
}

.login-field input:focus {
    border-color: #6366f1;
    box-shadow:
        0 0 0 3px rgba(99, 102, 241, 0.12),
        0 1px 2px rgba(15, 23, 42, 0.04);
    background: #ffffff;
}

.login-password-wrap {
    position: relative;
}

.login-password-wrap input {
    padding-right: 48px;
}

.login-password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
}

.login-password-toggle:hover {
    color: #475569;
    background: rgba(15, 23, 42, 0.04);
}

.login-password-toggle svg.hidden {
    display: none;
}

.login-error {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.45;
}

.login-submit {
    width: 100%;
    height: 54px;
    margin-top: 8px;
    border: none;
    border-radius: 12px;
    background: #0f172a;
    color: #ffffff;
    font-family: "Manrope", sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition:
        background 0.2s ease,
        transform 0.15s ease,
        box-shadow 0.2s ease;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.12),
        0 4px 12px rgba(15, 23, 42, 0.08);
}

.login-submit::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.login-submit:hover:not(:disabled) {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.14),
        0 8px 20px rgba(15, 23, 42, 0.12);
}

.login-submit:active:not(:disabled) {
    transform: translateY(0);
}

.login-submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.login-submit-loader {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

.login-submit-loader.hidden,
.login-submit-text.hidden {
    display: none;
}

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

.login-footer-note {
    margin: 28px 0 0;
    text-align: center;
    font-size: 0.8125rem;
    color: #94a3b8;
}

/* ── Mobile ── */

@media (max-width: 900px) {
    .login-shell {
        flex-direction: column;
    }

    .login-brand {
        flex: none;
        min-height: auto;
        padding-bottom: 0;
    }

    .login-brand-content {
        padding: 40px 28px 32px;
        max-width: none;
    }

    .login-headline {
        font-size: 2rem;
    }

    .login-floating-cards {
        height: 100px;
        margin-bottom: 24px;
    }

    .login-float-card {
        font-size: 12px;
        padding: 8px 12px;
    }

    .login-float-card-2 { left: 42%; }
    .login-float-card-4 { left: 48%; top: 44px; }

    .login-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .login-main {
        flex: 1;
        padding: 32px 24px 40px;
        align-items: flex-start;
    }

    .login-form-wrap {
        animation-delay: 0.05s;
    }
}

@media (max-width: 480px) {
    .login-brand-content {
        padding: 32px 20px 24px;
    }

    .login-logo {
        margin-bottom: 28px;
    }

    .login-description {
        font-size: 0.9375rem;
        margin-bottom: 28px;
    }

    .login-floating-cards {
        display: none;
    }

    .login-main {
        padding: 24px 20px 32px;
    }
}
