body {
    background:
            radial-gradient(27% 29% at right ,var(--_g)) calc(var(--s)/ 2) var(--s),
            radial-gradient(27% 29% at left  ,var(--_g)) calc(var(--s)/-2) var(--s),
            radial-gradient(29% 27% at top   ,var(--_g)) 0 calc(var(--s)/ 2),
            radial-gradient(29% 27% at bottom,var(--_g)) 0 calc(var(--s)/-2)
            var(--c2);
    background-size: calc(2*var(--s)) calc(2*var(--s));
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
}

.login-card {
    background: white;
    border-radius: 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 1.75rem;
    width: 100%;
    max-width: 480px;
    border: none;
}

.brand-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    padding: 3px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 2rem;
}

.welcome-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #667eea;
    text-align: center;
    margin-bottom: 0.2rem;
}

.welcome-subtitle {
    color: #6c757d;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.content-base {
    margin-bottom: 0.3rem;
}

.alert.bg-white {
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #f0fff4;
    border-color: #9ae6b4;
    color: #22543d;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-danger {
    background-color: #fff5f5;
    border-color: #fed7d7;
    color: #c53030;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.alert-danger svg {
    width: 1.2em;
    height: 1.2em;
    flex-shrink: 0;
}

.badge.bg-dark {
    background-color: #2d3748 !important;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.badge a {
    color: #667eea;
    text-decoration: none;
}

.form-floating {
    position: relative;
    margin-bottom: 1rem;
}

.form-floating > .form-control {
    background-color: #f7fafc !important;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 0.75rem 0.5rem 2.75rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    height: calc(3.5rem + 2px);
}

.form-floating > .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background-color: #ffffff !important;
}

.form-floating > label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
    padding-left: 2.75rem;
    transition: all 0.3s ease;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: #667eea;
    transform: scale(0.85) translateY(-0.6rem) translateX(0.15rem);
}

.form-floating i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    color: #6c757d;
    font-size: 1rem;
}

.password-toggle-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    border: none;
    background: none;
    color: #6c757d;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.password-toggle-btn:hover {
    background-color: #f1f5f9;
    color: #667eea;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
}

#captcha {
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #a5c4ea 0%, #86b7fe 100%);
    cursor: pointer;
    transition: transform 0.2s ease;
}

#captcha:hover {
    transform: scale(1.02);
}

#regenerateCaptcha {
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

#regenerateCaptcha:hover {
    transform: rotate(180deg);
    color: #667eea;
    background: #edf2f7;
    border-color: #667eea;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    padding: 0.875rem 1rem;
    font-weight: 600;
    color: white;
    width: 100%;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

.btn-primary:active {
    transform: translateY(0);
}

.form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

.form-check-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.25);
}

.form-check-label {
    color: #495057;
    font-size: 0.9rem;
    font-weight: 500;
}

