/* ========================================
   СТИЛИ ФОРМЫ ЗАПИСИ НА КОНСУЛЬТАЦИИ
   ======================================== */

/* Кнопка отправки */
.btn-submit {
    width: 100%;
    padding: 16px 24px;
    background-color: #6c9c02;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'TildaSans', Arial, sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-submit:hover:not(:disabled) {
    background-color: #5a8a00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 156, 2, 0.3);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(108, 156, 2, 0.3);
}

.btn-submit:disabled {
    background-color: #cccccc;
    color: #666666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-submit.ready {
    background-color: #6c9c02;
    color: #ffffff;
    cursor: pointer;
}

.btn-submit.ready:hover {
    background-color: #5a8a00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 156, 2, 0.3);
}

.btn-text {
    display: block;
    transition: opacity 0.3s ease;
}

.btn-submit:disabled .btn-text {
    opacity: 0.6;
}

.btn-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-submit.loading .btn-text {
    opacity: 0;
}

.btn-submit.loading .btn-loader {
    display: block;
}

/* Основная форма */
.booking-form {
    font-family: 'TildaSans', Arial, sans-serif;
    transition: opacity 0.3s ease;
}

/* Группы полей */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Метки полей */
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.form-fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.form-fieldset .form-label {
    margin-bottom: 12px;
}

/* Обязательные поля */
.required {
    color: #dc3545;
    font-weight: 600;
    margin-left: 2px;
}

/* Индикатор часового пояса */
.timezone-badge {
    display: inline-block;
    background: rgba(108, 156, 2, 0.1);
    color: #6c9c02;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: 8px;
    border: 1px solid rgba(108, 156, 2, 0.2);
}

/* Базовые стили для полей ввода */
.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: 'TildaSans', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    color: #333;
    background: white;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #6c9c02;
    box-shadow: 0 0 0 3px rgba(108, 156, 2, 0.1);
}

.form-input:hover:not(:focus),
.form-textarea:hover:not(:focus) {
    border-color: #c0c0c0;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #999;
    font-style: italic;
}

/* Стили для datetime-local input */
.form-input[type="datetime-local"] {
    position: relative;
    color-scheme: light;
}

/* Кастомизация иконки календаря */
.form-input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236c9c02'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    cursor: pointer;
    opacity: 1;
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.form-input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235a7d02'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z'/%3E%3C/svg%3E");
}

