/* ==================== Reset & Base Styles ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* ==================== Container & Layout ==================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.auth-card {
    background: var(--bg-white);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    padding: 22px;
    width: 100%;
    max-width: 480px;
    animation: slideUp 0.6s ease-out;
}

.register-card {
    max-width: 480px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== Logo Section ==================== */
.logo-section {
    text-align: center;
    margin-bottom: 18px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
}

/* ==================== Form Styles ==================== */
.auth-form {
    width: 100%;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.88rem;
}

.form-group input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.92rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: var(--bg-white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: #9ca3af;
}

.error-message {
    display: block;
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 3px;
    min-height: 16px;
}

/* ==================== Form Options ==================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-left: 6px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-group {
    margin-bottom: 15px;
}

.checkbox-group .checkbox-label {
    color: var(--text-secondary);
}

.checkbox-group a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.checkbox-group a:hover {
    text-decoration: underline;
}

.forgot-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ==================== Buttons ==================== */
.btn {
    width: 100%;
    padding: 11px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-social {
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.btn-social:hover {
    background: var(--bg-light);
    border-color: var(--text-secondary);
}

.btn-google svg {
    flex-shrink: 0;
}

.btn-facebook {
    background: #1877f2;
    border-color: #1877f2;
    color: white;
}

.btn-facebook:hover {
    background: #166fe5;
    border-color: #166fe5;
}

/* ==================== Divider ==================== */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 15px;
}

/* ==================== Social Login ==================== */
.social-login {
    margin-bottom: 25px;
}

/* ==================== Auth Switch ==================== */
.auth-switch {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 15px;
}

.auth-switch a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    margin-right: 5px;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ==================== Password Strength ==================== */
.password-strength {
    margin-top: 5px;
    height: 3px;
    border-radius: 2px;
    background: var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

.password-strength::after {
    content: '';
    display: block;
    height: 100%;
    width: 0%;
    background: var(--error-color);
    transition: all 0.3s ease;
}

.password-strength.weak::after {
    width: 33%;
    background: var(--error-color);
}

.password-strength.medium::after {
    width: 66%;
    background: var(--warning-color);
}

.password-strength.strong::after {
    width: 100%;
    background: var(--success-color);
}

/* ==================== Success/Error Messages ==================== */
.alert {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .auth-card {
        padding: 30px 20px;
        border-radius: 16px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 25px 15px;
    }
    
    .logo {
        font-size: 1.75rem;
    }
    
    .tagline {
        font-size: 0.9rem;
    }
}

/* ==================== Loading State ==================== */
.btn.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==================== Input States ==================== */
input.is-invalid {
    border-color: var(--error-color);
}

input.is-valid {
    border-color: var(--success-color);
}

input:disabled {
    background-color: var(--bg-light);
    cursor: not-allowed;
    opacity: 0.6;
}