:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --accent: #06b6d4;
    --bg: #f1f5f9;
    --surface: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-blue: #4f46e5;
    --error-red: #ef4444;
}

body {
    background-color: var(--bg);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    margin: 0;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

.auth-wrap {
    display: flex;
    min-height: 100vh;
}

/* Left brand panel */
.auth-brand {
    flex: 1 1 50%;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 20% 20%, #6366f1 0%, transparent 45%),
        radial-gradient(circle at 80% 80%, #06b6d4 0%, transparent 40%),
        linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    color: #fff;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.auth-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}

.auth-brand>* {
    position: relative;
    z-index: 1;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.15rem;
}

.brand-logo .icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.auth-brand h2 {
    font-weight: 700;
    font-size: 2.3rem;
    line-height: 1.2;
    max-width: 460px;
}

.auth-brand .lead-text {
    color: #c7d2fe;
    max-width: 440px;
    margin-top: 14px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    color: #e0e7ff;
    font-size: .95rem;
}

.feature i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-foot {
    color: #a5b4fc;
    font-size: .8rem;
}

/* Right form panel */
.auth-form {
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    width: 100%;
    max-width: 430px;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.12);
}

.login-header .badge-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px rgba(79, 70, 229, .3);
}

.login-header h3 {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.form-label {
    color: #334155;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Input Group Customization */
.input-group {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    background-color: #f8fafc;
    align-items: center;
}

.input-group .lead-icon {
    color: #94a3b8;
    padding-left: 14px;
    font-size: 1rem;
}

.input-group:focus-within {
    border-color: #a5b4fc;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.input-group:focus-within .lead-icon {
    color: var(--primary);
}

.form-control {
    background-color: transparent !important;
    border: none;
    color: var(--text-main) !important;
    padding: 0.8rem 0.75rem;
}

.form-control:focus {
    box-shadow: none;
}

/* Password Toggle Button */
#togglePassword {
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    align-self: stretch;
}

/* Validation Styles */
.is-invalid-container {
    border-color: var(--error-red) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1) !important;
}

.invalid-feedback {
    color: #dc2626;
    font-size: 0.78rem;
    margin-top: 0.4rem;
    font-weight: 500;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.remember-label {
    color: var(--text-muted);
    font-size: .875rem;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    border: none;
    padding: 0.8rem;
    font-weight: 600;
    border-radius: 12px;
    color: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 8px 20px rgba(79, 70, 229, .3);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(79, 70, 229, .35);
}

.btn-primary:disabled {
    background: var(--primary);
    opacity: .75;
}

#errorAlert {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.85rem;
    border-radius: 12px;
}

.secure-note {
    color: #94a3b8;
    font-size: .78rem;
}

@media (max-width: 991.98px) {
    .auth-brand {
        display: none;
    }

    .auth-form {
        background: radial-gradient(circle at 0% 0%, #e0e7ff 0%, transparent 50%),
            radial-gradient(circle at 100% 100%, #cffafe 0%, transparent 45%),
            var(--bg);
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 1.75rem 1.25rem;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    50% {
        transform: translateX(8px);
    }

    75% {
        transform: translateX(-8px);
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* ---------- Mobile / tablet brand header (left panel hidden < 992px) ---------- */
.mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-bottom: 1.5rem;
    border-radius: 14px;
    color: #fff;
    background: radial-gradient(circle at 100% 0%, rgba(6, 182, 212, .55) 0%, transparent 55%),
        linear-gradient(135deg, #1e1b4b 0%, var(--primary) 100%);
    box-shadow: 0 10px 24px rgba(79, 70, 229, .25);
}

.mobile-brand .icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.mobile-brand .title {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
}

.mobile-brand .sub {
    font-size: .78rem;
    color: #c7d2fe;
}

.brand-logo .brand-sub {
    display: block;
    font-size: .75rem;
    font-weight: 500;
    color: #c7d2fe;
}
