/* Professional Authentication Forms Enhancements */
/* This file contains professional styling improvements for login and registration forms */

/* ===== ENHANCED AUTH CONTAINER ===== */

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.02"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
}

/* ===== ENHANCED AUTH CARD ===== */

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-2xl);
    width: 100%;
    max-width: 900px;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--radius-2xl);
    pointer-events: none;
}

[data-mdb-theme="dark"] .auth-card {
    background: rgba(var(--bg-card-rgb), 0.95);
    border-color: var(--border-color);
}

[data-mdb-theme="dark"] .auth-card::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

/* ===== ENHANCED AUTH HEADER ===== */

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    position: relative;
    z-index: 1;
}

.auth-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.auth-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-muted);
    margin-bottom: 0;
    font-weight: 400;
}

.auth-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-lg);
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.auth-logo i {
    font-size: var(--font-size-2xl);
    color: var(--text-light);
}

/* ===== ENHANCED PROGRESS INDICATOR ===== */

.auth-progress {
    margin-bottom: var(--spacing-xl);
    position: relative;
    z-index: 1;
}

.auth-progress .progress {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--bg-card-secondary);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.auth-progress .progress-bar {
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.auth-progress .progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.auth-progress-text {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
    font-weight: 500;
}

/* ===== ENHANCED FORM FIELDS ===== */

.auth-form {
    position: relative;
    z-index: 1;
}

.auth-form-group {
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.auth-form-floating {
    position: relative;
}

.auth-form-floating .form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-md);
    font-size: var(--font-size-base);
    background: var(--bg-card);
    transition: all 0.3s ease;
    height: auto;
    min-height: 56px;
}

.auth-form-floating .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25), var(--shadow-md);
    transform: translateY(-1px);
}

.auth-form-floating .form-control:not(:placeholder-shown) {
    border-color: var(--primary);
}

