:root {
    --dark-gray: #2c3e50;
    --light-gray: #ecf0f1;
    --transition: all 0.3s ease;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Основные стили модального окна */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #ffffff;
    width: 90%;
    max-width: 500px;
	height: 95vh; height: 95dvh;
    margin: 20px;
    border-radius: 3px;
    box-shadow: var(--shadow-hover);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    
    overflow-y: auto;
	overflow-x: hidden; /* Блокирует горизонтальную прокрутку */
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

/* Стили формы */
.confirmation-form {
	background-color: #ffffff;
    padding: 40px;
}

/* Кнопка закрыть */
.close-btn {
	overflow: hidden;
	position: absolute;
	right: 0px;
	top: 0px;
	height: calc(50px + 1.5vh);
	border: none;
	background: none;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.3s ease-in-out;
}
.close-btn:hover {
	opacity: 0.5;
	transform: scale(1.1) rotate(90deg);
}

.form-title {
    color: var(--dark-gray);
    text-align: center;
    margin: 0 0 30px 0;
    font-weight: 400;
    font-size: 1.8rem;
    line-height: 1.3;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    color: var(--dark-gray);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 1rem;
}

/* Поля ввода */
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 1rem;
    color: var(--dark-gray);
    transition: var(--transition);
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--dark-gray);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.1);
}

textarea.form-control {
	resize: none; /* Запрещаем ручное изменение размера */
	overflow-y: auto;
    font-family: inherit;
}

/* Группы радиокнопок */
.option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 5px;
}

.form-check {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin: 0 8px 0 0;
    cursor: pointer;
    accent-color: var(--dark-gray);
}

.form-check-label {
    color: var(--dark-gray);
    cursor: pointer;
    font-size: 1rem;
    user-select: none;
}

.form-note {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 8px;
    font-style: italic;
}

/* Кнопка отправки */
.btn-form {
	/* Адаптивный padding */
	padding: clamp(12px, 1.5vh, 20px) clamp(24px, 4vw, 48px);
	/* Адаптивная ширина - на мобильных занимает всю ширину, на десктопе - по содержимому */
    width: 100%;
    
    background: black;
    color: white;
    border: none;
    border-radius: 3px;
    
    /* Адаптивный размер текста */
    font-size: clamp(0.875rem, 5vw, 1.125rem);
    font-weight: 500;
    
    cursor: pointer;
    transition: var(--transition);
    
    /* Центрирование текста и управление высотой */
    text-align: center;
    line-height: 1.4;
    display: inline-block;
    
    /* Убираем фиксированную высоту */
    min-height: unset;
    height: auto;
}

.btn-form:hover {
    background: white;
	color: black;
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.btn-form:active {
    transform: translateY(0);
	color: black;
}

#divOpenBtn{
	margin-top:10vh; margin-top:10dvh;
}

#btnSend{
	display: block;
}

/* Адаптивность */
@media (max-width: 768px) {
	
	#divOpenBtn{
	margin-top:40vh; margin-top:40dvh;
	width: auto;
	}
	
    .confirmation-form {
        padding: 10px 25px 10px 25px;
    }
    
    .form-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
	
    .form-title {
        font-size: 1.3rem;
    }
    
    .option-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .form-control {
        padding: 10px 14px;
    }
    
}

/* Анимация появления */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    animation: fadeIn 0.4s ease forwards;
    animation-delay: calc(var(--animation-order, 0) * 0.1s);
    opacity: 0;
}

/* Плавное появление полей формы */
#attendanceForm > * {
    --animation-order: 0;
}

#attendanceForm > *:nth-child(1) { --animation-order: 1; }
#attendanceForm > *:nth-child(2) { --animation-order: 2; }
#attendanceForm > *:nth-child(3) { --animation-order: 3; }
#attendanceForm > *:nth-child(4) { --animation-order: 4; }
#attendanceForm > *:nth-child(5) { --animation-order: 5; }
#attendanceForm > *:nth-child(6) { --animation-order: 6; }

/* Состояния полей */
.form-control:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.05);
}

/* Стили для скроллбара в модальном окне */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}