/* AUTH PAGES - Clean, Professional Design */

/* Reset and Base */
* {
    box-sizing: border-box;
}

/* Override body background for auth pages */
body.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-x: hidden !important;
    padding-top: 80px !important; /* Add space for fixed navbar */
    box-sizing: border-box !important;
}

/* Ensure footer is at the bottom */
body.auth-page .footer {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%) !important;
    position: relative !important;
    z-index: 10 !important;
    margin-top: auto !important; /* Push footer to bottom */
    margin-bottom: 0 !important; /* Remove any bottom margin */
    width: 100% !important;
    flex-shrink: 0 !important; /* Don't shrink footer */
    overflow: hidden !important;
}

/* Navbar styling for auth pages - ensure it's at the top */
body.auth-page .navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    margin: 0 !important;
    padding: 1rem 2rem !important;
}

/* Language dropdown styling for auth pages - use original styling */
/* Let the original language dropdown styling from main-theme.css take precedence */

/* Language dropdown content styling - use original styling */
/* Let the original language dropdown styling from main-theme.css take precedence */

/* Auth Container */
.auth-container {
    flex: 1 !important; /* Take up remaining space */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    padding: 1rem !important;
    position: relative !important;
    overflow-y: auto !important;
    margin: 0 !important;
    width: 100% !important;
    padding-top: 0 !important; /* No extra padding since body has padding-top */
    padding-bottom: 1rem !important; /* Add some bottom padding */
    min-height: 0 !important; /* Allow flex shrinking */
}

/* Small photo styling for login page */
.auth-photo {
    text-align: center !important;
    margin: 1.5rem 0 !important;
}

.random-photo {
    width: 200px !important;
    height: 150px !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
    border: 3px solid rgba(255, 255, 255, 0.8) !important;
}

/* Auth Content */
.auth-content {
    display: flex !important;
    max-width: 800px !important;
    width: 100% !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 16px !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: blur(15px) !important;
    overflow: hidden !important;
    min-height: 450px !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Auth Intro */
.auth-intro {
    flex: 1 !important;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%) !important;
    color: white !important;
    padding: 3rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    position: relative !important;
}

/* Auth Form Section */
.auth-form-section {
    width: 100% !important;
    max-width: 400px !important;
    padding: 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    background: white !important;
    margin: 0 auto !important;
    border-radius: 16px !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15) !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Registration page specific styling - compact grid layout */
.auth-container > .auth-form-section {
    max-width: 700px !important;
    padding: 1.5rem !important;
    margin-bottom: 2rem !important;
}

.auth-container > .auth-form-section .auth-form {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.75rem 1rem !important;
}

.auth-container > .auth-form-section .form-group {
    margin-bottom: 0 !important;
}

.auth-container > .auth-form-section .form-group.full-width {
    grid-column: 1 / -1 !important;
}

.auth-container > .auth-form-section .form-group label {
    margin-bottom: 0.2rem !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
}

.auth-container > .auth-form-section .form-group input,
.auth-container > .auth-form-section .form-group select {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.85rem !important;
    border: 1px solid #d1d5db !important;
}

.auth-container > .auth-form-section h2 {
    font-size: 1.3rem !important;
    margin-bottom: 1rem !important;
    grid-column: 1 / -1 !important;
    text-align: center !important;
}

.auth-container > .auth-form-section .btn {
    grid-column: 1 / -1 !important;
    margin-top: 0.5rem !important;
    padding: 0.6rem 1rem !important;
    font-size: 0.9rem !important;
}

.auth-container > .auth-form-section .auth-links {
    grid-column: 1 / -1 !important;
    text-align: center !important;
    margin-top: 0.5rem !important;
}

/* Login page specific styling - normal size fields */
.auth-content .auth-form-section {
    max-width: 400px !important;
}

.auth-content .auth-form {
    display: block !important;
}

.auth-content .form-group {
    margin-bottom: 1rem !important;
}

.auth-content .form-group label {
    margin-bottom: 0.5rem !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
}

.auth-content .form-group input {
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
    border: 2px solid #e5e7eb !important;
}

.auth-content .auth-form-section h2 {
    font-size: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
}

.auth-content .btn {
    margin-top: 1rem !important;
    padding: 0.75rem 1.5rem !important;
    font-size: 1rem !important;
}

/* Form Header */
.auth-form-section h2 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #1e3a8a !important;
    margin-bottom: 1rem !important;
    text-align: center !important;
}

/* Form Styling */
.form-group {
    margin-bottom: 1rem !important;
}

.form-group label {
    display: block !important;
    margin-bottom: 0.25rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    font-size: 0.9rem !important;
}

.form-group input,
.form-group select {
    width: 100% !important;
    padding: 0.6rem 0.8rem !important;
    border: 2px solid #e5e7eb !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    transition: all 0.3s ease !important;
    background: white !important;
}

.form-group input:focus,
.form-group select:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

/* Button Styling */
.btn {
    width: 100% !important;
    padding: 0.875rem 1.5rem !important;
    background: linear-gradient(135deg, #3b82f6 0%, #1e3a8a 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 0.75rem !important;
}

.btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3) !important;
}

/* Link Styling */
.auth-form-section a,
.auth-links a {
    color: #3b82f6 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    text-align: center !important;
    margin-top: 1rem !important;
    display: block !important;
    transition: color 0.3s ease !important;
}

.auth-form-section a:hover,
.auth-links a:hover {
    color: #1e3a8a !important;
    text-decoration: underline !important;
}

