@charset "utf-8";

:root {
    --dark_purple: hsl(245, 23%, 21%);
    --medium_purple: hsl(244, 11%, 50%);
    --light_purple: hsl(240, 22%, 90%);
    --red: hsl(0, 57%, 58%);
    --beige: hsl(0, 10%, 90%);
    --button: rgba(133, 133, 168, 95%);
}

div#form {
    scroll-margin-top: 2rem;
}

#appointment_form {
  background: url(/media/original_images/form_bgr.png), no-repeat;
  background-size: cover;
  padding: 5rem 1rem;
  text-align: center;
}

.form_container h2 {
    text-transform: none;
    color: #fff;
    font-weight: 300;
    margin-bottom: 30px;
    font-size: 2.5rem;
}

@media (max-width: 600px) {

    #appointment_form {
        padding: 3rem 1rem;
    }

    .form_container h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
}

.form_grid {
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    flex-direction: column;
    gap: 1rem;
    margin: auto auto 1em auto;
    justify-content: center;
    max-width: 450px;
}

input#phone,
input#name,
select#service,
select#doctor,
select#date,
select#time {
     background-color: #fff;
     opacity: 1;
     border-radius: 5px;
     padding: 1rem;
     width: 100%;
     height: 65px;
}

select#doctor:disabled {
    color: var(--dark_purple);
    cursor: not-allowed;
}

#day_block {
    background-color: #fff;
    border-radius: 5px;
    padding: 5px 5px 10px 5px;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 10px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 10px;
}

.calendar-day {
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
}

.calendar-day.disabled {
    color: #aaa;
    pointer-events: none;
}

.calendar-day.active {
    color: var(--dark_purple);
    font-weight: 400;
}

.calendar-day.empty_day {
    background-color: transparent;
    border: none;
    pointer-events: none;
}

.calendar-day.selected {
    background-color: var(--dark_purple);
    color: #fff;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    margin: 10px 5px 20px 15px;
    align-items: center;
}

.calendar-navigation div {
    display: flex;
    gap: 10px;
}

.calendar-navigation button {
    cursor: pointer;
    padding: 0;
}

button#nextMonth::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    background: url('/media/icons/chevron_right.svg') no-repeat center/100%;
}

button#prevMonth::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    background: url('/media/icons/chevron_left.svg') no-repeat center/100%;
}

button#prevMonth:disabled::after {
    background: url('/media/icons/chevron_left_disabled.svg') no-repeat center/100%;
    cursor: not-allowed;
}

#currentMonth {
    font-size: 1rem;
    color: var(--dark_purple);
    font-weight: 400;
}

#no_dates_message {
    padding: 10px;
    font-size: 14px;
    line-height: 1.2;
    color: hsl(0, 0%, 37%);
}

.selected-time-label {
    margin: 10px 0;
    font-size: 14px;
    color: var(--dark_purple);
    transition: color 0.5s ease;
}

#no_dates_message span {
    font-weight: 400;
    color: var(--dark_purple);
}

.doctor_no_appointment {
    font-size: 1rem;
    line-height: 1.3;
    padding: 15px 11px 8px 11px;
    text-align: left;
    margin: 0;
}

.selected-time-label span {
    font-weight: 400;
}

/* Анимация для обновления подписи */
@keyframes blink {
    0% { color: var(--dark_purple); }
    50% { color: hsl(0, 0%, 87%); }
    100% { color: var(--dark_purple); }
}

.selected-time-label.blink {
    animation: blink 0.8s ease;
}

.time-table {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 5px;
    padding: 5px 10px;
    margin-top: 1rem;
}

.time-table div {
    padding: 6px;
    border: 1px solid hsl(0, 0%, 92%);
    border-radius: 5px;
    color: hsl(0, 0%, 40%);
    flex: 0 1 calc(25% - 4px);
    cursor: pointer;
    font-size: 0.9rem;
}

.time-table .selected {
    background-color: var(--dark_purple);
    border-color: var(--dark_purple);
    color: #fff;
}

#agree_block {
    text-align: left;
}

.form input[type="checkbox"] {
    display: none;
}

input#agree[type="checkbox"] ~ label::before {
    content: '';
    width: 24px;
    height: 24px;
    border: 1px solid #fff;
    border-radius: 0.3rem;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

input#agree[type="checkbox"]:checked ~ label::before {
    background: url('/media/icons/choose.svg') no-repeat center/60% var(--dark_purple);
    transition: background-color 0.2s ease;
}

.form input#agree[type="checkbox"] ~ label {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form input#agree[type="checkbox"] ~ label p {
    font-size: 0.9rem;
    color: #fafafa;
    line-height: 1.5;
    margin-bottom: 0;
}

.form p a {
    border-bottom: 1px solid #fafafa;
    color: #fafafa;
}

.form p a:hover {
    border-bottom: 1px solid var(--medium_purple);
    color: var(--medium_purple);
}

.form #btnSubmit:disabled {
    background-color: hsl(0, 0%, 87%);
    color: hsl(0, 0%, 57%);
    cursor: not-allowed;
    border: 2px solid hsl(0, 0%, 87%);
}

.hide {
    display: none;
}

/*.form select {
    overflow: hidden;
    background: url('/media/original_images/arrow_down.svg') no-repeat right;
    background-position: right 5% bottom 50%;
    cursor: pointer;
    width: 100%;
}*/

.template-doctorpage .form select {
    background: none;
}

.form input::placeholder {
    opacity: 1;
    transition: opacity 0.3s ease;
    color: hsl(0, 0%, 55%);
}

.form input:focus::placeholder {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* --------------------------------------- */
/* --- FORM ERRORS --- */
/* --------------------------------------- */

#name + p,
#phone + p,
#agree + label + span {
    display: none;
}

#name.invalid + p,
#phone.invalid + p,
#agree.invalid + label + span {
    display: block;
    color: var(--red);
    font-size: 13px;
    margin-top: 0.5rem;
    margin-bottom: 0;
    line-height: 1.2;
    text-align: left;
}

#agree.invalid + label + span {
    margin-left: 34px;
}

#name.invalid,
#phone.invalid {
    border: 2px solid var(--red);
}

input#agree[type="checkbox"].invalid ~ label::before {
    border: 1px solid var(--red);
}

/* --------------------------------------- */
/* --- FORM THANKS --- */
/* --------------------------------------- */

.thanks {
    padding: 3em 1em;
    color: #fff;
    max-width: 500px;
    margin: auto;
}

.thanks h3 {
    margin-bottom: 1em;
    font-size: 2em;
    line-height: 1.3;
}

.thanks p {
    font-size: 1.2em;
    line-height: 1.4;
}

.order_text {
    background-color: var(--light_purple);
    color: var(--dark_purple);
    border-radius: 5px;
    text-align: left;
    padding: 1rem;
    margin-top: 1rem;
}

.order_text p {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.order_text p:last-child {
    margin-bottom: 0.5rem;
}

.order_text p span {
    display: block;
    flex-basis: 100%;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--medium_purple);
}