/* Общие стили */
body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f9;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden; /* Убираем прокрутку */
}

/* Модальное окно */
.modal {
    display: none; /* Скрываем по умолчанию */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Затемнённый фон */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Содержимое модального окна */
.modal-content {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px; /* Максимальная ширина формы */
    box-sizing: border-box;
    position: relative; /* Для крестика */
    overflow: hidden;
}

/* Заголовок формы */
.modal-content h2 {
    margin-top: 0;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 20px;
}

/* Крестик для закрытия */
.close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #bbb;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

/* Стили формы */
.form-container {
    display: flex;
    flex-direction: column;
}

/* Поля ввода */
.form-container input[type="text"],
.form-container input[type="email"],
.form-container input[type="password"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    background-color: #f9f9f9;
    margin-bottom: 15px; /* Отступ между полями */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-container input[type="text"]:focus,
.form-container input[type="email"]:focus,
.form-container input[type="password"]:focus {
    border-color: #5cb85c;
    box-shadow: 0 0 8px rgba(92, 184, 92, 0.5);
    outline: none;
}

/* Кнопка формы */
.form-container button {
    width: 100%;
    padding: 12px;
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px; /* Отступ между кнопкой и последним полем ввода */
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.form-container button:hover {
    background-color: #4cae4c;
    transform: translateY(-2px);
}

.form-container button:active {
    transform: translateY(0);
}

/* Ссылки в форме */
.form-container p {
    text-align: center;
    margin: 0;
    margin-top: 15px; /* Отступ сверху для блока ссылок */
    font-size: 14px; /* Унифицированный размер шрифта */
}

.form-container p a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold; /* Жирный шрифт для акцента */
    margin: 0 5px; /* Расстояние между ссылками */
    transition: color 0.3s ease;
}

.form-container p a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Кнопка "Войти/Зарегистрироваться" */
.open-modal-button {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 10px 20px;
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.open-modal-button:hover {
    background-color: #4cae4c;
    transform: translateY(-2px);
}

.open-modal-button:active {
    transform: translateY(0);
}

/* Заголовок и ссылка на регистрацию */
.form-header {
    display: flex;
    justify-content: space-between; /* Заголовок влево, кнопка вправо */
    align-items: center;
    margin-bottom: 20px;
}

.form-title {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    text-align: left; /* Выравниваем заголовок влево */
}

.register-link {
    font-size: 14px;
    text-decoration: none;
    color: #007bff;
    font-weight: bold;
    cursor: pointer;
}

.register-link:hover {
    color: #0056b3;
}

/* Адаптивность */
@media screen and (max-width: 768px) {
    .modal-content {
        width: 90%;
        padding: 20px;
    }

    .form-container input[type="text"],
    .form-container input[type="email"],
    .form-container input[type="password"] {
        font-size: 14px;
        padding: 10px;
    }

    .form-container button {
        font-size: 14px;
    }

    .form-container p {
        font-size: 12px;
    }
}