.auth-links {
    text-align: center !important;
    margin-top: 1.5rem !important;
}

/* Footer styling for auth pages */
body.auth-page .footer {
    background: #1f2937 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Photo Overlay removed - was interfering with clicks */

/* Dark overlay removed - was blocking clicks */

/* Main Content */
.auth-content {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 450px;
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    margin: 2rem 0;
}

/* Header Section */
.auth-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.auth-header p {
    font-size: 0.9rem;
    opacity: 1;
    line-height: 1.4;
    margin: 0;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    font-weight: 500;
}

/* Language Selector - Specific overrides for auth pages */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-btn {
    background: white;
    border: 3px solid #1e3a8a;
    color: #1e3a8a;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.3);
    backdrop-filter: blur(10px);
    min-width: 100px;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dropdown-arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.language-btn:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.language-btn:hover {
    background: #1e3a8a;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
}

/* Old language dropdown CSS removed - now using body.auth-page specific styling */

/* Form Section */
.auth-form-section {
    padding: 1.5rem;
}

.auth-form-section h2 {
    text-align: center;
    margin: 0 0 1rem 0;
    color: #1e3a8a;
    font-size: 1.3rem;
    font-weight: 600;
}

/* Form Styles */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-control {
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    color: #374151;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.form-control::placeholder {
    color: #9ca3af;
}

/* Button Styles */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    box-shadow: 0 4px 15px rgba(30, 58, 138, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1e40af, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 58, 138, 0.6);
}

.btn-secondary {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    color: white;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #4b5563, #6b7280);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(107, 114, 128, 0.6);
}

/* Error and Success Messages */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border: none;
    font-weight: 500;
}

.alert-danger {
    background: #fef2f2;
    color: #dc2626;
    border-left: 4px solid #ef4444;
}

.alert-success {
    background: #f0fdf4;
    color: #16a34a;
    border-left: 4px solid #22c55e;
}

/* Links */
.auth-links {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.auth-links a {
    color: #1e3a8a;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.auth-links a:hover {
    color: #3b82f6;
    text-decoration: underline;
}

/* Form Validation */
.form-control.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-control.is-valid {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.invalid-feedback {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.valid-feedback {
    color: #22c55e;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Live Username Validation */
.feedback-message {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feedback-message.checking {
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
}

.feedback-message.valid {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.feedback-message.invalid {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.feedback-message.error {
    color: #dc2626;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.feedback-message:empty {
    display: none;
}

/* Username input specific styling */
#username {
    transition: all 0.3s ease;
}

#username:focus {
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

#username.is-valid:focus {
    border-color: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

#username.is-invalid:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-content {
        max-width: 100%;
        margin-right: 0;
    }
    
    .language-selector {
        position: fixed;
        top: 10px;
        right: 10px;
    }
    
    .auth-header {
        padding: 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.5rem;
    }
    
    .auth-form-section {
        padding: 2rem;
    }
    
    .auth-form-section h2 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 0.5rem;
    }
    
    .auth-content {
        margin-right: 0;
    }
    
    .language-selector {
        top: 5px;
        right: 5px;
    }
    
    .language-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    .auth-header,
    .auth-form-section {
        padding: 1.5rem;
    }
    
    .auth-header h1 {
        font-size: 1.25rem;
    }
    
    .auth-form-section h2 {
        font-size: 1.125rem;
    }
    
    .form-control {
        padding: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
    }
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    body.auth-page {
        padding-top: 70px !important; /* Smaller navbar on mobile */
    }
    
    .auth-container {
        padding: 0.5rem !important;
    }
    
    .auth-content {
        max-width: 100% !important;
        min-height: 350px !important;
        border-radius: 12px !important;
        margin: 0 0.5rem !important;
    }
    
    .auth-form-section {
        max-width: 100% !important;
        padding: 1.25rem !important;
        border-radius: 12px !important;
    }
    
    .auth-form-section h2 {
        font-size: 1.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .form-group {
        margin-bottom: 0.75rem !important;
    }
    
    .form-control {
        padding: 0.75rem !important;
        font-size: 1rem !important;
    }
    
    .btn {
        padding: 0.75rem 1.5rem !important;
        font-size: 1rem !important;
    }
    
    .auth-links {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .auth-links a {
        text-align: center !important;
        padding: 0.5rem !important;
    }
    
    .random-photo {
        width: 150px !important;
        height: 120px !important;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 0.25rem !important;
    }
    
    .auth-content {
        margin: 0 0.25rem !important;
        border-radius: 8px !important;
    }
    
    .auth-form-section {
        padding: 1rem !important;
        border-radius: 8px !important;
    }
    
    .form-group {
        margin-bottom: 0.5rem !important;
    }
    
    .auth-form-section h2 {
        font-size: 1.25rem !important;
    }
    
    .form-control {
        padding: 0.5rem 0.7rem !important;
        font-size: 0.9rem !important;
    }
    
    .btn {
        padding: 0.6rem 1.25rem !important;
        font-size: 0.9rem !important;
    }
    
    .random-photo {
        width: 120px !important;
        height: 100px !important;
    }
    
    /* Mobile responsive for registration grid */
    .auth-container > .auth-form-section .auth-form {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    
    .auth-container > .auth-form-section {
        max-width: 100% !important;
        padding: 1rem !important;
        margin-bottom: 1.5rem !important;
    }
}

/* Loading States */
.btn:disabled,
.btn.btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    background: #9ca3af !important;
    color: #6b7280 !important;
    box-shadow: none !important;
}

.btn:disabled:hover,
.btn.btn-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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