:root {
    --bg-auth: var(--bg-dark, #0a0a0c);
    --auth-card-bg: var(--bg-surface, #111114);
    --auth-card-border: var(--border, rgba(255, 255, 255, 0.1));
    --auth-overlay-bg: rgba(0, 0, 0, 0.4);
    --auth-overlay-dark-bg: radial-gradient(circle at center, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.8) 100%);
    
    /* Login Internal Variables */
    --login-primary: var(--primary, #e6c152);
    --login-primary-hover: var(--primary-light, #d4af37);
    --login-card-bg: var(--bg-surface, #121316);
    --login-input-bg: var(--bg-input, var(--bg-dark, #1a1a1a));
    --login-border: var(--border, rgba(255, 255, 255, 0.08));
    --login-text: var(--text-main, #fff);
    --login-text-muted: var(--text-muted, #94a3b8);
}

body.auth-wrapper {
    background: radial-gradient(circle at center, #1b1e23 0%, #080808 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    font-family: 'Outfit', 'Inter', sans-serif;
    color: var(--text-main, #fff);
}

/* Removed duplicate :root and hardcoded dark colors */

.auth-card {
    background: var(--login-card-bg);
    padding: 45px;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--login-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    position: relative;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.auth-card:hover {
    box-shadow: 0 40px 80px -15px rgba(0, 0, 0, 0.8), 0 0 20px rgba(230, 193, 82, 0.05);
}

.auth-header {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo-box {
    width: 72px;
    height: 72px;
    background: rgba(var(--primary-rgb, 230, 193, 82), 0.05);
    border: 2px solid var(--login-primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    transition: all 0.3s ease;
    padding: 12px;
}

.auth-logo-box i {
    color: var(--login-primary);
    width: 36px !important;
    height: 36px !important;
}

.auth-title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--login-text);
}

.auth-subtitle {
    color: var(--login-text-muted);
    font-size: 16px;
    margin-top: 10px;
    font-weight: 400;
}

/* Tabs Integration */
.auth-tabs {
    display: flex;
    background: rgba(var(--white-rgb), 0.03);
    border-radius: 14px;
    padding: 5px;
    margin-bottom: 30px;
    border: 1px solid var(--login-border);
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-tab.active {
    background: var(--login-primary);
    color: #000;
    box-shadow: 0 4px 15px rgba(230, 193, 82, 0.2);
}

.auth-tab:not(.active):hover {
    background: rgba(var(--white-rgb), 0.05);
    color: var(--login-text);
}

.floating-group {
    position: relative;
    margin-bottom: 25px;
}

.floating-label {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--login-text-muted);
    transition: all 0.2s ease;
    pointer-events: none;
    font-size: 14px;
}

.auth-wrapper .form-control:focus ~ .floating-label,
.auth-wrapper .form-control:not(:placeholder-shown) ~ .floating-label {
    top: 0;
    font-size: 11px;
    color: var(--login-primary);
    background: var(--bg-card, var(--login-card-bg));
    padding: 0 5px;
}

.floating-actions {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    z-index: 5;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 14px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.mr-2 {
    margin-right: 0.5rem !important;
}

.ml-2 {
    margin-left: 0.5rem !important;
}

.btn-loader i {
    font-size: 1.1rem;
}

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

.btn-password-toggle {
    position: absolute;
    right: 14px;
    background: transparent;
    border: none;
    color: var(--login-text-muted);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

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

.btn-password-toggle i {
    width: 18px !important;
    height: 18px !important;
}

.form-control.pr-10 {
    padding-right: 50px !important;
}

/* Session Helpers */
body.auth-wrapper.has-bg {
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-attachment: fixed !important;
    background-size: cover !important;
}

.auth-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: var(--auth-overlay-dark-bg); 
    z-index: 0;
}

.auth-card.glassmorphism {
    background: rgba(15, 17, 21, 0.45) !important;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.auth-bg-img {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.auth-logo-box img {
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain;
}

/* Premium Overrides */
.auth-wrapper .form-control {
    background: var(--login-input-bg);
    border: 1px solid var(--login-border);
    border-radius: 14px !important;
    padding: 14px 18px !important;
    color: var(--login-text);
    font-size: 15px !important;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.auth-wrapper .form-control:focus {
    border-color: var(--login-primary) !important;
    background: rgba(230, 193, 82, 0.03) !important;
    box-shadow: 0 0 0 4px rgba(230, 193, 82, 0.1) !important;
    outline: none;
}

.auth-wrapper .form-control::placeholder {
    color: #555 !important;
}

.auth-wrapper .btn-primary {
    background: var(--login-primary) !important;
    color: #000 !important;
    font-weight: 800 !important;
    border-radius: 14px !important;
    padding: 16px !important;
    font-size: 16px !important;
    border: none !important;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.auth-wrapper .btn-primary i {
    color: #000 !important;
    width: 18px;
    height: 18px;
}

.auth-wrapper .btn-primary:hover {
    background: var(--login-primary-hover) !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(230, 193, 82, 0.3);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 40px 25px;
        margin: 20px;
    }
}