/* Покрывающий слой */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 3;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
}

.overlay.active + .modal {
    right: 0; /* Возвращаем нормальное позиционирование */
}

/* Модальное окно (сайдбар) */
.modal {
    position: fixed;
    top: 0;
    right: 0;
    width: 30%;
    height: 100%;
    background-color: #fff;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 4;
    display: flex;
    flex-direction: column;
}

.modal.active {
    transform: translateX(0);
}

/* Контент модального окна */
.modal-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    font-size: 36px;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #419152;
}

/* Переключатель вкладок */
.tab-container {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    font-size: 14px;
}

.tab-button.active {
    border-bottom-color: #419152;
    color: #419152;
}

/* Формы */
.auth-form {
    display: none;
    flex: 1;
    flex-direction: column;
}

.auth-form.active {
    display: flex;
}

.auth-form h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.auth-form p {
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.auth-form input {
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.auth-form button {
    width: 100%;
    padding: 12px;
    background-color: #419152;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 10px;
    transition: background 0.3s;
}

.auth-form button:hover {
    background-color: #367c45;
}

.auth-form button:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.auth-form a {
    margin-top: 10px;
    text-align: center;
    color: #419152;
    text-decoration: none;
    font-size: 0.9rem;
}

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

.modal-error {
    margin: 10px 0;
    padding: 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    font-size: 14px;
}

/* Стиль для чекбокса согласия с политикой конфиденциальности */
.privacy-consent {
    font-size: 14px;
    margin: 10px 0;
    padding: 14px;
    border: 1px solid #ccc;
    border-radius: 12px;
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.privacy-consent span {
    line-height: 1.5;
    flex: 1;
}

.privacy-consent a {
    color: #419152;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.privacy-consent a:hover {
    opacity: 0.8;
}

/* Скрытие стандартного чекбокса */
.privacy-consent input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    margin-right: 15px;
    width: 28px;
    height: 28px;
    border: 2px solid #ccc;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
    top: 3px; /* выравнивание по верху текста */
}

/* Состояние "checked" */
.privacy-consent input:checked {
    background-color: #419152;
    border-color: #419152;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 25'%3e%3cpath fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M4 12.5L9.5 18.5L20 6.5'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px;
    box-shadow: 0 0 0 2px rgba(65, 145, 82, 0.2);
}

/* Анимация появления галочки (опционально) */
.privacy-consent input::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    box-shadow: 0 0 0 0 rgba(65, 145, 82, 0.4);
    transition: box-shadow 0.2s ease;
    pointer-events: none;
    opacity: 0;
}

.privacy-consent input:hover::after {
    opacity: 1;
}

/* Стиль для кнопки "Зарегистрироваться" */
#register-submit-btn {
    width: 100%;
    padding: 12px;
    background-color: #419152;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 10px;
    transition: background-color 0.3s, opacity 0.2s;
}

/* Неактивная кнопка */
#register-submit-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 1; /* чтобы не было прозрачности по умолчанию */
}

.register-tooltip {
    position: absolute;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s;
}