/* ========================================================== */
/* LOGIN PAGE - BLUE PURPLE THEME WITH DARK SUPPORT          */
/* ========================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    background-color: #0a0a1a;
    background-image: url('../img/loginpagebg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ========================================================== */
/* OVERLAY - SAME IN BOTH THEMES                             */
/* ========================================================== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10, 10, 26, 0.85) 0%, rgba(26, 26, 46, 0.7) 50%, rgba(10, 10, 26, 0.85) 100%);
    z-index: 0;
}

/* ========================================================== */
/* DARK THEME - KEEP BACKGROUND IMAGE VISIBLE                */
/* ========================================================== */
body.dark-theme {
    background-color: #0a0a1a !important;
    background-image: url('../img/loginpagebg.png') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

body.dark-theme::before {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.85) 50%, rgba(0, 0, 0, 0.9) 100%) !important;
}

/* ========================================================== */
/* LOGIN WRAPPER                                              */
/* ========================================================== */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 20px;
}

/* ========================================================== */
/* LOGO                                                       */
/* ========================================================== */
.login-logo {
    text-align: center;
    margin-bottom: 25px;
    animation: fadeInUp 0.7s ease-out 0.1s both;
}

.login-logo img {
    width: 75px;
    height: 75px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.4));
}

.login-logo h3 {
    color: #ffffff;
    font-weight: 700;
    font-size: 26px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.login-logo h3 span {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-theme .login-logo h3 span {
    background: linear-gradient(135deg, #818cf8, #a78bfa) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* ========================================================== */
/* LOGIN CARD - LIGHT THEME                                  */
/* ========================================================== */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 40px 35px;
    border-radius: 24px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.4s ease, box-shadow 0.4s ease, background 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.7s ease-out;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 80px rgba(102, 126, 234, 0.15);
}

/* ========================================================== */
/* LOGIN CARD - DARK THEME                                   */
/* ========================================================== */
body.dark-theme .login-card {
    background: rgba(26, 26, 46, 0.92) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
    backdrop-filter: blur(20px) !important;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7) !important;
}

body.dark-theme .login-card::before {
    background: linear-gradient(135deg, #818cf8, #a78bfa) !important;
}

body.dark-theme .login-card:hover {
    box-shadow: 0 30px 80px rgba(99, 102, 241, 0.2) !important;
}

/* ========================================================== */
/* LOGIN HEADER - TEXT VISIBLE IN BOTH THEMES                */
/* ========================================================== */
.login-header {
    text-align: center;
    margin-bottom: 25px;
}

.login-card h2 {
    color: #1a1a2e;
    font-weight: 700;
    font-size: 28px;
    margin-bottom: 2px;
}

.login-card .subtitle {
    color: rgba(0, 0, 0, 0.5);
    font-size: 14px;
    font-weight: 300;
}

body.dark-theme .login-card h2 {
    color: #e5e7eb !important;
}

body.dark-theme .login-card .subtitle {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* ========================================================== */
/* FORM LABELS - TEXT VISIBLE                                */
/* ========================================================== */
.form-label {
    font-weight: 500;
    color: #2d2d44;
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label i {
    font-size: 14px;
    color: #667eea;
}

body.dark-theme .form-label {
    color: #e5e7eb !important;
}

body.dark-theme .form-label i {
    color: #818cf8 !important;
}

/* ========================================================== */
/* INPUT GROUP - STYLES                                      */
/* ========================================================== */
.input-group {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-group-text {
    background: #f8f9fa;
    border: none;
    padding: 12px 16px;
    color: #667eea;
    font-size: 16px;
    border-radius: 10px 0 0 10px;
}

.form-control {
    border: none;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 400;
    background: #f8f9fa;
    border-radius: 0 10px 10px 0;
    transition: all 0.3s ease;
    color: #1a1a2e;
}

.form-control:focus {
    background: #ffffff;
    box-shadow: none;
    border: none;
}

.form-control::placeholder {
    color: #9ca3af;
}

body.dark-theme .input-group:focus-within {
    border-color: #818cf8 !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15) !important;
}

body.dark-theme .input-group-text {
    background: #0f0f1a !important;
    color: #818cf8 !important;
}

body.dark-theme .form-control {
    background: #0f0f1a !important;
    color: #e5e7eb !important;
}

body.dark-theme .form-control:focus {
    background: #0f0f1a !important;
}

body.dark-theme .form-control::placeholder {
    color: #6b7280 !important;
}

/* ========================================================== */
/* LOGIN BUTTON                                               */
/* ========================================================== */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2, #667eea);
    color: #ffffff;
}

.btn-login:active {
    transform: translateY(0px);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

body.dark-theme .btn-login {
    background: linear-gradient(135deg, #818cf8, #a78bfa) !important;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3) !important;
}

body.dark-theme .btn-login:hover {
    background: linear-gradient(135deg, #a78bfa, #818cf8) !important;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4) !important;
}

/* ========================================================== */
/* ERROR ALERT                                                */
/* ========================================================== */
.alert-error {
    display: none;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 15px;
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

body.dark-theme .alert-error {
    background: #7f1d1d !important;
    color: #fca5a5 !important;
    border-color: #991b1b !important;
}

/* ========================================================== */
/* LOADING SPINNER                                            */
/* ========================================================== */
.spinner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.spinner-overlay.show {
    display: flex;
}

body.dark-theme .spinner-overlay {
    background: rgba(0, 0, 0, 0.8) !important;
}

.spinner-box {
    background: #fff;
    padding: 30px 40px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.spinner-box .spinner-border {
    width: 3rem;
    height: 3rem;
}

.spinner-box p {
    margin-top: 12px;
    color: #6b7280;
    font-weight: 500;
}

body.dark-theme .spinner-box {
    background: #1a1a2e !important;
    border: 1px solid #2a2a4a !important;
}

body.dark-theme .spinner-box p {
    color: #9ca3af !important;
}

body.dark-theme .spinner-box .spinner-border {
    color: #818cf8 !important;
}

/* ========================================================== */
/* FOOTER                                                     */
/* ========================================================== */
.login-footer {
    text-align: center;
    margin-top: 20px;
    color: rgba(0, 0, 0, 0.4);
    font-size: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 18px;
}

.login-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.login-footer a:hover {
    text-decoration: underline;
}

body.dark-theme .login-footer {
    color: rgba(255, 255, 255, 0.3) !important;
    border-top-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-theme .login-footer a {
    color: #818cf8 !important;
}

/* ========================================================== */
/* ANIMATIONS                                                 */
/* ========================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================================== */
/* RESPONSIVE                                                 */
/* ========================================================== */
@media (max-width: 480px) {
    .login-wrapper {
        padding: 15px;
    }
    .login-card {
        padding: 30px 20px;
        border-radius: 20px;
    }
    .login-logo h3 {
        font-size: 22px;
    }
    .login-logo img {
        width: 60px;
        height: 60px;
    }
    .login-card h2 {
        font-size: 24px;
    }
    .btn-login {
        font-size: 14px;
        padding: 12px;
    }
    .form-label {
        font-size: 13px;
    }
    .form-control,
    .input-group-text {
        padding: 10px 14px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    body {
        background-attachment: scroll;
        background-position: center;
    }
}

@media (min-width: 768px) and (max-width: 992px) {
    .login-wrapper {
        max-width: 400px;
    }
}