/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #FFFFFF;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: background-color 0.3s ease;
    color: #1A1A1A;
    line-height: 1.5;
    position: relative;
}

body.dark-theme {
    background: #121212;
    color: #FFFFFF;
}

/* Remove focus outline for mouse users, keep for keyboard */
:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid #4362C9;
    outline-offset: 2px;
}

/* Login Container */
.login-container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login Card */
.login-card {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.05),
        0 20px 40px rgba(67, 98, 201, 0.08),
        0 0 0 1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4362C9 0%, #6B8CFF 100%);
    border-radius: 24px 24px 0 0;
}

body.dark-theme .login-card {
    background: #1A1A1A;
    box-shadow: 
        0 1px 3px rgba(0, 0, 0, 0.2),
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

.logo-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-wrapper .fa-user {
    font-size: 80px;
    color: #4362C9;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 12px rgba(67, 98, 201, 0.15));
}

.logo-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #4362C9 0%, #2A4AB5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-size: 15px;
    color: #666666;
    font-weight: 400;
    line-height: 1.6;
    max-width: 280px;
    margin: 0 auto;
}

body.dark-theme .logo-subtitle {
    color: #AAAAAA;
}

/* Form Styles */
.login-form {
    margin-bottom: 48px;
}

.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1A1A1A;
    margin-bottom: 8px;
    letter-spacing: -0.2px;
}

body.dark-theme .form-label {
    color: #FFFFFF;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    color: #4362C9;
    font-size: 18px;
    z-index: 1;
    width: 20px;
    text-align: center;
}

.form-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    border: 1.5px solid #E5E5E5;
    border-radius: 12px;
    background: #FFFFFF;
    color: #1A1A1A;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.form-input:hover {
    border-color: #B8C4FF;
}

.form-input:focus {
    outline: none;
    border-color: #4362C9;
    box-shadow: 0 0 0 3px rgba(67, 98, 201, 0.1);
}

.form-input::placeholder {
    color: #999999;
    font-size: 14.5px;
}

body.dark-theme .form-input {
    background: #2A2A2A;
    border-color: #444444;
    color: #FFFFFF;
}

body.dark-theme .form-input:hover {
    border-color: #5A5A5A;
}

body.dark-theme .form-input:focus {
    border-color: #6B8CFF;
    box-shadow: 0 0 0 3px rgba(107, 140, 255, 0.2);
}

body.dark-theme .form-input::placeholder {
    color: #777777;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #666666;
    transition: all 0.2s ease;
    padding: 4px;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #4362C9;
    background: rgba(67, 98, 201, 0.08);
}

.password-toggle:active {
    transform: scale(0.95);
}

body.dark-theme .password-toggle {
    color: #AAAAAA;
}

body.dark-theme .password-toggle:hover {
    color: #6B8CFF;
    background: rgba(107, 140, 255, 0.1);
}

/* Checkbox Group */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #F0F0F0;
}

body.dark-theme .checkbox-group {
    border-top-color: #333333;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #4362C9;
    flex-shrink: 0;
    border-radius: 4px;
}

.checkbox-label {
    font-size: 14px;
    color: #666666;
    line-height: 1.5;
    flex: 1;
    font-weight: 400;
}

body.dark-theme .checkbox-label {
    color: #CCCCCC;
}

.terms-link {
    color: #4362C9;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    border-bottom: 1px solid transparent;
}

.terms-link:hover {
    color: #2A4AB5;
    border-bottom-color: #4362C9;
}

body.dark-theme .terms-link {
    color: #6B8CFF;
}

body.dark-theme .terms-link:hover {
    color: #8BA4FF;
}

/* Input Error */
.input-error {
    font-size: 13px;
    color: #4362C9;
    margin-top: 6px;
    min-height: 18px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    font-weight: 400;
}

.input-error.show {
    opacity: 1;
    transform: translateY(0);
}

body.dark-theme .input-error {
    color: #6B8CFF;
}

/* Login Button */
.login-button {
    width: 100%;
    padding: 18px 32px;
    background: linear-gradient(135deg, #4362C9 0%, #2A4AB5 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.2px;
    margin-top: 8px;
}

.login-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #4362C9;
    transform: none !important;
    box-shadow: none !important;
}

.login-button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(67, 98, 201, 0.25),
        0 0 0 1px rgba(67, 98, 201, 0.1);
}

.login-button:not(:disabled):active {
    transform: translateY(0);
}

.button-text {
    font-size: 16px;
    font-weight: 600;
}

.button-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.login-button:not(:disabled):hover .button-icon {
    transform: translateX(4px);
}

/* Links Container */
.links-container {
    display: grid;
    gap: 16px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #F0F0F0;
}

