/* ============================================
   AUTH MODAL STYLES - auth-modal.css
   লগইন/রেজিস্টার মডালের জন্য আধুনিক ও স্মার্ট CSS
   ============================================ */

/* Overlay */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6); /* Slate overlay with transparency */
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: authFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Container */
.auth-modal-container {
    width: 100%;
    max-width: 440px; /* reduced from 500px to be sleeker */
    margin: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: calc(100vh - 32px);
}

/* Modal */
.auth-modal {
    background: #ffffff;
    border-radius: 16px; /* reduced from 24px for a sharper modern look */
    position: relative;
    max-height: calc(100vh - 32px);
    width: 100%;
    display: flex;
    flex-direction: column;
    animation: authSlideInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
}

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

.auth-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Modal Header with Segmented Tabs */
.auth-modal-header {
    padding: 20px 24px 8px;
    flex-shrink: 0;
}

.auth-tabs {
    display: flex;
    gap: 6px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.auth-tab {
    flex: 1;
    padding: 8px 12px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.auth-tab.active {
    color: var(--primary, #017e3d);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Form Container */
.auth-form-container {
    padding: 16px 24px 24px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Custom scrollbar for form container */
.auth-form-container::-webkit-scrollbar {
    width: 6px;
}

.auth-form-container::-webkit-scrollbar-track {
    background: transparent;
}

.auth-form-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.auth-form-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.auth-form-header {
    text-align: center;
    margin-bottom: 16px;
}

.auth-form-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.auth-form-header p {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 0;
}

/* Form Groups */
.auth-form .form-group {
    margin-bottom: 12px;
}

.auth-form .form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #334155;
    font-size: 13px;
}

.auth-form .form-label i {
    color: var(--primary, #017e3d);
    margin-right: 4px;
}

.auth-form .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13.5px;
    color: #0f172a;
    transition: all 0.2s ease;
    background-color: #fff;
}

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

.auth-form .form-control:focus {
    outline: none;
    border-color: var(--primary, #017e3d);
    box-shadow: 0 0 0 3px rgba(1, 126, 61, 0.12);
}

.auth-form .form-control.is-invalid {
    border-color: #ef4444;
}

.auth-form .invalid-feedback {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

/* Password Toggle */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-control {
    padding-right: 40px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 15px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password:hover {
    color: #0f172a;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #475569;
    user-select: none;
}

.checkbox-label input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    border-radius: 4px;
    border: 1.5px solid #cbd5e1;
    accent-color: var(--primary, #017e3d);
}

/* Forgot Password Link */
.forgot-password-link {
    color: var(--primary, #017e3d);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.forgot-password-link:hover {
    color: var(--primary-dark, #00632f);
    text-decoration: underline;
}

/* Back Button */
.back-to-login {
    background: none;
    border: none;
    color: var(--primary, #017e3d);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    transition: color 0.2s ease;
}

.back-to-login:hover {
    color: var(--primary-dark, #00632f);
}

/* Button */
.auth-form .btn-primary {
    background: var(--primary, #017e3d);
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    color: white;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.auth-form .btn-primary:hover {
    background: var(--primary-dark, #00632f);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(1, 126, 61, 0.2);
}

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

.auth-form .btn-primary:disabled {
    opacity: 0.7;
    transform: none;
    cursor: not-allowed;
}

/* Divider */
.auth-divider {
    text-align: center;
    margin: 16px 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    background: #ffffff;
    padding: 0 12px;
    position: relative;
    color: #64748b;
    font-size: 13px;
}

/* Social Login */
.social-login {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    transition: all 0.2s ease;
}

.social-btn.google {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    color: #334155;
}

.social-btn.google:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
    transform: translateY(-1px);
}

.social-btn.facebook {
    background: #1877f2;
    color: white;
}

.social-btn.facebook:hover {
    background: #166fe5;
    transform: translateY(-1px);
}

/* Loading Overlay */
.auth-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.auth-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary, #017e3d);
    border-radius: 50%;
    animation: authSpin 0.6s linear infinite;
}

.auth-loading p {
    margin-top: 12px;
    color: #64748b;
    font-size: 13px;
}

/* Animations */
@keyframes authFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

@keyframes authSlideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 576px) {
    .auth-modal-container {
        margin: 8px;
    }

    .auth-form-container {
        padding: 16px 20px 20px;
    }

    .auth-tab {
        font-size: 13px;
        padding: 8px;
    }

    .auth-form-header h3 {
        font-size: 17px;
    }
}
