/* ========================================
   login.css - WTT ERP Login Page Styles
   STRUCTURE: Logo + Welcome Card + Form Card (inside)
   ======================================== */

/* RESET AND BASE STYLES */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #F2F2F7;
    color: #000000;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

[data-theme="dark"] body {
    background: #000000;
    color: #FFFFFF;
}

/* LOGIN PAGE CONTAINER */
.login-page-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

/* ========================================
   LOGO SECTION - FULL SCREEN TOP (OUTSIDE CARDS)
   ======================================== */
.logo-magical-container {
    display: flex;
    justify-content: center;
    margin: 0 auto 30px;
    position: relative;
    z-index: 10;
}

.logo-aura-wrapper {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Magical aura circles */
.logo-aura-wrapper::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, 
        rgba(0, 122, 255, 0.6) 0%,
        rgba(100, 200, 255, 0.4) 40%,
        rgba(255, 255, 255, 0.2) 70%,
        transparent 100%);
    border-radius: 50%;
    animation: auraPulse 3s ease-in-out infinite;
    filter: blur(15px);
    z-index: 1;
}

.logo-aura-wrapper::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, 
        rgba(0, 122, 255, 0.3) 0%,
        rgba(150, 200, 255, 0.2) 30%,
        transparent 70%);
    border-radius: 50%;
    animation: auraRotate 8s linear infinite;
    filter: blur(20px);
    z-index: 0;
}

@keyframes auraPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes auraRotate {
    from {
        transform: rotate(0deg) scale(1);
    }
    to {
        transform: rotate(360deg) scale(1.1);
    }
}

.logo-circle-perfect {
    width: 140px;
    height: 140px;
    background: #FFFFFF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 15px 35px -10px rgba(0, 122, 255, 0.4),
        0 0 0 2px rgba(255, 255, 255, 0.8),
        0 0 30px 5px rgba(0, 122, 255, 0.3);
    padding: 20px;
    border: 4px solid #FFFFFF;
    position: relative;
    overflow: hidden;
    z-index: 5;
    animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.logo-image-perfect {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 5px 10px rgba(0, 122, 255, 0.3));
}

[data-theme="dark"] .logo-circle-perfect {
    background: #FFFFFF;
    border-color: #FFFFFF;
    box-shadow: 
        0 15px 35px -10px rgba(0, 150, 255, 0.5),
        0 0 0 2px rgba(255, 255, 255, 0.8),
        0 0 40px 10px rgba(0, 150, 255, 0.4);
}

/* ========================================
   CARD 1 - WELCOME CARD
   ======================================== */