body.dark-theme .links-container {
    border-top-color: #333333;
}

.link-box {
    background: #F8FAFF;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    text-decoration: none;
    color: inherit;
}

.link-box:hover {
    transform: translateY(-2px);
    border-color: #4362C9;
    box-shadow: 0 8px 24px rgba(67, 98, 201, 0.12);
    background: #FFFFFF;
}

body.dark-theme .link-box {
    background: #2A2A2A;
}

body.dark-theme .link-box:hover {
    background: #333333;
    border-color: #6B8CFF;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.link-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #4362C9 0%, #6B8CFF 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.link-box:hover .link-icon {
    transform: scale(1.1) rotate(5deg);
}

.link-content {
    flex: 1;
    min-width: 0;
}

.link-title {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 4px;
    line-height: 1.4;
}

body.dark-theme .link-title {
    color: #FFFFFF;
}

.link-action {
    font-size: 14px;
    color: #4362C9;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
    border-bottom: 1px solid transparent;
}

.link-action:hover {
    color: #2A4AB5;
    border-bottom-color: #4362C9;
}

body.dark-theme .link-action {
    color: #6B8CFF;
}

body.dark-theme .link-action:hover {
    color: #8BA4FF;
}

/* SETTINGS ICON CSS (EXACT AS GIVEN - NO CHANGES) */
.settings-icon {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(67, 98, 201, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.settings-icon:hover {
    transform: scale(1.1) rotate(90deg);
    background: rgba(67, 98, 201, 0.1);
    border-color: #4362C9;
    box-shadow: 0 8px 25px rgba(67, 98, 201, 0.15);
}

.settings-icon svg {
    color: #4362C9;
    transition: color 0.3s ease;
}

.settings-icon:hover svg {
    color: #01A060;
}

body.dark-theme .settings-icon {
    background: rgba(26, 26, 26, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
}

body.dark-theme .settings-icon:hover {
    background: rgba(67, 98, 201, 0.2);
    border-color: #4362C9;
}

/* SETTINGS DROPDOWN CSS (EXACT AS GIVEN - NO CHANGES) */
.settings-dropdown {
    position: fixed;
    top: 90px;
    right: 30px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(67, 98, 201, 0.2);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 280px;
}

.settings-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

body.dark-theme .settings-dropdown {
    background: rgba(26, 26, 26, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-heading {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #4362C9 0%, #01A060 40%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark-theme .settings-heading {
    background: linear-gradient(135deg, #4362C9 0%, #01A060 40%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.language-option {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: transparent;
    color: #666666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.language-option:hover {
    border-color: #4362C9;
    color: #4362C9;
    transform: translateY(-1px);
}

.language-option.active {
    background: #4362C9;
    border-color: #4362C9;
    color: #ffffff;
}

body.dark-theme .language-option {
    border-color: #444444;
    color: #cccccc;
}

body.dark-theme .language-option:hover {
    border-color: #6B8CFF;
    color: #6B8CFF;
}

body.dark-theme .language-option.active {
    background: #6B8CFF;
    border-color: #6B8CFF;
    color: #ffffff;
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.theme-option {
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: transparent;
    color: #666666;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    flex: 1;
    min-width: 80px;
}

.theme-option:hover {
    border-color: #01A060;
    color: #01A060;
    transform: translateY(-1px);
}

.theme-option.active {
    background: #01A060;
    border-color: #01A060;
    color: #ffffff;
}

body.dark-theme .theme-option {
    border-color: #444444;
    color: #cccccc;
}

body.dark-theme .theme-option:hover {
    border-color: #00C274;
    color: #00C274;
}

body.dark-theme .theme-option.active {
    background: #00C274;
    border-color: #00C274;
    color: #ffffff;
}



/* Terms & Conditions Popup */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
}

.popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.popup-container {
    background: #FFFFFF;
    border-radius: 24px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    animation: popupSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #E5E5E5;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

body.dark-theme .popup-container {
    background: #1A1A1A;
    border-color: #333333;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.popup-header {
    padding: 24px 32px;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 1;
    border-radius: 24px 24px 0 0;
}

body.dark-theme .popup-header {
    border-bottom-color: #333333;
}

.popup-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1A1A1A;
    background: linear-gradient(135deg, #4362C9 0%, #2A4AB5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

body.dark-theme .popup-header h2 {
    color: #FFFFFF;
}

.popup-close {
    padding: 10px 20px;
    background: #E5E5E5;
    color: #666666;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    min-width: 120px;
}

.popup-close:enabled {
    background: linear-gradient(135deg, #4362C9 0%, #2A4AB5 100%);
    color: white;
    cursor: pointer;
}

.popup-close:enabled:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 98, 201, 0.25);
}

.popup-content {
    padding: 32px;
}

.terms-section,
.privacy-section {
    margin-bottom: 28px;
}

.terms-section h3,
.privacy-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 16px;
    letter-spacing: -0.2px;
}

body.dark-theme .terms-section h3,
body.dark-theme .privacy-section h3 {
    color: #FFFFFF;
}

.terms-section ul,
.privacy-section ul {
    list-style: none;
    padding-left: 0;
}

.terms-section li,
.privacy-section li {
    padding: 10px 0;
    padding-left: 24px;
    position: relative;
    color: #666666;
    line-height: 1.6;
    font-size: 14.5px;
}

.terms-section li::before,
.privacy-section li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4362C9;
}

body.dark-theme .terms-section li,
body.dark-theme .privacy-section li {
    color: #CCCCCC;
}

.popup-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 36px;
}

.popup-link {
    padding: 12px 24px;
    background: #F8FAFF;
    color: #4362C9;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1.5px solid transparent;
    font-size: 14.5px;
    flex: 1;
    min-width: 200px;
    text-align: center;
}

.popup-link:hover {
    background: #4362C9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 98, 201, 0.2);
    border-color: #4362C9;
}

body.dark-theme .popup-link {
    background: #2A2A2A;
    color: #6B8CFF;
}

body.dark-theme .popup-link:hover {
    background: #6B8CFF;
    color: white;
    border-color: #6B8CFF;
}

.popup-footer {
    padding: 24px 32px;
    border-top: 1px solid #F0F0F0;
    text-align: center;
    background: #FAFAFA;
    border-radius: 0 0 24px 24px;
}

body.dark-theme .popup-footer {
    background: #222222;
    border-top-color: #333333;
}

.timer-info {
    color: #666666;
    font-size: 13.5px;
    margin-bottom: 12px;
    font-weight: 500;
}

body.dark-theme .timer-info {
    color: #AAAAAA;
}

.timer-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #4362C9;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 16px;
    background: rgba(67, 98, 201, 0.1);
    border-radius: 8px;
}

.timer-display i {
    font-size: 16px;
}

body.dark-theme .timer-display {
    color: #6B8CFF;
    background: rgba(107, 140, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        padding: 10px;
    }
    
    .login-card {
        padding: 40px 28px;
        border-radius: 20px;
    }
    
    .logo-wrapper {
        width: 88px;
        height: 88px;
    }
    
    .logo-wrapper .fa-user {
        font-size: 70px;
    }
    
    .logo-title {
        font-size: 28px;
    }
    
    .logo-subtitle {
        font-size: 14.5px;
    }
    
    .form-input {
        padding: 14px 14px 14px 44px;
        font-size: 15px;
    }
    
    .input-icon {
        left: 14px;
        font-size: 17px;
    }
    
    .password-toggle {
        right: 14px;
        font-size: 20px;
        width: 32px;
        height: 32px;
    }
    
    .login-button {
        padding: 16px 24px;
        font-size: 15.5px;
    }
    
    .link-box {
        padding: 18px;
    }
    
    .link-icon {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }
    
    .settings-icon {
        top: 20px;
        right: 20px;
        width: 46px;
        height: 46px;
    }
    
    .settings-dropdown {
        top: 76px;
        right: 20px;
        min-width: 260px;
        padding: 20px;
    }
    
    .popup-container {
        max-height: 85vh;
    }
    
    .popup-header {
        padding: 20px 24px;
    }
    
    .popup-content {
        padding: 24px;
    }
    
    .popup-links {
        flex-direction: column;
    }
    
    .popup-link {
        min-width: 100%;
    }
    
    .popup-footer {
        padding: 20px 24px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 36px 20px;
        border-radius: 18px;
    }
    
    .logo-wrapper {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }
    
    .logo-wrapper .fa-user {
        font-size: 64px;
    }
    
    .logo-title {
        font-size: 26px;
    }
    
    .checkbox-group {
        gap: 10px;
    }
    
    .checkbox-label {
        font-size: 13.5px;
    }
    
    .links-container {
        gap: 12px;
    }
    
    .link-box {
        padding: 16px;
    }
    
    .link-title {
        font-size: 15.5px;
    }
    
    .link-action {
        font-size: 13.5px;
    }
}

/* Loading Animation for Form */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Print Styles */
@media print {
    .settings-icon,
    .settings-dropdown,
    .popup-overlay,
    .password-toggle {
        display: none !important;
    }
    
    .login-card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* CSS for disabled checkbox */
.form-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.checkbox-group.disabled {
    opacity: 0.7;
}

.checkbox-group.disabled .checkbox-label {
    color: #999999;
}

body.dark-theme .checkbox-group.disabled .checkbox-label {
    color: #666666;
}