/* Основные стили и сброс */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&family=Playfair+Display:wght@400;500;600&display=swap');

:root {
    --main-color: #9f847e;
    --accent-color: #d6c9c3;
    --light-color: #f7f4f1;
    --dark-color: #4a3c38;
    --text-color: #333;
    --error-color: #d64541;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

ul {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    line-height: 1.3;
}

h2 {
    margin-bottom: 2rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 2.5rem;
    color: var(--dark-color);
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background-color: var(--main-color);
}

section {
    padding: 80px 0;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--main-color);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    background-color: var(--dark-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.btn--small {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* Хедер */
.header {
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(247, 244, 241, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.header__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header__logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: var(--dark-color);
}

.header__nav ul {
    display: flex;
    gap: 20px;
}

.header__nav a {
    font-weight: 400;
    position: relative;
}

.header__nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--main-color);
    transition: var(--transition);
}

.header__nav a:hover::after {
    width: 100%;
}

/* 1. Главная секция */
.main-section {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, rgba(214, 201, 195, 0.6), rgba(159, 132, 126, 0.8)), url('./img/ppw0pZ.jpg') center/cover no-repeat;
    margin-top: 0;
    padding-top: 80px;
}

.main-section__title {
    font-size: 4rem;
    color: #fff;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1s ease forwards;
}

.main-section__subtitle {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1s ease forwards 0.3s;
}

.main-section .btn {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1s ease forwards 0.6s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. Философия */
.philosophy-section {
    background-color: #fff;
}

.philosophy-section__content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.philosophy-section__text {
    flex: 1;
}

.philosophy-section__image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.fade-in-text {
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
}

.fade-in-text.active {
    opacity: 1;
    transform: translateY(0);
}

/* 3. Тренировки */
.trainings-section {
    background-color: var(--light-color);
}

.trainings-section__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.training-card {
    height: 200px;
    perspective: 1000px;
}

.training-card__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.training-card:hover .training-card__inner {
    transform: rotateY(180deg);
}

.training-card__front,
.training-card__back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.training-card__front {
    background-color: var(--accent-color);
    color: var(--dark-color);
}

.training-card__back {
    background-color: var(--main-color);
    color: #fff;
    transform: rotateY(180deg);
}

/* 4. Расписание */
.schedule-section {
    background-color: #fff;
}

.schedule-table {
    width: 100%;
    box-shadow: var(--shadow);
    border-radius: 10px;
    overflow: hidden;
}

.schedule-table__header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    background-color: var(--main-color);
    color: #fff;
    font-weight: 500;
}

.schedule-table__row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    border-bottom: 1px solid #f0f0f0;
    transition: var(--transition);
}

.schedule-table__row:hover {
    background-color: var(--light-color);
}

.schedule-table__cell {
    padding: 15px;
    text-align: center;
}

.schedule-table__row:last-child {
    border-bottom: none;
}

/* 5. Форма записи */
.signup-section {
    background: linear-gradient(to right, #fff 50%, var(--light-color) 50%);
}

.signup-section__content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.signup-section__image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.signup-section__form {
    flex: 1;
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 400;
    color: var(--dark-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--main-color);
    box-shadow: 0 0 0 3px rgba(159, 132, 126, 0.2);
}

/* Стили для отображения ошибок формы */
.form-errors {
    background-color: rgba(214, 69, 65, 0.1);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 3px solid var(--error-color);
}

.form-errors ul {
    list-style: disc;
    margin-left: 20px;
    color: var(--error-color);
    font-size: 0.9rem;
}

.form-errors li {
    margin-bottom: 5px;
}

input:invalid, select:invalid {
    border-color: var(--error-color) !important;
}

/* 6. Отзывы */
.reviews-section {
    background-color: var(--light-color);
}

.reviews-slider {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    min-height: 180px;
}

.review-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.review-item.visible {
    position: relative;
    opacity: 1;
}

.review-item__content {
    padding: 30px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
}

.review-item__author {
    margin-top: 15px;
    font-weight: 500;
    color: var(--main-color);
}

/* CSS анимация смены отзывов */
@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}

.review-item:nth-child(1) {
    animation: fadeInOut 15s infinite;
}

.review-item:nth-child(2) {
    animation: fadeInOut 15s infinite 5s;
}

.review-item:nth-child(3) {
    animation: fadeInOut 15s infinite 10s;
}

