/* User Auth Modal Component - Fully Scoped with BEM Naming */

.user-auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.user-auth-modal--open {
    display: flex;
}

.user-auth-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.user-auth-modal__container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    z-index: 10000;
    max-height: 90vh;
    overflow-y: auto;
}

.user-auth-modal__close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    color: #666;
    transition: all 0.3s ease;
}

.user-auth-modal__close:hover {
    background: #e0e0e0;
    color: #333;
}

.user-auth-modal__header {
    text-align: center;
    margin-bottom: 30px;
}

.user-auth-modal__title {
    font-size: 1.75em;
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.user-auth-modal__subtitle {
    color: #7f8c8d;
    margin: 0;
    font-size: 0.95em;
    line-height: 1.4;
}

.user-auth-modal__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.user-auth-modal__tab-btn {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    color: #7f8c8d;
}

.user-auth-modal__tab-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.user-auth-modal__tab-btn--active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.user-auth-modal__form {
    display: none;
    flex-direction: column;
    gap: 16px;
}

.user-auth-modal__form--active {
    display: flex;
}

.user-auth-modal__form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.user-auth-modal__label {
    font-size: 0.9em;
    font-weight: 600;
    color: #2c3e50;
    display: block;
}

.user-auth-modal__input {
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    color: #2c3e50;
}

.user-auth-modal__input::placeholder {
    color: #bdc3c7;
}

.user-auth-modal__input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fafbff;
}

.user-auth-modal__input:invalid {
    border-color: #e74c3c;
}

.user-auth-modal__input:invalid:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.user-auth-modal__btn {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.user-auth-modal__btn--primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.user-auth-modal__btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.user-auth-modal__btn--primary:active {
    transform: translateY(0);
}

.user-auth-modal__btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.user-auth-modal__btn--google {
    background: white;
    color: #333;
    width: 100%;
    border: 2px solid #e0e0e0;
}

.user-auth-modal__btn--google:hover {
    background: #f8f9fa;
    border-color: #667eea;
    color: #667eea;
}

.user-auth-modal__divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

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

.user-auth-modal__divider-text {
    position: relative;
    background: white;
    padding: 0 12px;
    color: #bdc3c7;
    font-size: 0.9em;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .user-auth-modal__container {
        max-width: 90%;
        padding: 30px 24px;
        border-radius: 12px;
    }

    .user-auth-modal__title {
        font-size: 1.5em;
    }

    .user-auth-modal__subtitle {
        font-size: 0.9em;
    }

    .user-auth-modal__input,
    .user-auth-modal__btn {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .user-auth-modal__container {
        max-width: 95%;
        padding: 24px 18px;
    }

    .user-auth-modal__close {
        width: 32px;
        height: 32px;
        font-size: 1em;
    }

    .user-auth-modal__title {
        font-size: 1.3em;
    }

    .user-auth-modal__form-group {
        gap: 4px;
    }

    .user-auth-modal__input,
    .user-auth-modal__btn {
        padding: 11px 12px;
        font-size: 16px;
    }
}

/* Ensure no conflicts with existing styles */
.user-auth-modal * {
    box-sizing: border-box;
}

.user-auth-modal input:-webkit-autofill,
.user-auth-modal input:-webkit-autofill:hover,
.user-auth-modal input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
    box-shadow: 0 0 0 1000px white inset !important;
}

.user-auth-modal input:-webkit-autofill {
    -webkit-text-fill-color: #2c3e50 !important;
}
