﻿/* ===== Переменные ===== */
:root {
    --bg-wood: #3a2a1a;
    --bg-wood-light: #4a3624;
    --paper: #fdfaf3;
    --paper-line: #c8d8e8;
    --ink: #1a2a3a;
    --ink-light: #4a5a6a;
    --accent: #c0392b;
    --accent-hover: #a93226;
    --pending: #c08a2b;
    --shadow-soft: 0 2px 8px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.12);
    --shadow-paper: 0 1px 3px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.15);
    --font-main: 'Inter', system-ui, sans-serif;
    --font-accent: 'Caveat', cursive;
    --radius: 12px;
}

/* ===== База ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-main);
    color: var(--ink);
    background: var(--bg-wood);
    background-image:
        repeating-linear-gradient(90deg, transparent, transparent 40px, rgba(0,0,0,0.05) 40px, rgba(0,0,0,0.05) 42px),
        repeating-linear-gradient(0deg, transparent, transparent 40px, rgba(0,0,0,0.03) 40px, rgba(0,0,0,0.03) 42px),
        linear-gradient(135deg, var(--bg-wood), var(--bg-wood-light));
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Hero ===== */
.hero { padding: 60px 0 40px; text-align: center; }
.hero__title { font-family: var(--font-accent); font-size: 3.5rem; color: var(--paper); margin-bottom: 8px; }
.hero__subtitle { color: rgba(253, 250, 243, 0.7); font-size: 1.1rem; margin-bottom: 40px; }

/* ===== Блок-призыв (над календарем) ===== */
.calendar-invite { text-align: center; margin-bottom: 24px; color: var(--paper); }
.calendar-invite__title { font-family: var(--font-accent); font-size: 1.8rem; color: var(--paper); margin-bottom: 8px; }
.calendar-invite__text { font-size: 1rem; color: rgba(253, 250, 243, 0.8); max-width: 600px; margin: 0 auto; line-height: 1.5; }

/* ===== Календарь ===== */
.calendar {
    background: var(--paper);
    border-radius: var(--radius);
    box-shadow: var(--shadow-paper);
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 23px, rgba(200, 216, 232, 0.5) 23px, rgba(200, 216, 232, 0.5) 24px),
        repeating-linear-gradient(90deg, transparent, transparent 23px, rgba(200, 216, 232, 0.35) 23px, rgba(200, 216, 232, 0.35) 24px);
    background-size: 24px 24px;
}

