/* Authentication UI Styles */

/* Modal Styles */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.auth-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Form Styles */
.auth-form {
    padding: 40px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.auth-header p {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: white;
    font-size: 28px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px 0;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    color: #1f2937;
    background: white;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #ff6b4a;
    box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.1);
}

input.error,
select.error,
textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group small {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Checkbox Styles */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: #ff6b4a;
    border-color: #ff6b4a;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label a {
    color: #ff6b4a;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Button Styles */
.auth-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.auth-btn.primary {
    background: #ff6b4a;
    color: white;
}

.auth-btn.primary:hover:not(:disabled) {
    background: #e55a3a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 74, 0.3);
}

.auth-btn.secondary {
    background: #f3f4f6;
    color: #374151;
}

.auth-btn.secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-btn .fa-spinner {
    font-size: 16px;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.auth-footer p {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 12px 0;
}

.auth-footer a {
    color: #ff6b4a;
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Navigation Auth Buttons */
.auth-nav-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.auth-nav-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.auth-nav-btn.login {
    background: transparent;
    color: #374151;
    border: 1px solid #d1d5db;
}

.auth-nav-btn.login:hover {
    background: #f3f4f6;
}

.auth-nav-btn.account {
    background: #ff6b4a;
    color: white;
}

.auth-nav-btn.account:hover {
    background: #e55a3a;
}

.auth-nav-btn.admin {
    background: #7c3aed;
    color: white;
}

.auth-nav-btn.admin:hover {
    background: #6d28d9;
}

.auth-nav-btn.logout {
    background: transparent;
    color: #6b7280;
}

.auth-nav-btn.logout:hover {
    color: #374151;
}

/* User Display */
.user-display {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #374151;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ff6b4a;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-weight: 500;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10001;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    border-left: 4px solid #10b981;
}

.notification.error {
    border-left: 4px solid #ef4444;
}

.notification.info {
    border-left: 4px solid #3b82f6;
}

.notification.session-warning {
    border-left: 4px solid #f59e0b;
    background: #fef3c7;
    max-width: 450px;
}

.notification i {
    font-size: 20px;
}

.notification.success i {
    color: #10b981;
}

.notification.error i {
    color: #ef4444;
}

.notification.info i {
    color: #3b82f6;
}

.notification.session-warning i {
    color: #f59e0b;
}

.notification span {
    font-size: 14px;
    color: #374151;
    flex: 1;
}

.notification.session-warning span {
    color: #92400e;
}

.notification button {
    background: #ff6b4a;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.notification button:hover {
    background: #e55a3a;
}

.notification.session-warning button {
    background: #f59e0b;
}

.notification.session-warning button:hover {
    background: #d97706;
}

.notification.inactivity-warning {
    border-left: 4px solid #ef4444;
    background: #fef2f2;
}

.notification.inactivity-warning i {
    color: #ef4444;
}

.notification.inactivity-warning span {
    color: #7f1d1d;
}

.notification.inactivity-warning button {
    background: #ef4444;
}

.notification.inactivity-warning button:hover {
    background: #dc2626;
}

/* Persistent Notification */
.notification.persistent {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10002;
    min-width: 300px;
    max-width: 450px;
}

.notification.persistent .btn-sm {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    color: inherit;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.notification.persistent .btn-sm:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Admin Mode Transition */
.admin-mode-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #7c3aed;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-mode-indicator i {
    font-size: 14px;
}

/* Admin Button Transitions */
.auth-nav-btn.admin {
    transition: all 0.3s ease;
}

.auth-nav-btn.admin.exit-mode {
    background: #f59e0b;
    border-color: #f59e0b;
}

.auth-nav-btn.admin.exit-mode:hover {
    background: #d97706;
    border-color: #d97706;
}

/* Request Admin Access Button */
.request-admin-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.request-admin-btn:hover {
    background: #2563eb;
}

.request-admin-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Admin Request Modal */
.admin-request-modal .modal-content {
    max-width: 500px;
}

.admin-request-reasons {
    margin: 20px 0;
}

.reason-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    cursor: pointer;
}

.reason-option input[type="radio"] {
    accent-color: #ff6b4a;
}

.reason-option label {
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.custom-reason-input {
    margin-top: 12px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
}

.custom-reason-input:focus {
    outline: none;
    border-color: #ff6b4a;
    box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .auth-modal {
        padding: 16px;
    }
    
    .auth-modal-content {
        max-height: 95vh;
    }
    
    .auth-form {
        padding: 24px;
    }
    
    .auth-header h2 {
        font-size: 24px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .auth-nav-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .auth-nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .notification {
        right: 16px;
        left: 16px;
        max-width: none;
    }
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #ff6b4a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form validation styles */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group.has-success input,
.form-group.has-success select,
.form-group.has-success textarea {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Accessibility */
.auth-modal-content:focus {
    outline: 2px solid #ff6b4a;
    outline-offset: 2px;
}

.auth-btn:focus {
    outline: 2px solid #ff6b4a;
    outline-offset: 2px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auth-modal-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .auth-btn.primary {
        border: 2px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .auth-modal-content {
        animation: none;
    }
    
    .auth-btn {
        transition: none;
    }
    
    .notification {
        transition: none;
    }
}