.forgot-password {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.forgot-password:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.signup-link {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.signup-link a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.signup-link a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* Footer - Mobile Compatible */
.footer-brand,
.footer-credit {
    position: fixed;
    bottom: 15px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8rem;
    z-index: 100;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.footer-brand {
    left: 20px;
}

.footer-credit {
    right: 20px;
}

.footer-credit a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.footer-credit a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.15);
}

/* SweetAlert Custom Styles */
.sweet-alert-popup {
    border-radius: 15px;
}

.sweet-alert-title {
    color: #dc3545;
    font-weight: 600;
}

.sweet-alert-confirm-button {
    padding: 10px 24px;
    border-radius: 8px;
}

.sweet-alert-cancel-button {
    padding: 10px 24px;
    border-radius: 8px;
}

/* SweetAlert form styling */
.swal2-popup .form-floating > .form-control {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6;
    padding: 1rem 0.75rem 0.5rem 0.75rem;
}

.swal2-popup .form-floating > .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.swal2-popup .form-floating > label {
    padding-left: 0.75rem;
}

.swal2-popup .form-check-input:checked {
    background-color: #667eea;
    border-color: #667eea;
}

/* ========================================
   RESPONSIVE DESIGN - ALL SCREEN SIZES
   ======================================== */

/* Large Desktop */
@media (min-width: 1200px) {
    .login-card {
        padding: 2rem;
        max-width: 500px;
    }

    .welcome-title {
        font-size: 1.6rem;
    }
}

/* Tablet & Small Desktop */
@media (max-width: 992px) {
    .login-card {
        padding: 1.75rem;
        max-width: 480px;
    }
}

/* Mobile Landscape & Large Phones */
@media (max-width: 768px) {
    .login-container {
        padding: 15px 12px;
    }

    .login-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .brand-logo {
        width: 70px;
        height: 70px;
        margin-bottom: 0.75rem;
    }

    .welcome-title {
        font-size: 1.3rem;
    }

    .welcome-subtitle {
        font-size: 0.9rem;
        margin-bottom: 0.875rem;
    }

    .form-floating > .form-control {
        padding: 0.875rem 0.75rem 0.5rem 2.5rem;
        font-size: 0.9rem;
        height: calc(3.25rem + 2px);
    }

    .form-floating > label {
        font-size: 0.875rem;
        padding-left: 2.5rem;
    }

    .form-floating i {
        left: 0.75rem;
        font-size: 0.9rem;
    }

    .password-toggle-btn {
        right: 0.75rem;
        padding: 0.4rem;
    }

    /* Keep captcha side by side but smaller */
    .captcha-container {
        gap: 0.5rem;
    }

    #captcha {
        width: 140px;
        height: 42px;
    }

    #regenerateCaptcha {
        width: 38px;
        height: 38px;
    }

    .btn-primary {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    .forgot-password,
    .signup-link {
        font-size: 0.85rem;
    }

    /* Footer adjustments for mobile */
    .footer-brand,
    .footer-credit {
        font-size: 0.75rem;
        bottom: 12px;
    }

    .footer-brand {
        left: 15px;
    }

    .footer-credit {
        right: 15px;
    }

    .footer-credit a {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
}

/* Mobile Portrait */
@media (max-width: 576px) {
    body {
        padding-bottom: 80px;
    }

    .login-container {
        padding: 12px 10px;
    }

    .login-card {
        padding: 1.25rem;
        border-radius: 18px;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    }

    .brand-logo {
        width: 64px;
        height: 64px;
        margin-bottom: 0.625rem;
    }

    .welcome-title {
        font-size: 1.2rem;
        margin-bottom: 0.15rem;
    }

    .welcome-subtitle {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .form-floating {
        margin-bottom: 0.875rem;
    }

    .form-floating > .form-control {
        padding: 0.75rem 0.75rem 0.5rem 2.35rem;
        font-size: 0.875rem;
        height: calc(3rem + 2px);
        border-radius: 8px;
    }

    .form-floating > label {
        font-size: 0.85rem;
        padding-left: 2.35rem;
    }

    .form-floating i {
        left: 0.65rem;
        font-size: 0.85rem;
    }

    .password-toggle-btn {
        right: 0.65rem;
        padding: 0.35rem;
    }

    /* Captcha - keep side by side but compact */
    .captcha-container {
        gap: 0.4rem;
        margin-bottom: 0.75rem;
    }

    #captcha {
        width: 120px;
        height: 38px;
        border-radius: 6px;
    }

    #regenerateCaptcha {
        width: 36px;
        height: 36px;
        border-radius: 6px;
    }

    #regenerateCaptcha i {
        font-size: 0.9rem;
    }

    .btn-primary {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        margin-top: 1.25rem;
        border-radius: 8px;
    }

    .forgot-password {
        font-size: 0.825rem;
    }

    .signup-link {
        font-size: 0.825rem;
        margin-top: 1.25rem;
        padding-top: 0.875rem;
    }

    .signup-link a {
        font-size: 0.825rem;
    }

    /* Footer - stacked on very small screens */
    .footer-brand,
    .footer-credit {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        text-align: center;
        width: 100%;
        padding: 6px 0;
        font-size: 0.7rem;
    }

    .footer-brand {
        margin-bottom: 4px;
    }

    .footer-credit a {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
}

/* Extra Small Devices */
@media (max-width: 375px) {
    .login-card {
        padding: 1rem;
        border-radius: 16px;
    }

    .brand-logo {
        width: 56px;
        height: 56px;
    }

    .welcome-title {
        font-size: 1.1rem;
    }

    .welcome-subtitle {
        font-size: 0.8rem;
    }

    .form-floating > .form-control {
        padding: 0.7rem 0.65rem 0.5rem 2.25rem;
        font-size: 0.85rem;
        height: calc(2.875rem + 2px);
    }

    .form-floating > label {
        font-size: 0.825rem;
        padding-left: 2.25rem;
    }

    .form-floating i {
        left: 0.6rem;
        font-size: 0.8rem;
    }

    #captcha {
        width: 100px;
        height: 36px;
    }

    #regenerateCaptcha {
        width: 34px;
        height: 34px;
    }

    .btn-primary {
        font-size: 0.875rem;
        padding: 0.7rem 0.875rem;
    }

    .forgot-password,
    .signup-link {
        font-size: 0.8rem;
    }
}

/* Very Small Devices */
@media (max-width: 320px) {
    .login-card {
        padding: 0.875rem;
    }

    .brand-logo {
        width: 52px;
        height: 52px;
    }

    .welcome-title {
        font-size: 1.05rem;
    }

    .form-floating > .form-control {
        font-size: 0.825rem;
        padding: 0.65rem 0.6rem 0.5rem 2.15rem;
    }

    #captcha {
        width: 90px;
        height: 34px;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .brand-logo img,
    #captcha {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}