/* Firefox стили для иконки календаря */
.form-input[type="datetime-local"]::-moz-calendar-picker-indicator {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236c9c02'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    border: none;
    cursor: pointer;
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.form-input[type="datetime-local"]::-moz-calendar-picker-indicator:hover {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%235a7d02'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z'/%3E%3C/svg%3E");
}

/* Попытка кастомизации выпадающего календаря (ограниченная поддержка браузеров) */
.form-input[type="datetime-local"]::-webkit-calendar-picker-indicator:focus {
    outline: 2px solid #6c9c02;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Стили для полей даты и времени внутри input */
.form-input[type="datetime-local"]::-webkit-datetime-edit {
    font-family: 'TildaSans', Arial, sans-serif;
    font-size: 16px;
    color: #333;
}

.form-input[type="datetime-local"]::-webkit-datetime-edit-text {
    color: #999;
    font-weight: normal;
}

.form-input[type="datetime-local"]::-webkit-datetime-edit-month-field,
.form-input[type="datetime-local"]::-webkit-datetime-edit-day-field,
.form-input[type="datetime-local"]::-webkit-datetime-edit-year-field,
.form-input[type="datetime-local"]::-webkit-datetime-edit-hour-field,
.form-input[type="datetime-local"]::-webkit-datetime-edit-minute-field {
    color: #333;
    background: transparent;
    border: none;
    outline: none;
    padding: 0 2px;
}

/* Автоматическое изменение размера textarea */
.form-textarea.auto-resize {
    resize: none;
    overflow: hidden;
    min-height: 80px;
    max-height: 120px;
}

/* Вспомогательный текст */
.form-helper {
    margin-top: 6px;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

/* Московское время */
.moscow-time {
    font-weight: 600;
    color: #6c9c02;
    font-family: 'Courier New', monospace;
}

/* Радио кнопки для срочности */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
}

.radio-label:hover {
    border-color: #6c9c02;
    background: rgba(108, 156, 2, 0.02);
}

.radio-input {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #c0c0c0;
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.radio-input:checked+.radio-custom {
    border-color: #6c9c02;
    background: #6c9c02;
}

.radio-input:checked+.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.radio-input:checked+.radio-custom+.radio-text {
    color: #333;
    font-weight: 500;
}

.radio-text {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 15px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.urgency-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* Чекбокс для согласия */
/* Новый стильный блок согласия */
.privacy-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    margin: 16px 0;
}

.privacy-card:hover {
    border-color: #6c9c02;
    background: #f0f8e8;
    box-shadow: 0 4px 12px rgba(108, 156, 2, 0.1);
}

.privacy-checkbox-label {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    margin: 0;
    width: 100%;
}

.privacy-checkbox-input {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.privacy-checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-top: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.privacy-check-icon {
    width: 22px;
    height: 22px;
    color: #ffffff;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.privacy-checkbox-input:checked+.privacy-checkbox-custom {
    background: #6c9c02;
    border-color: #6c9c02;
    box-shadow: 0 4px 12px rgba(108, 156, 2, 0.3);
    transform: scale(1.05);
}

.privacy-checkbox-input:checked+.privacy-checkbox-custom .privacy-check-icon {
    opacity: 1;
    transform: scale(1);
}

.privacy-content {
    flex: 1;
}

.privacy-title {
    font-size: 14px;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0;
    line-height: 1.4;
}

.privacy-card:hover .privacy-title {
    color: #6c9c02;
}

.checkbox-input {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-top: 1px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.checkbox-custom:hover {
    border-color: #6c9c02;
    box-shadow: 0 2px 8px rgba(108, 156, 2, 0.2);
    transform: translateY(-1px);
}

.checkbox-input:checked+.checkbox-custom {
    border-color: #6c9c02;
    background: #6c9c02;
    box-shadow: 0 2px 8px rgba(108, 156, 2, 0.3);
    transform: scale(1.05);
}

.checkbox-input:checked+.checkbox-custom::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 7px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    animation: checkmark 0.3s ease-in-out;
}

@keyframes checkmark {
    0% {
        opacity: 0;
        transform: rotate(45deg) scale(0);
    }

    50% {
        opacity: 0.5;
        transform: rotate(45deg) scale(1.2);
    }

    100% {
        opacity: 1;
        transform: rotate(45deg) scale(1);
    }
}

.checkbox-text {
    font-size: 13px;
    color: #666;
    line-height: 1.3;
    flex: 1;
    /* Занимает оставшееся пространство */
}

/* Сообщения об ошибках */
.form-error {
    margin-top: 6px;
    font-size: 14px;
    color: #dc3545;
    font-weight: 500;
    display: none;
}

.form-error.visible {
    display: block;
}

/* Состояния полей с ошибками */
.form-group.error .form-input,
.form-group.error .form-textarea {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.02);
}

.form-group.error .radio-label {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.02);
}

/* Состояния валидных полей */
.form-group.valid .form-input,
.form-group.valid .form-textarea {
    border-color: #28a745;
}

.form-group.valid .radio-label {
    border-color: #28a745;
}

/* Кнопки формы */
.form-actions {
    margin-top: 32px;
    margin-bottom: 60px;
    /* Увеличенный отступ для видимости */
    display: flex;
    gap: 16px;
    flex-direction: column;
}

.btn-submit,
.btn-cancel {
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'TildaSans', Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1.5px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
}

.btn-submit {
    background: #6c9c02;
    color: white;
    order: 1;
}

.btn-submit:hover:not(:disabled) {
    background: #5a8201;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 156, 2, 0.3);
}

.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-submit:disabled {
    background: #c0c0c0;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-cancel {
    background: white;
    color: #666;
    border: 1.5px solid #e0e0e0;
    order: 2;
}

.btn-cancel:hover {
    background: #f5f5f5;
    border-color: #c0c0c0;
    color: #333;
}

/* Состояния кнопки отправки */
.btn-submit.loading .btn-text {
    opacity: 0;
}

.btn-submit.loading .btn-loader {
    display: block;
}

.btn-loader {
    display: none;
    position: absolute;
}

.btn-loader svg {
    width: 20px;
    height: 20px;
}

/* Стили для отключенных полей */
.form-input:disabled,
.form-textarea:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Автозаполнение браузера */
.form-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
    -webkit-text-fill-color: #333 !important;
}

/* Стили для мобильных устройств */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 10px;
    }

    .form-label {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .form-input,
    .form-textarea {
        padding: 6px 8px;
        font-size: 13px;
        min-height: 50px;
        max-height: 70px;
    }

    .form-textarea.auto-resize {
        min-height: 50px;
        max-height: 70px;
    }

    .radio-label {
        padding: 14px 12px;
    }

    .radio-text {
        font-size: 14px;
    }

    .urgency-icon {
        font-size: 16px;
    }

    .timezone-badge {
        font-size: 11px;
        padding: 3px 6px;
    }

    .form-actions {
        margin-top: 12px;
        gap: 8px;
    }

    .btn-submit,
    .btn-cancel {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 28px;
    }

    .checkbox-label {
        gap: 8px;
        min-height: 18px;
        line-height: 1.2;
    }

    .checkbox-custom {
        width: 16px;
        height: 16px;
        margin-top: 0;
    }

    .checkbox-text {
        font-size: 12px;
        line-height: 1.2;
    }

    .form-counter {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .form-group {
        margin-bottom: 10px;
    }

    .form-label {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .form-input,
    .form-textarea {
        padding: 6px 8px;
        font-size: 13px;
    }

    .form-textarea {
        min-height: 50px;
        max-height: 70px;
    }

    .form-actions {
        margin-top: 12px;
        gap: 8px;
    }

    .btn-submit,
    .btn-cancel {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 28px;
    }

    .checkbox-label {
        gap: 6px;
        min-height: 16px;
        line-height: 1.1;
    }

    .checkbox-custom {
        width: 14px;
        height: 14px;
    }

    .checkbox-text {
        font-size: 11px;
        line-height: 1.1;
    }
}

/* Горизонтальная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .form-actions {
        flex-direction: row;
    }

    .btn-submit {
        order: 2;
    }

    .btn-cancel {
        order: 1;
    }
}

/* Темная тема (если поддерживается системой) */
@media (prefers-color-scheme: dark) {
    .booking-form {
        /* Сохраняем светлую тему для формы */
    }
}

/* Высокая контрастность */
@media (prefers-contrast: high) {

    .form-input,
    .form-textarea,
    .radio-label,
    .checkbox-custom {
        border-width: 3px;
    }

    .btn-submit {
        background: #5a8201;
        border: 2px solid #4a6b01;
    }

    .btn-cancel {
        border-color: #999;
        color: #333;
    }
}

/* Уменьшенная анимация */
@media (prefers-reduced-motion: reduce) {

    .form-input,
    .form-textarea,
    .radio-label,
    .radio-custom,
    .checkbox-custom,
    .btn-submit,
    .btn-cancel {
        transition: none;
    }

    .btn-submit:hover:not(:disabled) {
        transform: none;
    }
}

/* Принт стили */
@media print {
    .booking-form {
        background: white;
        color: black;
    }

    .form-actions {
        display: none;
    }
}