* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 14px 30px;  /* было 30px → уменьшил вертикальный padding */
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 15px;  /* было 30px */
    font-size: 1.8em;     /* было 2em */
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;  /* было 20px */
}

.calendar-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #667eea;
    padding: 10px 20px;
    transition: all 0.3s;
}

.calendar-header button:hover {
    background: #f0f0f0;
    border-radius: 5px;
}

#currentMonthYear {
    color: #333;
    font-size: 20px;      /* было 24px */
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    color: #666;
    margin-bottom: 5px;   /* было 10px */
    font-size: 13px;      /* добавить */
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;             /* было 5px */
    margin-bottom: 15px;  /* было 20px */
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;    /* было 10px */
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    font-weight: 500;
    padding: 3px;          /* было 5px */
    font-size: 14px;       /* добавить */
}

.calendar-day:hover:not(.disabled) {
    transform: scale(1.05);
    background: #e9ecef;
}

.calendar-day.disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.7;
}

.calendar-day.other-month {
    opacity: 0.4;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 0;         /* было 4px - убрать лишний отступ */
}

.dot.free {
    background: transparent;
}

.dot.yellow {
    background: #ffc107;
    box-shadow: 0 0 10px #ffc107;
}

.dot.red {
    background: #dc3545;
    box-shadow: 0 0 10px #dc3545;
}

.dot.disabled {
    background: #6c757d;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 15px;             /* было 20px */
    margin-top: 10px;      /* было 20px */
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;              /* было 5px */
    font-size: 14px;       /* было 12px */
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;         /* было 30px */
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    position: relative;
    max-height: 85vh;      /* было 80vh */
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #333;
}

