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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #333;
}

/* Container and Card */
.container {
    width: 100%;
    max-width: 450px;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
}

.error-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    border: 2px solid #f44336;
}

/* Logo */
.logo {
    height: 144px;
    width: auto;
    margin-bottom: 24px;
    object-fit: contain;
}

.logo-placeholder {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.logo-icon {
    font-size: 32px;
    color: white;
    font-weight: bold;
}

/* Typography */
h1 {
    color: #1a202c;
    margin-bottom: 8px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    color: #2d3748;
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
}

p {
    color: #4a5568;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 16px;
}

.small-text {
    font-size: 14px;
    color: #718096;
    margin-top: 16px;
    margin-bottom: 0;
}

/* Loading State */
#loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Icons */
.icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 36px;
    font-weight: bold;
    color: white;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.success-icon {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.error-icon {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

.info-icon {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    font-size: 24px;
}

/* Buttons */
.primary-button, .secondary-button {
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.primary-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.secondary-button {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.secondary-button:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

/* Form Styles */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #f7fafc;
}

input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: white;
}

.password-requirements {
    margin-top: 6px;
}

.password-requirements small {
    color: #718096;
    font-size: 14px;
}

/* Error Messages */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 12px 16px;
    border-radius: 8px;
    margin-top: 16px;
    font-size: 14px;
    border: 1px solid #feb2b2;
    text-align: left;
}

/* Success and Error Containers */
.success, .error, .password-reset {
    animation: slideUp 0.3s ease;
}

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

/* Auto Redirect */
.auto-redirect {
    margin-top: 20px;
    padding: 12px;
    background: #e6fffa;
    border-radius: 8px;
    border: 1px solid #b2f5ea;
}

.auto-redirect p {
    margin: 0;
    font-size: 14px;
    color: #234e52;
}

#countdown {
    font-weight: 600;
    color: #1a365d;
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }
    
    .auth-card, .error-card {
        padding: 32px 24px;
    }
    
    .container {
        padding: 0;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .icon {
        width: 64px;
        height: 64px;
        font-size: 28px;
        margin-bottom: 20px;
    }
    
    .info-icon {
        font-size: 20px;
    }
    
    .primary-button, .secondary-button {
        padding: 12px 24px;
        font-size: 15px;
    }
}

@media (max-width: 360px) {
    .auth-card, .error-card {
        padding: 24px 20px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    h2 {
        font-size: 18px;
    }
    
    p {
        font-size: 15px;
    }
}

/* Dark mode support (if user's device is in dark mode) */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: #2d3748;
        color: #f7fafc;
    }
    
    h1, h2 {
        color: #f7fafc;
    }
    
    p {
        color: #cbd5e0;
    }
    
    .small-text {
        color: #a0aec0;
    }
    
    input[type="password"] {
        background: #4a5568;
        border-color: #718096;
        color: #f7fafc;
    }
    
    input[type="password"]:focus {
        background: #2d3748;
        border-color: #667eea;
    }
    
    .secondary-button {
        background: #4a5568;
        color: #f7fafc;
        border-color: #718096;
    }
    
    .secondary-button:hover {
        background: #2d3748;
        border-color: #a0aec0;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .auth-card {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .primary-button, .secondary-button {
        border: 1px solid #000;
        background: white;
        color: black;
    }
}