.auth-form-floating label {
    position: absolute;
    top: 50%;
    left: var(--spacing-md);
    transform: translateY(-50%);
    background: var(--bg-card);
    padding: 0 var(--spacing-xs);
    color: var(--text-muted);
    font-size: var(--font-size-base);
    font-weight: 500;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.auth-form-floating .form-control:focus ~ label,
.auth-form-floating .form-control:not(:placeholder-shown) ~ label {
    top: 0;
    transform: translateY(-50%) scale(0.85);
    color: var(--primary);
    font-weight: 600;
}

/* Enhanced form control icons */
.auth-form-icon {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: var(--font-size-lg);
    transition: all 0.3s ease;
    z-index: 2;
}

.auth-form-floating .form-control:focus ~ .auth-form-icon {
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.auth-password-input {
    padding-right: calc(var(--spacing-xl) + 2.25rem);
}

.auth-password-toggle {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: var(--font-size-lg);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: var(--radius-full);
    z-index: 2;
    transition: color 0.2s ease, transform 0.2s ease;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus {
    color: var(--primary);
    transform: translateY(-50%) scale(1.05);
    outline: none;
}

.auth-form-floating .form-control:focus ~ .auth-password-toggle {
    color: var(--primary);
}

[dir="rtl"] .auth-form-icon {
    right: auto;
    left: var(--spacing-md);
}

[dir="rtl"] .auth-password-toggle {
    right: auto;
    left: var(--spacing-md);
}

[dir="rtl"] .auth-form-floating label {
    left: auto;
    right: var(--spacing-md);
}

/* ===== ENHANCED FILE UPLOAD ===== */

.auth-file-upload {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.auth-file-upload .form-control {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    background: var(--bg-card-secondary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.auth-file-upload .form-control:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.auth-file-upload .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.25);
}

.auth-file-upload-content {
    pointer-events: none;
}

.auth-file-upload-icon {
    font-size: var(--font-size-3xl);
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.auth-file-upload-text {
    font-size: var(--font-size-base);
    color: var(--text-color);
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.auth-file-upload-hint {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ===== ENHANCED BUTTONS ===== */

.auth-button {
    width: 100%;
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: var(--font-size-lg);
    font-weight: 600;
    border-radius: var(--radius-full);
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--text-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    text-transform: none;
    letter-spacing: 0.5px;
}

.auth-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    transition: left 0.6s ease;
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.auth-button:hover::before {
    left: 100%;
}

.auth-button:active {
    transform: translateY(0);
}

.auth-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-button:disabled:hover {
    transform: none;
    box-shadow: var(--shadow-md);
}

.auth-button-spinner {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.auth-button-spinner .spinner-border {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* ===== ENHANCED LINKS ===== */

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    pointer-events: auto;
    cursor: pointer;
    z-index: 20;
}

.auth-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
    transition: width 0.3s ease;
}

.auth-link:hover {
    color: var(--primary);
    text-decoration: none;
}

.auth-link:hover::after {
    width: 100%;
}

.auth-link-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

/* ===== ENHANCED VALIDATION STATES ===== */

.auth-form-floating .form-control.is-valid {
    border-color: #28a745;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='m2.3 6.73.94-.94 1.44 1.44L7.4 4.5l.94.94L4.66 9.2z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    background-size: 16px;
}

.auth-form-floating .form-control.is-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.auth-form-floating .form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 4.6 1.4 1.4M7.2 4.6l-1.4 1.4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    background-size: 16px;
}

.auth-form-floating .form-control.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.auth-feedback {
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
    display: none !important;
    align-items: center;
    gap: var(--spacing-xs);
    min-height: 20px;
    width: 100%;
    position: relative;
}

.auth-feedback.valid-feedback {
    color: #28a745 !important;
}

.auth-feedback.invalid-feedback {
    color: #dc3545 !important;
    font-weight: 500;
}

.auth-feedback.show {
    display: flex !important;
}

/* Override conflicting styles from other CSS files */
.auth-form-group .auth-feedback.invalid-feedback {
    display: none !important;
    position: relative;
    margin-top: var(--spacing-xs);
    margin-bottom: 0;
    width: 100%;
    clear: both;
}

.auth-form-group .auth-feedback.invalid-feedback.show {
    display: flex !important;
}

/* Additional specificity to override Bootstrap/MDB styles */
.auth-form-group .invalid-feedback.auth-feedback {
    display: none !important;
    position: static;
    margin-top: var(--spacing-xs);
    margin-bottom: 0;
}

.auth-form-group .invalid-feedback.auth-feedback.show {
    display: flex !important;
}

.auth-feedback i {
    font-size: var(--font-size-sm);
}

/* ===== ENHANCED DIVIDERS ===== */

.auth-divider {
    display: flex;
    align-items: center;
    margin: var(--spacing-xl) 0;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--border-color) 50%, transparent 100%);
}

.auth-divider::before {
    margin-right: var(--spacing-md);
}

.auth-divider::after {
    margin-left: var(--spacing-md);
}

/* ===== ENHANCED SOCIAL BUTTONS ===== */

.auth-social-buttons {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.auth-social-button {
    flex: 1;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-social-button:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.auth-social-button i {
    font-size: var(--font-size-lg);
}

/* ===== ENHANCED FOOTER ===== */

.auth-footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.auth-footer-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    pointer-events: auto;
    position: relative;
    z-index: 15;
}

.auth-footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.auth-footer-link {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.auth-footer-link:hover {
    color: var(--primary);
}

/* ===== ENHANCED ANIMATIONS ===== */

.auth-fade-in {
    animation: authFadeIn 0.6s ease-out;
}

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

.auth-slide-in {
    animation: authSlideIn 0.6s ease-out;
}

@keyframes authSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}


.auth-scale-in {
    animation: authScaleIn 0.6s ease-out;
}

@keyframes authScaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== ENHANCED LOADING STATES ===== */

.auth-loading {
    position: relative;
    pointer-events: none;
}

.auth-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(var(--bg-card-rgb), 0.8);
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.auth-skeleton {
    background: linear-gradient(90deg, var(--bg-card-secondary) 25%, var(--bg-card) 50%, var(--bg-card-secondary) 75%);
    background-size: 200% 100%;
    animation: authSkeleton 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes authSkeleton {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== RESPONSIVE DESIGN ===== */

@media (max-width: 768px) {
    .auth-container {
        padding: var(--spacing-md);
    }
    
    .auth-card {
        padding: var(--spacing-xl);
        border-radius: var(--radius-xl);
    }
    
    .auth-title {
        font-size: var(--font-size-3xl);
    }
    
    .auth-form-floating .form-control {
        padding: var(--spacing-md);
        min-height: 50px;
    }
    
    .auth-button {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: var(--font-size-base);
    }
    
    .auth-social-buttons {
        flex-direction: column;
    }
    
    .auth-footer-links {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

@media (max-width: 576px) {
    .auth-card {
        padding: var(--spacing-lg);
    }
    
    .auth-title {
        font-size: var(--font-size-2xl);
    }
    
    .auth-logo {
        width: 60px;
        height: 60px;
    }
    
    .auth-logo i {
        font-size: var(--font-size-xl);
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

.auth-form-floating .form-control:focus {
    outline: none;
}

.auth-button:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.auth-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-card {
        border-width: 2px;
    }
    
    .auth-form-floating .form-control {
        border-width: 2px;
    }
    
    .auth-button {
        border: 2px solid var(--primary);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .auth-fade-in,
    .auth-slide-in,
    .auth-scale-in {
        animation: none;
    }
    
    .auth-form-floating .form-control,
    .auth-form-floating label,
    .auth-button,
    .auth-link {
        transition: none;
    }
}

/* ===== PRINT STYLES ===== */

@media print {
    .auth-container {
        background: none;
    }
    
    .auth-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .auth-button,
    .auth-social-buttons {
        display: none;
    }
    
    .auth-form-floating .form-control {
        border: 1px solid #ddd;
        box-shadow: none;
    }
}

/* ===== DARK THEME SPECIFIC ENHANCEMENTS ===== */

[data-mdb-theme="dark"] .auth-container {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
}

[data-mdb-theme="dark"] .auth-form-floating .form-control {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-mdb-theme="dark"] .auth-form-floating label {
    background: var(--bg-card);
    color: var(--text-muted);
}

[data-mdb-theme="dark"] .auth-file-upload .form-control {
    background: var(--bg-card-secondary);
    border-color: var(--border-color);
}

[data-mdb-theme="dark"] .auth-social-button {
    background: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-mdb-theme="dark"] .auth-social-button:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

/* ===== RTL SPECIFIC ENHANCEMENTS ===== */

[dir="rtl"] .auth-form-floating .form-control.is-valid,
[dir="rtl"] .auth-form-floating .form-control.is-invalid {
    background-position: left var(--spacing-md) center;
}

[dir="rtl"] .auth-divider::before {
    margin-right: 0;
    margin-left: var(--spacing-md);
}

[dir="rtl"] .auth-divider::after {
    margin-left: 0;
    margin-right: var(--spacing-md);
}

/* ===== ENHANCED FOCUS MANAGEMENT ===== */

.auth-focus-trap {
    position: relative;
}

.auth-focus-trap::before,
.auth-focus-trap::after {
    content: '';
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.auth-focus-trap::before {
    top: 0;
    left: 0;
}

.auth-focus-trap::after {
    bottom: 0;
    right: 0;
}

/* ===== ENHANCED ERROR HANDLING ===== */

.auth-error-container {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.auth-error-icon {
    color: #dc3545;
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.auth-error-message {
    color: #dc3545;
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin: 0;
}

.auth-success-container {
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.auth-success-icon {
    color: #28a745;
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.auth-success-message {
    color: #28a745;
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin: 0;
}

/* ===== ENHANCED TOOLTIPS ===== */

.auth-tooltip {
    position: relative;
    display: inline-block;
}

.auth-tooltip .auth-tooltip-text {
    visibility: hidden;
    width: 200px;
    background: var(--bg-tooltip);
    color: var(--text-tooltip);
    text-align: center;
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: var(--font-size-sm);
    box-shadow: var(--shadow-lg);
}

.auth-tooltip .auth-tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--bg-tooltip) transparent transparent transparent;
}

.auth-tooltip:hover .auth-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ===== END OF AUTH FORMS ENHANCEMENTS ===== */