/* Затемнение */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.2);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

/* Карточка */
.modal__content {
    width: min(360px, calc(100vw - 32px));
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    padding: 32px 24px;
    border-radius: 20px;
    background: #f3f4f6;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    position: relative;
    box-sizing: border-box;
    animation: fadeIn 0.25s ease;
}

/* Назад */
.modal__back {
    position: absolute;
    top: 20px;
    left: 20px;
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
}

/* Заголовок */
.modal__title {
    text-align: center;
    margin-bottom: 28px;
    font-size: 18px;
    font-weight: 600;
}

/* Форма */
.modal__form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Инпуты */
.modal__form input {
    border: none;
    border-bottom: 1px solid #cfd3d8;
    background: transparent;
    padding: 10px 4px;
    outline: none;
    font-size: 16px; /* >= 16px prevents iOS auto-zoom */
}

/* Кнопка регистрации */
.modal__submit {
    margin-top: 10px;
    height: 52px;
    border-radius: 14px;
    background: #9aa0a6;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.modal__submit:hover {
    background: #7f858c;
}

/* Анимация */
@keyframes fadeIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* показывается при открытии */
.modal.active {
    display: flex;
}

/* Переключатель между модалками входа и регистрации */
.modal__switch {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: #6b7280;
}

.modal__switch a {
    color: #6f02ff;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
}

.modal__switch a:hover {
    text-decoration: underline;
}