.calendar__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; position: relative; z-index: 2; }
.calendar__arrow { background: var(--paper); border: 2px solid var(--ink); border-radius: 50%; width: 40px; height: 40px; cursor: pointer; font-size: 1.2rem; color: var(--ink); transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.calendar__arrow:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.calendar__arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.calendar__week-label { font-family: var(--font-accent); font-size: 1.8rem; color: var(--ink); }

.calendar__grid { display: grid; grid-template-columns: 70px repeat(5, 1fr); gap: 6px; position: relative; z-index: 1; }
.calendar__day-header { font-weight: 600; color: var(--ink); text-align: center; padding: 8px 4px; font-size: 0.95rem; border-bottom: 2px solid rgba(0, 0, 0, 0.1); }
.calendar__time-label { font-size: 0.85rem; color: var(--ink-light); display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; }

/* ===== Слоты ===== */
.slot {
    height: 56px;
    border-radius: 8px;
    background: rgba(253, 250, 243, 0.6);
    border: 1px dashed rgba(26, 42, 58, 0.2);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.slot:hover:not(.slot--busy):not(.slot--past) { background: rgba(192, 57, 43, 0.08); border-color: var(--accent); }
.slot--busy { cursor: not-allowed; background: rgba(0, 0, 0, 0.04); border-style: solid; border-color: rgba(0, 0, 0, 0.08); }
.slot--pending { background: rgba(192, 138, 43, 0.06); border-color: rgba(192, 138, 43, 0.2); }
.slot--confirmed { background: rgba(107, 142, 107, 0.06); }
.slot--selected { background: rgba(192, 138, 43, 0.18); border: 2px solid #c08a2b; box-shadow: 0 0 0 3px rgba(192, 138, 43, 0.15); }

/* Начинка слота (время и плюсик) */
.slot__content { font-size: 0.85rem; color: var(--ink-light); opacity: 0; transition: opacity 0.2s; }
.slot__plus { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 1.5rem; font-weight: 300; color: rgba(26, 42, 58, 0.2); transition: opacity 0.2s; pointer-events: none; }

/* Логика наведения и выбора */
@media (hover: hover) {
    .slot:not(.slot--busy):not(.slot--past):hover .slot__content { opacity: 1; }
    .slot:not(.slot--busy):not(.slot--past):hover .slot__plus { opacity: 0; }
}
@media (hover: none) {
    .slot__content { opacity: 0; }
    .slot__plus { opacity: 1; }
}
.slot--selected .slot__plus { opacity: 0 !important; }
.slot--selected .slot__content { opacity: 1 !important; }
.slot--busy .slot__plus { display: none; }

/* Анимация свечения (плавная, 4 секунды) */
@keyframes slot-glow {
    0% { box-shadow: 0 0 0 0 rgba(192, 138, 43, 0.4); border-color: rgba(192, 138, 43, 0.8); background: rgba(192, 138, 43, 0.05); }
    15% { box-shadow: 0 0 0 8px rgba(192, 138, 43, 0.2); border-color: rgba(192, 138, 43, 1); background: rgba(192, 138, 43, 0.15); }
    30% { box-shadow: 0 0 0 0 rgba(192, 138, 43, 0); border-color: rgba(192, 138, 43, 0.6); background: rgba(192, 138, 43, 0.05); }
    45% { box-shadow: 0 0 0 8px rgba(192, 138, 43, 0.2); border-color: rgba(192, 138, 43, 1); background: rgba(192, 138, 43, 0.15); }
    60% { box-shadow: 0 0 0 0 rgba(192, 138, 43, 0); border-color: rgba(192, 138, 43, 0.6); background: rgba(192, 138, 43, 0.05); }
    75% { box-shadow: 0 0 0 6px rgba(192, 138, 43, 0.1); border-color: rgba(192, 138, 43, 0.8); background: rgba(192, 138, 43, 0.1); }
    100% { box-shadow: 0 0 0 0 rgba(192, 138, 43, 0); border-color: rgba(192, 138, 43, 0.2); background: transparent; }
}
.slot.highlight { animation: slot-glow 4s ease-in-out forwards; z-index: 5; }

/* ===== Человечек ===== */
.person { display: inline-block; width: 20px; height: 22px; position: relative; }
.person::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 10px; height: 10px; border-radius: 50%; background: #6b8e6b; }
.person::after { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 18px; height: 9px; border-radius: 9px 9px 0 0; background: #6b8e6b; }
.slot--pending .person::before, .slot--pending .person::after { background: #c08a2b; }
.slot--confirmed .person::before, .slot--confirmed .person::after { background: #6b8e6b; }

/* ===== Легенда ===== */
.calendar__legend { display: flex; gap: 20px; justify-content: center; margin-top: 16px; font-size: 0.85rem; color: var(--ink-light); flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-box { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; vertical-align: middle; }
.legend-box--free { background: rgba(253, 250, 243, 0.8); border: 1px dashed rgba(26, 42, 58, 0.3); }
.legend-box--selected { background: rgba(192, 138, 43, 0.18); border: 2px solid #c08a2b; }
.legend-box--pending { background: rgba(192, 138, 43, 0.06); border: 1px solid rgba(192, 138, 43, 0.2); }
.legend-box--pending .person::before, .legend-box--pending .person::after { background: var(--pending); }
.legend-box--busy { background: rgba(107, 142, 107, 0.06); border: 1px solid rgba(107, 142, 107, 0.2); }

/* ===== Блок-призрак ===== */
.ghost-slot { position: absolute; border-radius: 8px; background: rgba(107, 142, 107, 0.25); border: 2px solid #6b8e6b; pointer-events: none; z-index: 10; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 600; color: #4a6b4a; transition: opacity 0.15s; }
.ghost-slot.hidden { opacity: 0; }

/* ===== Блок бронирования ===== */
.booking-block { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-paper); padding: 24px; margin-top: 24px; text-align: center; }
.booking-block.hidden { display: none; }
.booking-block__title { font-family: var(--font-accent); font-size: 1.8rem; color: var(--accent); margin-bottom: 8px; }
.booking-block__slot { font-size: 1.1rem; color: var(--ink); margin-bottom: 8px; }
.booking-block__note { color: var(--ink-light); font-size: 0.9rem; font-style: italic; margin-bottom: 16px; }
.booking-block__row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.booking-block__status { margin-top: 12px; font-size: 0.95rem; min-height: 1.2em; }
.booking-block__status--error { color: var(--accent); font-weight: 600; }
.booking-block__status--success { color: #4a7a4a; font-weight: 600; }
.booking-block__status--loading { color: var(--ink-light); font-style: italic; }
.booking-block__agreement { margin-top: 16px; font-size: 0.85rem; color: var(--ink-light); }
.booking-block__agreement a { color: var(--accent); text-decoration: underline; }

/* ===== Кнопки ===== */
.btn { display: inline-block; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 600; transition: all 0.2s; border: none; cursor: pointer; font-family: var(--font-main); font-size: 1rem; }
.btn--telemost { background: var(--accent); color: white; }
.btn--telemost:hover:not(:disabled) { background: var(--accent-hover); transform: translateY(-2px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--cancel { background: transparent; color: var(--ink-light); border: 2px solid rgba(0, 0, 0, 0.15); margin-top: 12px; }
.btn--cancel:hover:not(:disabled) { background: rgba(0, 0, 0, 0.05); border-color: var(--ink-light); }

/* ===== Секции и карточки ===== */
.about, .promo, .teacher, .program, .teacher-note, .reviews { padding: 60px 0; }
.section-title { font-family: var(--font-accent); font-size: 2.5rem; color: var(--paper); margin-bottom: 24px; text-align: center; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.card { background: var(--paper); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-paper); text-align: center; }
.card h3 { font-family: var(--font-accent); font-size: 1.5rem; margin-bottom: 8px; text-align: center; }
.promo__text, .teacher p { color: var(--paper); text-align: center; font-size: 1.2rem; max-width: 600px; margin: 0 auto; }

/* ===== Программа обучения (Аккордеон) ===== */
.program__note { color: rgba(253, 250, 243, 0.8); text-align: center; max-width: 700px; margin: 0 auto 32px; font-size: 1rem; }
.accordion { max-width: 800px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.accordion__item { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-paper); overflow: hidden; transition: box-shadow 0.2s; }
.accordion__item:hover { box-shadow: var(--shadow-soft); }
.accordion__header { width: 100%; background: none; border: none; padding: 18px 24px; display: flex; align-items: center; gap: 16px; cursor: pointer; font-family: var(--font-main); font-size: 1.1rem; color: var(--ink); text-align: left; transition: background 0.2s; }
.accordion__header:hover { background: rgba(0, 0, 0, 0.03); }
.accordion__number { font-family: var(--font-accent); font-size: 1.8rem; color: var(--accent); min-width: 32px; text-align: center; }
.accordion__title { flex: 1; font-weight: 600; }
.accordion__icon { font-size: 1.5rem; color: var(--ink-light); transition: transform 0.3s; min-width: 24px; text-align: center; }
.accordion__item.open .accordion__icon { transform: rotate(45deg); }
.accordion__body { max-height: 0; overflow: hidden; transition: max-height 0.35s ease, padding 0.35s ease; padding: 0 24px; }
.accordion__item.open .accordion__body { max-height: 500px; padding: 0 24px 20px; }
.accordion__body ul { list-style: none; padding: 0; margin: 0; }
.accordion__body li { padding: 6px 0 6px 24px; position: relative; color: var(--ink-light); font-size: 1rem; border-bottom: 1px dashed rgba(0, 0, 0, 0.08); }
.accordion__body li:last-child { border-bottom: none; }
.accordion__body li::before { content: "—"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ===== От преподавателя ===== */
.note-paper { max-width: 760px; margin: 0 auto; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-paper); padding: 40px 48px; position: relative; background-image: repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(200, 216, 232, 0.4) 31px, rgba(200, 216, 232, 0.4) 32px), repeating-linear-gradient(90deg, transparent, transparent 31px, rgba(200, 216, 232, 0.25) 31px, rgba(200, 216, 232, 0.25) 32px); background-size: 32px 32px; border-left: 3px solid rgba(192, 57, 43, 0.35); }
.note-paper__lead { font-family: var(--font-accent); font-size: 1.8rem; color: var(--accent); margin-bottom: 20px; }
.note-paper p { color: var(--ink); font-size: 1.05rem; line-height: 1.75; margin-bottom: 16px; }
.note-paper__sign { font-family: var(--font-accent); font-size: 1.4rem; color: var(--accent); margin-top: 24px; margin-bottom: 24px; }
.note-paper__signature { display: flex; align-items: baseline; gap: 12px; padding-top: 16px; border-top: 1px dashed rgba(0, 0, 0, 0.15); }
.note-paper__name { font-family: var(--font-accent); font-size: 2rem; color: var(--ink); }
.note-paper__role { color: var(--ink-light); font-size: 0.95rem; font-style: italic; }

/* ===== Отзывы ===== */
.reviews__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; max-width: 900px; margin: 0 auto; }
.review-card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-paper); padding: 28px 24px; position: relative; border-top: 4px solid var(--accent); background-image: repeating-linear-gradient(0deg, transparent, transparent 31px, rgba(200, 216, 232, 0.3) 31px, rgba(200, 216, 232, 0.3) 32px); background-size: 32px 32px; display: flex; flex-direction: column; }
.review-card__quote { font-family: var(--font-accent); font-size: 4rem; color: var(--accent); line-height: 0.5; margin-bottom: 12px; opacity: 0.5; }
.review-card__text { font-size: 1rem; line-height: 1.7; color: var(--ink); margin-bottom: 24px; font-style: italic; flex-grow: 1; }
.review-card__footer { display: flex; justify-content: space-between; align-items: flex-end; border-top: 1px dashed rgba(0, 0, 0, 0.15); padding-top: 16px; }
.review-card__author { display: flex; flex-direction: column; }
.review-card__name { font-family: var(--font-accent); font-size: 1.4rem; color: var(--ink); }
.review-card__role { font-size: 0.85rem; color: var(--ink-light); }
.review-card__link { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--accent); text-decoration: none; font-weight: 600; padding: 6px 12px; background: rgba(192, 57, 43, 0.08); border-radius: 6px; transition: all 0.2s; }
.review-card__link:hover { background: var(--accent); color: white; }
.review-card__link svg { width: 14px; height: 14px; }

/* ===== Плавающая стрелочка ===== */
.floating-arrow { position: fixed; bottom: 30px; right: 30px; background: var(--accent); color: white; padding: 12px 20px; border-radius: 50px; text-decoration: none; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-soft); font-weight: 600; transition: transform 0.2s; z-index: 100; }
.floating-arrow:hover { transform: translateY(-4px); }
.floating-arrow__icon { font-size: 1.2rem; }

/* ===== Плашка технических работ ===== */
.tech-warning { background: var(--accent); color: #fff; padding: 12px 0; font-size: 0.95rem; position: relative; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.2); width: 100%; }
.tech-warning .container { display: flex; align-items: center; justify-content: center; gap: 10px; position: relative; }
.tech-warning__icon { font-size: 1.2rem; }
.tech-warning__text { font-weight: 500; text-align: center; }
.tech-warning__close { position: absolute; right: 20px; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; opacity: 0.7; transition: opacity 0.2s; line-height: 1; }
.tech-warning__close:hover { opacity: 1; }

/* ===== Баннер cookie ===== */
.cookie-banner { position: fixed; bottom: 20px; left: 20px; max-width: 480px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow-soft); padding: 16px 20px; z-index: 1000; transform: translateX(-120%); transition: transform 0.4s ease; border-left: 4px solid var(--accent); }
.cookie-banner.show { transform: translateX(0); }
.cookie-banner__content { display: flex; flex-direction: column; gap: 12px; }
.cookie-banner__text { font-size: 0.9rem; color: var(--ink); line-height: 1.5; }
.cookie-banner__link { color: var(--accent); text-decoration: underline; }
.cookie-banner__buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-banner__btn { padding: 8px 16px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; font-family: var(--font-main); }
.cookie-banner__btn--accept { background: var(--accent); color: white; }
.cookie-banner__btn--accept:hover { background: var(--accent-hover); }
.cookie-banner__btn--decline { background: transparent; color: var(--ink-light); border: 1px solid rgba(0, 0, 0, 0.15); }
.cookie-banner__btn--decline:hover { background: rgba(0, 0, 0, 0.05); }

/* ========================================= */
/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
/* ========================================= */
@media (max-width: 600px) {
    /* Hero */
    .hero { padding: 40px 0 24px; }
    .hero__title { font-size: 2.2rem; }
    .hero__subtitle { font-size: 1rem; display: flex; flex-direction: column; gap: 4px; }

    /* Призыв */
    .calendar-invite__title { font-size: 1.5rem; }
    .calendar-invite__text { font-size: 0.9rem; }

    /* Календарь */
    .calendar { padding: 14px; }
    .calendar__week-label { font-size: 1.4rem; }
    .calendar__arrow { width: 34px; height: 34px; font-size: 1rem; }
    .calendar__grid { grid-template-columns: 44px repeat(5, 1fr); gap: 3px; }
    .calendar__day-header { font-size: 0.72rem; padding: 5px 1px; }
    .calendar__time-label { font-size: 0.68rem; padding-right: 3px; }
    .slot { height: 40px; }
    .person { width: 16px; height: 18px; }
    .person::before { width: 8px; height: 8px; }
    .person::after { width: 14px; height: 7px; }
    .calendar__legend { font-size: 0.75rem; gap: 12px; }

    /* Блок бронирования */
    .booking-block { padding: 18px; }
    .booking-block__title { font-size: 1.4rem; }
    .booking-block__slot { font-size: 1rem; }
    .booking-block__note { font-size: 0.82rem; }
    .booking-block__row .btn { display: block; width: 100%; margin: 8px 0; padding: 12px 20px; }
    .booking-block__agreement { margin-top: 16px; font-size: 0.85rem; }

    /* Секции */
    .section-title { font-size: 1.8rem; margin-bottom: 18px; }
    .about, .promo, .teacher, .program, .teacher-note, .reviews { padding: 40px 0; }
    .card { padding: 18px; }
    .card h3 { font-size: 1.25rem; }
    .card p { font-size: 0.95rem; }

    /* Программа */
    .program__note { font-size: 0.9rem; margin-bottom: 20px; }
    .accordion__header { padding: 14px 16px; font-size: 0.98rem; gap: 12px; }
    .accordion__number { font-size: 1.4rem; min-width: 24px; }
    .accordion__icon { font-size: 1.2rem; }
    .accordion__body { padding: 0 16px; }
    .accordion__item.open .accordion__body { padding: 0 16px 16px; }
    .accordion__body li { font-size: 0.9rem; padding: 5px 0 5px 20px; }

    /* От преподавателя */
    .note-paper { padding: 24px 18px; }
    .note-paper__lead { font-size: 1.3rem; }
    .note-paper p { font-size: 0.95rem; line-height: 1.65; }
    .note-paper__sign { font-size: 1.15rem; }
    .note-paper__name { font-size: 1.5rem; }
    .note-paper__role { font-size: 0.85rem; }

    /* Промо и преподаватель */
    .promo__text, .teacher p { font-size: 1rem; }

    /* Плавающая стрелка */
    .floating-arrow { bottom: 20px; right: 20px; padding: 10px 16px; font-size: 0.9rem; }

    /* Отзывы */
    .reviews__grid { display: flex; flex-direction: column; gap: 20px; width: 100%; }
    .review-card { padding: 20px; width: 100%; box-sizing: border-box; }
    .review-card__quote { font-size: 3rem; margin-bottom: 8px; }
    .review-card__text { font-size: 0.95rem; line-height: 1.6; margin-bottom: 16px; text-align: left; }
    .review-card__footer { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
    .review-card__link { width: 100%; justify-content: center; box-sizing: border-box; }
    .review-card__name { font-size: 1.2rem; }

    /* Технические работы */
    .tech-warning { font-size: 0.85rem; padding: 10px 0; }
    .tech-warning__close { right: 10px; }

    /* Cookie баннер */
    .cookie-banner { left: 10px; right: 10px; bottom: 10px; max-width: none; }
    .cookie-banner__buttons { flex-direction: column; }
    .cookie-banner__btn { width: 100%; text-align: center; }
}