/* Слоты времени */
.time-slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}
.time-slot {
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.time-slot strong {
    display: block;
    font-size: 18px;
    color: #333;
    margin-bottom: 0;        /* Убираем отступ снизу */
}

.time-slot small {
    color: #666;
    font-size: 18px;
    font-weight: 700;
}

.time-slot:hover:not(.booked) {
    background: #e9ecef;
    border-color: #667eea;
    transform: scale(1.02);
}

.time-slot.booked {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.7;
}

.time-slot.booked strong,
.time-slot.booked small {
    color: #adb5bd;
}

/* Форма регистрации */
#registrationForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.form-note {
    color: #666;
    font-size: 14px;      /* было 12px */
    margin-bottom: 8px;    /* было 10px */
    text-align: center;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group.half {
    width: 50%;
}

.form-group.third {
    width: 33.33%;
}

.field-hint {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 3px;
    font-style: italic;
}

.checkbox {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.btn-submit {
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: #28a745;
    color: white;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: none;
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.notification.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Адаптивность */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    .calendar-day {
        font-size: 12px;
    }
    
    .legend {
        flex-direction: column;
        align-items: center;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-group.half,
    .form-group.third {
        width: 100%;
    }
}
/* Modern Form Styles */
.modern-form {
    max-width: 600px;
    padding: 40px !important;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 0px;
    border-bottom: 2px solid #f0f0f0;
}

.form-header h3 {
    color: #666;
    font-size: 16px;
    font-weight: normal;
    margin-bottom: 5px;
}

.form-header h2 {
    color: #667eea;
    font-size: 24px;
    margin-bottom: 15px;
}

.form-badges {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.badge {
    background: #f8f9fa;
    padding: 8px 15px;
    border-radius: 50px;
    font-size: 14px;
    color: #666;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.badge i {
    color: #667eea;
}

/* Selected Info Card */
.selected-info {
    margin-bottom: 25px;
}

.info-card {
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    border: 2px dashed #667eea40;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: #667eea;
    font-weight: 600;
    font-size: 16px;
}

.info-card i {
    font-size: 24px;
}

/* Floating Labels */
.floating-label {
    position: relative;
    margin-bottom: 5px;
}

.floating-label input {
    width: 100%;
    height: 56px;
    padding: 20px 16px 6px 40px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
}

.floating-label input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.floating-label label {
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
    transition: all 0.3s;
    pointer-events: none;
    background: white;
    padding: 0 4px;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 12px;
    color: #667eea;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
    transition: all 0.3s;
}

.floating-label input:focus ~ .input-icon {
    color: #667eea;
}

.input-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    margin-left: 12px;
}

.input-hint.warning {
    color: #f39c12;
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    padding-left: 30px;
}

.radio-option input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-custom {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    transition: all 0.2s;
}

.radio-option input:checked ~ .radio-custom {
    border-color: #667eea;
    background: #667eea;
    box-shadow: inset 0 0 0 4px white;
}

.radio-option input:focus ~ .radio-custom {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.radio-label {
    margin-left: 8px;
    color: #333;
}

/* Section Label */
.section-label {
    display: block;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Form Rows */
.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row.triple {
    gap: 10px;
}

.form-group {
    flex: 1;
}

/* Privacy Section */
.privacy-section {
    margin: 25px 0 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 35px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: all 0.2s;
}

.checkbox-container input:checked ~ .checkmark {
    background: #667eea;
    border-color: #667eea;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container input:focus ~ .checkmark {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.checkbox-text {
    line-height: 1.4;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.submit-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.submit-btn:hover:before {
    left: 100%;
}

.submit-btn i {
    font-size: 18px;
    transition: transform 0.3s;
}

.submit-btn:hover i {
    transform: translateX(5px);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .modern-form {
        padding: 25px !important;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-badges {
        flex-direction: column;
        align-items: center;
    }
    
    .form-header h2 {
        font-size: 20px;
    }
    
    .radio-group {
        justify-content: center;
    }
}

/* Animation for modal */
.modal-content {
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Исправление для поля Должность */
.form-section .floating-label {
    position: relative;
}

.form-section .input-icon {
    position: absolute;
    left: 12px;
    top: 28px; /* Сдвигаем иконку ниже из-за подсказки */
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
    z-index: 1;
}

.form-section .input-hint {
    position: relative;
    z-index: 0;
    margin-top: 4px;
    margin-left: 12px;
    font-size: 12px;
    color: #999;
}

/* Для мобильных устройств */
@media (max-width: 600px) {
    .form-section .input-icon {
        top: 24px;
    }
}
/* Исправление для поля Должность и его подсказки */
.form-section {
    position: relative;
}

.form-section .floating-label {
    position: relative;
    margin-bottom: 20px; /* Увеличиваем отступ для подсказки */
}

.form-section .input-icon {
    position: absolute;
    left: 12px;
    top: 28px; /* Центрируем иконку */
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
    z-index: 1;
    pointer-events: none;
}

.form-section .input-hint {
    position: absolute;
    bottom: -18px; /* Размещаем подсказку под полем */
    left: 12px;
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    background: transparent;
    padding: 2px 0;
    z-index: 0;
}

/* Для мобильных устройств */
@media (max-width: 600px) {
    .form-section .input-icon {
        top: 24px;
    }
    
    .form-section .input-hint {
        position: static; /* На мобильных подсказка будет под полем */
        margin-top: 4px;
        margin-left: 0;
        white-space: normal;
    }
}
/* CAPTCHA стили */
.captcha-section {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

.captcha-label {
    display: block;
    margin-bottom: 10px;
    color: #666;
    font-weight: 500;
    font-size: 14px;
}

.captcha-box {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.captcha-question {
    flex: 0 0 auto;
    background: linear-gradient(135deg, #667eea20, #764ba220);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    min-width: 100px;
    text-align: center;
    border: 2px solid #667eea30;
}

.captcha-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    min-width: 150px;
}

.captcha-input:focus {
    border-color: #667eea;
    outline: none;
}

.captcha-refresh {
    flex: 0 0 auto;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    width: 46px;
    height: 46px;
    cursor: pointer;
    color: #667eea;
    font-size: 18px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.captcha-refresh:hover {
    border-color: #667eea;
    background: #667eea10;
    transform: rotate(180deg);
}

.captcha-hint {
    display: block;
    margin-top: 8px;
    color: #999;
    font-size: 12px;
    font-style: italic;
}

/* Адаптивность */
@media (max-width: 500px) {
    .captcha-box {
        flex-direction: column;
    }
    
    .captcha-question {
        width: 100%;
    }
    
    .captcha-input {
        width: 100%;
    }
    
    .captcha-refresh {
        width: 100%;
    }
}

/* Для всех полей формы */
input:user-invalid,
select:user-invalid,
textarea:user-invalid {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* Для полей, которые невалидны и находятся в фокусе */
input:focus:user-invalid,
select:focus:user-invalid,
textarea:focus:user-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

/* Стили для ссылки на политику */
.privacy-links {
    text-align: left;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e0e0e0;
}

.privacy-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #667eea;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s;
    padding: 5px 0;
}

.privacy-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

.privacy-link i {
    font-size: 14px;
}

/* Для мобильных устройств */
@media (max-width: 600px) {
    .privacy-link {
        font-size: 12px;
    }
}
/* Стили для подсветки полей с ошибками (добавляются через JS) */
.input-error {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
}

/* Сообщение об ошибке под полем */
.field-error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    margin-left: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
/* Зелёная точка для свободных дней */
.dot.green {
    background: #28a745;
    box-shadow: 0 0 10px #28a745;
}

/* Все слоты свободны (зелёный фон) */
.calendar-day.green {
    background: #e8f5e9;
}

.calendar-day.green:hover {
    background: #c8e6c9;
}
/* 1-2 группы свободны (жёлтый фон) */
.calendar-day.yellow {
    background: #fff6d7;    
}

.calendar-day.yellow:hover {
    background: #ffeaab; /*#ffe69b*/
    transform: scale(1.02);
}

/* Все группы заняты (красный фон) */
.calendar-day.red {
    background: #ffe6e8;    
}

.calendar-day.red:hover {
    background: #f3c2c6;
    transform: scale(1.02);
}

/* Даты, недоступные из-за правила "за 5 рабочих дней" */
.calendar-day.time-blocked {
    background: #e3f2fd;  /* голубовато-синий */
    /*color: #1976d2;*/
    cursor: not-allowed;
}

.calendar-day.time-blocked:hover {
    background: #bbdefb;
    transform: scale(1.02);
}

.calendar-day.time-blocked .dot {
    background: #1976d2;
    box-shadow: none;
}
.dot.blue {
    background: #1976d2;
    box-shadow: 0 0 10px #1976d2;
}

/* Кнопка "Вернуться на сайт" */
.back-to-site-btn {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;              /* было 10px */
    padding: 8px 20px;     /* было 12px 24px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 40px;    /* было 50px */
    font-weight: 600;
    font-size: 14px;        /* было 16px */
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-to-site-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.back-to-site-btn i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.back-to-site-btn:hover i {
    transform: translateX(-3px);
}

/* Адаптация для мобильных */
@media (max-width: 600px) {
    .back-to-site-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}
/* Добавить в конец файла - для очень маленьких экранов */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.4em;
        margin-bottom: 10px;
    }
    
    .calendar-day {
        font-size: 12px;
    }
    
    .legend {
        gap: 10px;
    }
    
    .back-to-site-btn {
        padding: 6px 16px;
        font-size: 12px;
    }
}
/* Кастомные всплывающие подсказки 
.calendar-day[title] {
    cursor: help;
}

.calendar-day[title]:hover {
    position: relative;
}

.calendar-day[title]:hover:after {
    content: attr(title);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}*/