/* appointment.css - стили для страницы онлайн-записи */

.appointment-page {
    padding: 30px 0 60px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #8B5A01;
    margin-bottom: 30px;
}

.appointment-page-grid {
    display: flex;
    gap: 40px;
}

/* Левая колонка (услуги) */
.appointment-sidebar {
    width: 350px;
    min-width: 200px;
}

/* Правая колонка (форма) */
.appointment-content {
    flex: 1;
}

.appointment-intro {
    margin-bottom: 40px;
}

.appointment-intro p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 20px;
}

/* Стили формы */
.appointment-form {
    background: #F9F2DE;
    padding: 30px;
    border-radius: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 1rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group label.required::after {
    content: '*';
    color: #d23c01;
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #E0D6B8;
    border-radius: 5px;
    font-size: 1rem;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: #8B5A01;
    outline: none;
    box-shadow: 0 0 0 3px rgba(139, 90, 1, 0.1);
}

.select-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238B5A01' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.file-input {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 10px 15px;
    background: white;
    border: 1px dashed #8B5A01;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #8B5A01;
    cursor: pointer;
    transition: all 0.3s;
}

.file-label:hover {
    background: #FEF9EC;
}

.file-name {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
    display: block;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.checkbox-group input {
    margin-top: 3px;
}

.checkbox-group label {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
}

.submit-btn {
    display: inline-block;
    padding: 12px 30px;
    background: #8B5A01;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.submit-btn:hover {
    background: #6d4500;
    transform: translateY(-2px);
}

/* Календарь */
.flatpickr-calendar {
    font-family: 'IBM Plex Serif', serif !important;
}

/* Валидация */
.error-message {
    font-size: 0.9rem;
    color: #d32f2f; /* Ярко-красный цвет */
    margin-top: 6px;
    padding: 8px 12px;
    background-color: #ffebee; /* Светло-красный фон */
    border-left: 4px solid #d32f2f;
    border-radius: 0 4px 4px 0;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

/* Анимация появления ошибки */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Стили для невалидных полей */
.is-invalid {
    border-color: #d32f2f !important;
    background-color: #fff5f5;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.1);
}

.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.2);
}

/*//////////////////////////////// */
.is-invalid + .error-message {
    display: block;
}
.is-invalid ~ #fileError {
    display: block;
}
/*//////////////////////////////// */

#fileError {
    margin-top: 8px;
    padding: 8px 0;
    border-left: none;
    background-color: transparent;
    color: #d32f2f;
    font-weight: 500;
}

/* Стиль для чекбокса с ошибкой */
.checkbox-group.is-invalid label {
    color: #d32f2f;
}

.checkbox-group.is-invalid input[type="checkbox"] {
    accent-color: #d32f2f;
    outline: 2px solid #d32f2f;
}

/* Иконка ошибки (опционально) */
.error-message::before {
    content: "⚠ ";
    font-size: 1.1em;
}

/* Для календаря с ошибкой */
.flatpickr-input.is-invalid {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23d32f2f' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-position: right 15px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 35px;
}

.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm,
.flatpickr-time input.disabled,
.flatpickr-time input.disabled:hover {
    color: #ccc !important;
}

.flatpickr-day.disabled,
.flatpickr-day.disabled:hover {
    color: #ccc !important;
}

/* Стили для страницы успеха */
.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.success-modal.active {
    opacity: 1;
    visibility: visible;
}

.success-content {
    text-align: center;
    padding: 40px;
    max-width: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.success-modal.active .success-content {
    transform: translateY(0);
}

.success-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto 25px;
    background-color: #E8F5E9;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.success-icon svg {
    width: 60px;
    height: 60px;
}

.success-content h2 {
    color: #2E7D32;
    margin-bottom: 15px;
    font-size: 2rem;
}

.success-content p {
    color: #333;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.success-btn {
    display: inline-block;
    padding: 14px 32px;
    background: #4CAF50;
    color: white !important;
    border-radius: 5px;
    text-decoration: none !important;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.success-btn:hover {
    background: #3d8b40;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
    color: white !important; /* Явно указываем белый цвет при hover */
    text-decoration: none !important;
}

/* Эффект при нажатии */
.success-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 3px rgba(0,0,0,0.2);
}

.success-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: opacity 0.3s;
}

.success-btn:hover::after {
    opacity: 1;
}

/* Анимация галочки */
.success-icon svg {
    animation: checkmark 0.5s ease-in-out;
    animation-fill-mode: forwards;
    stroke-width: 2;
    stroke: #4CAF50;
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

@keyframes checkmark {
    to {
        stroke-dashoffset: 0;
    }
}

/* Адаптивность */
@media (max-width: 992px) {
    .appointment-page-grid {
        flex-direction: column;
    }

    .appointment-sidebar {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }

    .appointment-form {
        padding: 20px;
    }
}