/* ========================================
   AUTH MODAL STYLES
   Unified login/register modal system
   ======================================== */

/* Modal Overlay */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Header */
.auth-modal-header {
    position: relative;
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.auth-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #6b7280;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.auth-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

/* Modal Tabs */
.auth-modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
}

.auth-modal-tab {
    flex: 1;
    padding: 12px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-modal-tab:hover {
    color: #111827;
}

.auth-modal-tab.active {
    color: #10b981;
    border-bottom-color: #10b981;
}

/* Modal Body */
.auth-modal-body {
    padding: 30px;
}

/* Forms */
.auth-modal-form {
    display: none;
}

.auth-modal-form.active {
    display: block;
}

.auth-modal-form .form-group {
    margin-bottom: 20px;
}

.auth-modal-form .form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.auth-modal-form .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s ease;
}

.auth-modal-form .form-control:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Password Input Wrapper */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-control {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #6b7280;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #111827;
}

.password-toggle .eye-icon::before {
    content: '👁️';
    font-size: 18px;
}

/* Form Row (for side-by-side inputs) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #4b5563;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label a {
    color: #10b981;
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* Submit Button */
.auth-modal-form .btn-submit {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.auth-modal-form .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.auth-modal-form .btn-submit:active {
    transform: translateY(0);
}

.auth-modal-form .btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Messages */
.auth-modal-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.auth-modal-message.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.auth-modal-message.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* Footer Links */
.auth-modal-footer {
    text-align: center;
    padding: 20px 30px 30px;
    font-size: 14px;
    color: #6b7280;
}

.auth-modal-footer a {
    color: #10b981;
    text-decoration: none;
    font-weight: 600;
}

.auth-modal-footer a:hover {
    text-decoration: underline;
}

/* Forgot Password Link */
.forgot-password {
    float: right;
    color: #10b981;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Form Hint */
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 8px;
}

.password-strength-bar {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    background: #10b981;
    transition: width 0.3s ease, background 0.3s ease;
}

.password-strength-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 640px) {
    .auth-modal {
        width: 95%;
        max-height: 95vh;
    }

    .auth-modal-header,
    .auth-modal-body,
    .auth-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .auth-modal-tab {
        font-size: 14px;
        padding: 10px 12px;
    }
}

/* Scrollbar Styling for Modal */
.auth-modal::-webkit-scrollbar {
    width: 8px;
}

.auth-modal::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 0 16px 16px 0;
}

.auth-modal::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.auth-modal::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}