body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--secondary);
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    position: relative;
    overflow: hidden;
}

body::after {
    content: '';
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(var(--primary-rgb), 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    margin: 2rem;
    position: relative;
    z-index: 1;
}

.brand {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    margin-bottom: 2rem;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.4);
}

.brand-logo-wrapper {
    width: auto;
    min-width: 140px;
    max-width: 250px;
    height: 56px;
    background: #ffffff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 22px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.brand-logo-wrapper:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.brand-company-logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.brand-text {
    display: none;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 1);
    border-radius: 28px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.15);
    color: var(--secondary, #1e293b);
}

.login-header,
.sso-login-box {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title,
.sso-login-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--secondary, #1e293b);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.login-subtitle,
.sso-login-desc {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

.sso-helper-text {
    display: block;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.45;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.session-status-alert {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #166534;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.password-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.password-label {
    margin: 0;
}

.forgot-password-link {
    font-size: 0.75rem;
}

.password-wrapper {
    position: relative;
    margin-bottom: 1.25rem;
}

.password-input {
    padding-right: 46px !important;
    margin-bottom: 0 !important;
}

.password-toggle-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: color 0.15s ease;
    z-index: 2;
}

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

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

.remember-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    margin-top: -0.25rem;
}

.remember-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1.5px solid #cbd5e1;
    background: white;
    accent-color: var(--primary);
    cursor: pointer;
}

.remember-label {
    margin-left: 8px;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    color: var(--secondary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    margin-bottom: 1.25rem;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.form-control::placeholder {
    color: #94a3b8;
}

.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 12px;
    padding: 1.1rem;
    color: white;
    font-size: 1rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(var(--primary-rgb), 0.35);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.45);
}

.auth-link {
    color: #64748b;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--primary);
}

.form-error {
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: -0.75rem;
    margin-bottom: 1rem;
}

/* SSO Login Divider & Enterprise Button */
.sso-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
}

.sso-divider::before,
.sso-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.sso-divider span {
    padding: 0 0.75rem;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-enterprise-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: #ffffff;
    color: var(--secondary);
    border: 1.5px solid #cbd5e1;
    font-size: 0.925rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.btn-enterprise-sso:hover {
    background: #f8fafc;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    text-align: center;
}

.text-center {
    text-align: center;
}

.sso-hidden {
    display: none !important;
}

@media (max-width: 480px) {
    .auth-container {
        margin: 1rem;
    }

    .auth-card {
        padding: 1.5rem;
    }
}

/* Universal Form Double-Submit Guard Lock & Spinner */
.is-form-guard-locked,
button.is-form-guard-locked,
input.is-form-guard-locked {
    pointer-events: none !important;
    opacity: 0.72 !important;
    cursor: wait !important;
}

.fg-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
    flex-shrink: 0;
    animation: fgSpin 0.65s linear infinite;
}

@keyframes fgSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}
