/* ==========================================================================
   COUNSELYA - Authentication Modal Styles
   ========================================================================== */

/* Modal Overlay */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.auth-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Modal Card */
.auth-modal {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(30px);
    transition: transform 0.3s ease;
    position: relative;
}

.auth-modal-overlay.show .auth-modal {
    transform: translateY(0);
}

/* Close Button */
.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.auth-modal-close:hover {
    background: #f1f5f9;
    color: #CDD4DD;
}

/* Modal Header */
.auth-modal-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
}

.auth-modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.auth-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #CDD4DD;
    margin: 0;
}

.auth-modal-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin-top: 0.5rem;
}

/* User Type Tabs */
.user-type-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 2rem;
    margin-bottom: 1.5rem;
}

.user-type-tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 12px;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-type-tab:hover {
    background: #e2e8f0;
}

.user-type-tab.active {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 129, 154, 0.3);
}

/* Auth Mode Tabs (Login/Signup) */
.auth-mode-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.auth-mode-tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: none;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.auth-mode-tab:hover {
    color: #90C2E7;
}

.auth-mode-tab.active {
    color: #90C2E7;
}

.auth-mode-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 3px 3px 0 0;
}

/* Form Container */
.auth-form-container {
    padding: 0 2rem 2rem;
}

.auth-form-content {
    display: none;
}

.auth-form-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Fields */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    color: #CDD4DD;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #90C2E7;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: #94a3b8;
}

/* Form Row (for two fields side by side) */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-checkbox label {
    font-size: 0.875rem;
    color: #64748b;
    cursor: pointer;
}

/* Password Strength Indicator */
.password-strength {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    display: none;
}

.password-strength.show {
    display: block;
}

.password-strength-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-bottom: 0.25rem;
    overflow: hidden;
}

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

.password-strength.weak .password-strength-fill {
    width: 33%;
    background: #ef4444;
}

.password-strength.medium .password-strength-fill {
    width: 66%;
    background: #f59e0b;
}

.password-strength.strong .password-strength-fill {
    width: 100%;
    background: #22819A;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 12px;
    background: var(--primary-gradient);
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

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

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

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #94a3b8;
    font-size: 0.875rem;
}

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

.auth-divider::before {
    margin-right: 1rem;
}

.auth-divider::after {
    margin-left: 1rem;
}

/* Social Login */
.social-login-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.social-login-btn {
    padding: 0.875rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    color: #CDD4DD;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.social-login-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

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

/* Error Message */
.auth-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.auth-error.show {
    display: block;
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Success Message */
.auth-success {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: none;
}

.auth-success.show {
    display: block;
}

/* Forgot Password Link */
.forgot-password {
    text-align: right;
}

.forgot-password a {
    color: #90C2E7;
    font-size: 0.875rem;
    text-decoration: none;
    font-weight: 500;
}

.forgot-password a:hover {
    text-decoration: underline;
}

/* User Menu (Header) */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu-toggle:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-weight: 600;
    color: #CDD4DD;
    font-size: 0.9rem;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: #CDD4DD;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-item:hover {
    background: #f8fafc;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .auth-modal {
        width: 95%;
        max-height: 95vh;
    }

    .auth-modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .user-type-tabs,
    .auth-mode-tabs,
    .auth-form-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .social-login-buttons {
        grid-template-columns: 1fr;
    }
}