:root {
    --bg: #f8fafc;
    --blue: #2563eb;
    --blue-dk: #1d4ed8;
    --blue-lt: #93c5fd;
    --radius: 20px;
}

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

body {
    font-family: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Background animated pastel orbs for light theme depth */
body::before,
body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    animation: float 12s infinite alternate cubic-bezier(0.45, 0.05, 0.55, 0.95);
    opacity: 0.4;
}

body::before {
    width: 450px;
    height: 450px;
    background: #dbeafe;
    /* Soft Light Blue */
    top: -100px;
    left: -100px;
}

body::after {
    width: 550px;
    height: 550px;
    background: #f3e8ff;
    /* Soft Light Purple */
    bottom: -150px;
    right: -150px;
    animation-delay: -6s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, 60px) scale(1.08);
    }
}

.login-container {
    width: 100%;
    max-width: 440px;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    padding: 40px 36px;
    border-radius: var(--radius);
    box-shadow:
        0 20px 40px -15px rgba(15, 23, 42, 0.08),
        0 1px 3px rgba(15, 23, 42, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    position: relative;
}

/* ── Logo Section ── */
.login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.sb-logo-inner {
    position: relative;
    width: 240px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-ball {
    position: absolute;
    left: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    z-index: 3;
}

.sb-text {
    position: absolute;
    left: 44px;
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
}

.login-header p {
    color: #64748b;
    font-size: 15px;
    font-weight: 500;
}

/* ── Form ── */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    margin-left: 4px;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
}

.form-group:focus-within label {
    color: var(--blue);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper > svg {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    pointer-events: none;
    transition: all 0.25s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: rgba(248, 250, 252, 0.8);
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    font-size: 15px;
    color: #0f172a;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    outline: none;
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.01);
}

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

.input-wrapper input:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

.input-wrapper input:focus {
    background: #ffffff;
    border-color: var(--blue);
    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.12),
        0 4px 12px -2px rgba(37, 99, 235, 0.08);
}

.input-wrapper:focus-within > svg {
    color: var(--blue);
    transform: scale(1.05);
}

.form-footer {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.forgot-link {
    font-size: 13px;
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: var(--blue-dk);
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -4px rgba(37, 99, 235, 0.45);
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.btn-login:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px -4px rgba(37, 99, 235, 0.3);
}

.login-info {
    text-align: center;
    margin-top: 28px;
    color: #94a3b8;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* Loader */
.loader {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
    display: none;
}

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

.btn-login.loading span {
    display: none;
}

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

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .login-card {
        padding: 32px 20px;
        border-radius: 16px;
    }

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

    .login-header h1 {
        font-size: 22px;
    }

    .login-header p {
        font-size: 13px;
    }

    .input-wrapper input {
        font-size: 14px;
        padding: 11px 12px 11px 40px;
    }

    .input-wrapper > svg {
        left: 14px;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 24px 16px;
    }

    .sb-text {
        font-size: 18px;
        left: 38px;
    }

    .sb-ball {
        width: 28px;
        height: 28px;
    }
}

/* Password Toggle styles */
.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease, background-color 0.2s;
    z-index: 5;
    outline: none;
}

.password-toggle:hover {
    color: #64748b;
    background-color: #f1f5f9;
}

.password-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Validation styles */
.validation-error-msg {
    font-size: 11.5px;
    color: #ef4444;
    margin-top: 5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-left: 4px;
}

.form-group.has-error input {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12) !important;
}

.form-group.has-success input {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12) !important;
}

.form-group.has-error label {
    color: #ef4444 !important;
}

.form-group.has-success label {
    color: #10b981 !important;
}