

.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s ease;
    padding: 20px;
    box-sizing: border-box;
}

.auth-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


.auth-modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    position: relative;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    will-change: height;
}

.auth-modal.active .auth-modal-content {
    transform: scale(1) translateY(0);
}

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.auth-modal-close:hover {
    background: var(--bg-light);
    color: var(--text-color);
}

.auth-tabs {
    display: flex;
    background: var(--bg-light);
    flex-shrink: 0;
}

.auth-tab {
    flex: 1;
    padding: 1.25rem;
    text-align: center;
    background: none;
    border: none;
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.auth-tab.active {
    color: var(--primary-color);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

.auth-forms {
    position: relative;
    flex: 1;
    min-height: 350px;
    overflow: hidden;
}

.auth-form {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transform: translateX(30px);
    overflow-y: auto;
    box-sizing: border-box;
    will-change: opacity, transform;
}

.auth-form.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
    transition: all 0.4s ease;
}

.form-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    transition: var(--transition);
    background: white;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(64, 19, 5, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
    font-size: var(--font-size-sm);
}

.auth-submit {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.auth-submit:hover {
    background: var(--hover-primary);
    transform: translateY(-2px);
}

.auth-form-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.auth-form-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: var(--transition);
}

.auth-form-link:hover {
    text-decoration: underline;
}

.auth-form.leaving {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-30px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.form-group.fade-in {
    opacity: 0;
    transform: translateY(10px);
}

.form-group.fade-in.active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease 0.2s;
}

.auth-form::-webkit-scrollbar {
    width: 6px;
}

.auth-form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.auth-form::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.auth-form::-webkit-scrollbar-thumb:hover {
    background: var(--hover-primary);
}

.auth-modal-content:not([style*="transition: none"]) {
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 480px) {
    .auth-modal {
        padding: 10px;
    }
    .auth-modal-content {
        width: 95%;
        max-height: 85vh;
    }
    .auth-form {
        padding: 1.5rem;
    }
    .auth-tab {
        padding: 1rem;
        font-size: var(--font-size-sm);
    }
}

@media (max-height: 700px) {
    .auth-modal-content {
        max-height: 95vh;
    }
    .auth-form {
        padding: 1.5rem;
    }
    .form-group {
        margin-bottom: 1rem;
    }
}