/* 7. Галерея */
.gallery-section {
    background-color: #fff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* 8. Статьи */
.articles-section {
    background-color: var(--light-color);
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.article-card {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.article-card h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.article-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--main-color);
    font-weight: 500;
}

.article-link:hover {
    color: var(--dark-color);
}

/* 9. Контакты */
.contacts-section {
    background-color: #fff;
}

.contacts-section__content {
    display: flex;
    gap: 40px;
}

.contacts-section__info {
    flex: 1;
}

.contacts-section__map {
    flex: 1.5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.contact-item {
    margin-bottom: 30px;
}

.contact-item h3 {
    margin-bottom: 10px;
    color: var(--dark-color);
}

/* 10. Политики */
.policies-section {
    background-color: var(--light-color);
}

.policies-tabs {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.policies-tabs__nav {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
}

.policies-tabs__nav-item {
    padding: 15px 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.policies-tabs__nav-item:hover {
    background-color: var(--light-color);
}

.policies-tabs__nav-item.active {
    color: var(--main-color);
    border-bottom: 2px solid var(--main-color);
}

.policies-tabs__content {
    padding: 30px;
    position: relative;
}

.policies-tabs__pane {
    display: none;
    animation: fadeIn 0.5s ease;
}

.policies-tabs__pane.active {
    display: block;
}

.policies-tabs__pane h3 {
    margin-bottom: 15px;
    color: var(--dark-color);
}

.policies-tabs__pane p {
    margin-bottom: 20px;
}

/* CSS-only табы через радио-кнопки */
.policies-tabs input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Первый таб виден по умолчанию */
#tab-privacy:checked ~ .policies-tabs__content #privacy,
#tab-consent:checked ~ .policies-tabs__content #consent,
#tab-refund:checked ~ .policies-tabs__content #refund,
#tab-terms:checked ~ .policies-tabs__content #terms {
    display: block;
}

/* Начальное состояние - первый таб активен */
.policies-tabs__pane#privacy {
    display: block;
}

#tab-privacy:checked ~ .policies-tabs__nav .tab-privacy-label,
#tab-consent:checked ~ .policies-tabs__nav .tab-consent-label,
#tab-refund:checked ~ .policies-tabs__nav .tab-refund-label,
#tab-terms:checked ~ .policies-tabs__nav .tab-terms-label {
    color: var(--main-color);
    border-bottom: 2px solid var(--main-color);
}

/* 11. Футер */
.footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 60px 0 30px;
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer__logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.footer__nav ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer__nav a:hover {
    color: var(--accent-color);
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.footer__links a {
    position: relative;
}

.footer__links a:not(:last-child):after {
    content: '•';
    position: absolute;
    right: -12px;
    color: rgba(255, 255, 255, 0.5);
}

.footer__links a:hover {
    color: var(--accent-color);
    opacity: 1;
}

.footer__copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Поп-ап про cookies */
.cookies-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(74, 60, 56, 0.95);
    backdrop-filter: blur(5px);
    color: #fff;
    padding: 15px 0;
    z-index: 1000;
    animation: slideUp 0.5s ease;
}

.cookies-popup__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookies-popup__content p {
    flex: 1;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Adaptive для мобильной версии */
@media (max-width: 992px) {
    .header {
        position: relative;
        padding: 15px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .main-section__title {
        font-size: 3rem;
    }
    
    .main-section__subtitle {
        font-size: 1.2rem;
    }
    
    .philosophy-section__content,
    .signup-section__content,
    .contacts-section__content {
        flex-direction: column;
    }
    
    .signup-section {
        background: var(--light-color);
    }
    
    .trainings-section__grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .policy-tabs__nav {
        flex-wrap: wrap;
    }
    
    .contact-item {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    section {
        padding: 60px 0;
    }
    
    .header__inner {
        flex-direction: column;
        gap: 15px;
    }
    
    .header__nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }
    
    .main-section__title {
        font-size: 2.5rem;
    }
    
    .schedule-table__header,
    .schedule-table__row {
        grid-template-columns: 1fr 1fr;
    }
    
    .schedule-table__header .schedule-table__cell:nth-child(3),
    .schedule-table__header .schedule-table__cell:nth-child(4),
    .schedule-table__row .schedule-table__cell:nth-child(3),
    .schedule-table__row .schedule-table__cell:nth-child(4) {
        display: none;
    }
    
    .footer__inner {
        flex-direction: column;
        gap: 20px;
    }
    
    .footer__nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .policies-tabs__nav-item {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .cookies-popup__content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .main-section__title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .trainings-section__grid,
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .policies-tabs__nav {
        flex-direction: column;
        border-bottom: none;
    }
    
    .policies-tabs__nav-item.active {
        border-bottom: none;
        background-color: var(--light-color);
    }
}

/* Scroll Reveal эффекты через CSS */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.6s ease;
}

/* Эта часть будет работать с intersection observer, но мы реализуем через простое решение */
.fade-in.show {
    opacity: 1;
    transform: translateY(0);
}

/* CSS для анимации появления при скролле (без JS) */
@media (prefers-reduced-motion: no-preference) {
    .philosophy-section__text p:nth-child(1) {
        animation: slideUp 0.6s ease 0.3s forwards;
    }
    
    .philosophy-section__text p:nth-child(2) {
        animation: slideUp 0.6s ease 0.6s forwards;
    }
    
    .philosophy-section__text p:nth-child(3) {
        animation: slideUp 0.6s ease 0.9s forwards;
    }
    
    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* CSS-only карусель для отзывов */
@keyframes carousel {
    0%, 25% {
        opacity: 1;
        z-index: 1;
    }
    33%, 92% {
        opacity: 0;
        z-index: 0;
    }
    100% {
        opacity: 1;
        z-index: 1;
    }
}

.review-item:nth-child(1) {
    animation: carousel 15s infinite;
}

.review-item:nth-child(2) {
    animation: carousel 15s 5s infinite;
}

.review-item:nth-child(3) {
    animation: carousel 15s 10s infinite;
} 