/* ==========================================
   Authentication Pages - Modern Design
   Premium styling for Login & Register
   ========================================== */

/* Auth Container - Full Page */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #FFC107 0%, #F57C00 100%);
    position: relative;
    overflow: hidden;
}

/* Animated Background Circles */
.auth-container::before,
.auth-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

.auth-container::before {
    width: 400px;
    height: 400px;
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.auth-container::after {
    width: 300px;
    height: 300px;
    bottom: -150px;
    right: -150px;
    animation-delay: 5s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.1;
    }
    50% {
        transform: translate(50px, 50px) scale(1.1);
        opacity: 0.15;
    }
}

/* Auth Card - Main Container */
.auth-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 100px rgba(102, 126, 234, 0.2);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: 35px;
    position: relative;
}

/* Removed circle decoration */
.auth-header::before {
    display: none;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 10px 0 8px 0;
    letter-spacing: -0.5px;
}

.auth-header p {
    font-size: 15px;
    color: #666;
    margin: 0;
    font-weight: 400;
}

/* Logo removed - not needed */
.auth-logo {
    display: none;
}

/* Form Styling */
#login-form,
#register-form {
    margin-bottom: 20px;
}

/* Form Group */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group:last-of-type {
    margin-bottom: 25px;
}

/* Form Label */
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    letter-spacing: 0.2px;
    transition: color 0.2s;
}

.form-label .material-icons {
    font-size: 16px;
    vertical-align: middle;
    margin-left: 4px;
    color: #667eea;
}

/* Required Star */
.form-label span[style*="color: #dc3545"] {
    color: #F44336 !important;
    font-weight: 700;
    margin-right: 2px;
}

/* Form Input */
.form-input {
    width: 100%;
    padding: 14px 16px;
    padding-right: 45px; /* مساحة للأيقونة */
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: #f8f9fa;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    color: #1a1a1a;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #FFC107;
    background: white;
    box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: #999;
    font-weight: 400;
}

/* Input Icons */
.form-group {
    position: relative;
}

.form-group .material-icons {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 20px;
    pointer-events: none;
    transition: color 0.3s;
}

.form-group:has(.form-input:focus) .material-icons {
    color: #FFC107;
}

.form-input:has(~ .material-icons) {
    padding-right: 50px;
}

/* Form Hint */
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #666;
    font-weight: 400;
    line-height: 1.4;
}

.form-hint .material-icons {
    font-size: 14px;
    vertical-align: middle;
    margin-left: 4px;
    color: #2196F3;
}

/* Input with Icon */
.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: 50px;
}

.input-with-icon .input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    pointer-events: none;
    transition: color 0.3s;
}

.input-with-icon input:focus ~ .input-icon {
    color: #FFC107;
}

/* Button Styling */
.btn {
    width: 100%;
    padding: 15px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #FFC107 0%, #F57C00 100%);
    color: #1a1a1a;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 193, 7, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.btn .material-icons {
    font-size: 20px;
}

.btn-block {
    width: 100%;
    display: block;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #e0e0e0;
}

.auth-footer p {
    margin: 0;
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

.auth-footer a {
    color: #FFC107;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    position: relative;
}

.auth-footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 0;
    height: 2px;
    background: #FFC107;
    transition: width 0.3s;
}

.auth-footer a:hover {
    color: #F57C00;
}

.auth-footer a:hover::after {
    width: 100%;
    right: auto;
    left: 0;
}

/* Validation States */
.form-input:invalid:not(:placeholder-shown) {
    border-color: #F44336;
}

.form-input:valid:not(:placeholder-shown) {
    border-color: #4CAF50;
}

.form-input:invalid:not(:placeholder-shown):focus {
    box-shadow: 0 0 0 4px rgba(244, 67, 54, 0.1);
    border-color: #F44336;
}

.form-input:valid:not(:placeholder-shown):focus {
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
    border-color: #4CAF50;
}

/* Error Message */
.error-message {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #F44336;
    font-weight: 500;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Success Message */
.success-message {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #4CAF50;
    font-weight: 500;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 25px 0;
    color: #999;
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.auth-divider span {
    padding: 0 15px;
}

/* Social Login Buttons (Optional) */
.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 20px;
}

.social-btn {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.social-btn:hover {
    border-color: #FFC107;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.social-btn img {
    width: 20px;
    height: 20px;
}

/* Loading State */
.btn.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    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); }
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s;
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background: #F44336;
}

.password-strength-bar.medium {
    width: 66%;
    background: #FF9800;
}

.password-strength-bar.strong {
    width: 100%;
    background: #4CAF50;
}

/* Responsive Design */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
        margin: 15px;
    }
    
    .auth-header h2 {
        font-size: 24px;
    }
    
    .btn {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .form-input {
        padding: 13px 14px;
        font-size: 14px;
    }
}

/* RTL Support */
[dir="rtl"] .form-input {
    padding-left: 45px;
    padding-right: 16px;
}

[dir="rtl"] .form-group .material-icons,
[dir="rtl"] .input-with-icon .input-icon {
    left: auto;
    right: 16px;
}

[dir="rtl"] .auth-footer a::after {
    right: auto;
    left: 0;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: rgba(26, 26, 27, 0.95);
    }
    
    .auth-header h2,
    .form-label {
        color: #fff;
    }
    
    .auth-header p,
    .form-hint,
    .auth-footer p {
        color: #999;
    }
    
    .form-input {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: #fff;
    }
    
    .form-input:focus {
        background: rgba(255, 255, 255, 0.08);
        border-color: #667eea;
    }
}

/* Hide Navigation on Auth Pages */
body:has(.auth-container) #app-header,
body:has(.auth-container) .app-header,
body:has(.auth-container) #bottom-nav,
body:has(.auth-container) .bottom-nav,
body:has(.auth-container) nav,
body:has(.auth-container) footer {
    display: none !important;
}

/* Make auth container full screen */
body:has(.auth-container) #app,
body:has(.auth-container) .app-container {
    display: flex !important;
    padding: 0 !important;
    margin: 0 !important;
}

body:has(.auth-container) #main-content {
    padding: 0 !important;
    margin: 0 !important;
    width: 100vw;
    height: 100vh;
}

body:has(.auth-container) {
    overflow-x: hidden;
}

/* Print Styles */
@media print {
    .auth-container {
        background: white;
    }
    
    .auth-container::before,
    .auth-container::after {
        display: none;
    }
    
    .auth-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