.welcome-card {
    background: linear-gradient(145deg, #f8faff 0%, #f0f4ff 100%);
    border-radius: 32px;
    padding: 30px 24px 40px;
    box-shadow: 
        0 10px 30px -5px rgba(0, 100, 255, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    margin-bottom: 20px;
    width: 100%;
}

[data-theme="dark"] .welcome-card {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    box-shadow: 
        0 10px 30px -5px rgba(0, 150, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    color: inherit;
    background: linear-gradient(135deg, #007AFF 0%, #00C6FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    text-align: center;
}

.welcome-subtitle {
    font-size: 15px;
    color: #8E8E93;
    font-weight: 400;
    text-align: center;
    margin-bottom: 30px;
}

[data-theme="dark"] .welcome-subtitle {
    color: #98989D;
}

/* ========================================
   CARD 2 - FORM CARD (INSIDE WELCOME CARD)
   ======================================== */
.form-card {
    background: #FFFFFF;
    border-radius: 24px;
    padding: 28px 24px;
    box-shadow: 
        0 5px 20px -5px rgba(0, 122, 255, 0.15),
        0 2px 5px -2px rgba(0, 0, 0, 0.05);
    width: 100%;
}

[data-theme="dark"] .form-card {
    background: #1C1C1E;
    box-shadow: 
        0 5px 20px -5px rgba(0, 150, 255, 0.1),
        0 2px 5px -2px rgba(0, 0, 0, 0.3);
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #8E8E93;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .form-label {
    color: #98989D;
}

.form-input-container {
    position: relative;
}

.form-input-with-icon {
    padding-left: 44px !important;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #007AFF;
    font-size: 16px;
    width: 20px;
    text-align: center;
    z-index: 2;
}

.form-input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    font-size: 16px;
    background: #F8F9FA;
    border: 2px solid #E8ECF0;
    border-radius: 14px;
    color: #000000;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

.form-input:focus {
    border-color: #007AFF;
    background: #FFFFFF;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

[data-theme="dark"] .form-input {
    background: #2C2C2E;
    border-color: #3A3A3C;
    color: #FFFFFF;
}

[data-theme="dark"] .form-input:focus {
    background: #1C1C1E;
    border-color: #0A84FF;
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.2);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8E8E93;
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    z-index: 2;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #007AFF;
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0;
}

/* Custom Checkbox */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-container input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #C7C7CC;
    border-radius: 6px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s;
    background: #FFFFFF;
}

.checkbox-container input:checked + .checkmark {
    background: #007AFF;
    border-color: #007AFF;
}

.checkbox-container input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-label {
    font-size: 14px;
    color: #8E8E93;
    font-weight: 500;
}

/* Forgot Password Link */
.forgot-password {
    font-size: 14px;
    color: #007AFF;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Error Message */
.error-message {
    display: flex;
    align-items: center;
    background: rgba(255, 59, 48, 0.1);
    border: 1px solid #FF3B30;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 20px;
    display: none;
    animation: slideDown 0.3s ease;
}

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

.error-message i {
    color: #FF3B30;
    margin-right: 12px;
    font-size: 16px;
}

.error-text {
    color: #FF3B30;
    font-size: 14px;
    font-weight: 500;
}

/* Login Button - CONSISTENT BLUE */
.login-button {
    width: 100%;
    height: 56px;
    background: #007AFF;  /* Consistent blue */
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 10px 20px -8px rgba(0, 122, 255, 0.4);
}

.login-button:hover:not(:disabled) {
    background: #0056CC;  /* Darker blue on hover */
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -8px rgba(0, 122, 255, 0.5);
}

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

.login-button:disabled {
    background: #C7C7CC;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}

.login-button i {
    margin-left: 8px;
    font-size: 16px;
    transition: transform 0.3s;
}

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

/* Success State */
.login-button.success {
    background: #34C759;  /* Green for success */
}

/* Button Loader */
.btn-loader {
    display: none;
    position: absolute;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.login-footer {
    text-align: center;
    padding: 20px 0 10px;
}

/* Theme Toggle */
.theme-toggle-top {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.theme-toggle-btn {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 30px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #007AFF;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .theme-toggle-btn {
    background: rgba(28, 28, 30, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
    color: #0A84FF;
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
}

.theme-toggle-btn i {
    margin-right: 8px;
    font-size: 16px;
}

/* ========================================
   SMOOTH THEME TRANSITIONS
   ======================================== */
* {
    transition: background-color 0.3s ease, 
                border-color 0.2s ease, 
                color 0.2s ease,
                box-shadow 0.2s ease;
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    .logo-aura-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .logo-circle-perfect {
        width: 120px;
        height: 120px;
        padding: 16px;
        border-width: 3px;
    }
    
    .welcome-card {
        padding: 25px 20px 35px;
    }
    
    .form-card {
        padding: 24px 20px;
    }
    
    .welcome-title {
        font-size: 28px;
    }
    
    .form-input {
        height: 48px;
    }
    
    .login-button {
        height: 52px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .logo-aura-wrapper {
        width: 100px;
        height: 100px;
    }
    
    .logo-circle-perfect {
        width: 100px;
        height: 100px;
        padding: 12px;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .forgot-password {
        align-self: flex-end;
    }
}