/* ========== ОБЩИЕ СТИЛИ (ТЁМНАЯ ТЕМА) ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: url('https://cdn.gamma.app/gdwwhyewwldwc8z/3e066eca294041459127af5830eac242/original/Frame-30.png') center/cover fixed;
    color: #e0e0e0;
    line-height: 1.6;
    animation: bgFadeIn 1.5s ease-out;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: -1;
    animation: bgOverlayFade 1.2s ease-out;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ========== КАРТОЧКИ ========== */
.card {
    background: rgba(20, 20, 30, 0.75);
    backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid rgba(162, 185, 249, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    will-change: transform;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(162, 185, 249, 0.5);
}

.card-inner {
    display: flex;
    flex-wrap: wrap;
}

.card-image {
    flex: 1;
    min-width: 250px;
    background-size: cover;
    background-position: center;
    min-height: 300px;
    transition: transform 0.3s ease;
}

.card:hover .card-image {
    transform: scale(1.02);
}

.card-content {
    flex: 2;
    padding: 2rem;
}

/* ========== ТЕКСТ И ЗАГОЛОВКИ ========== */
h1, h2, h3, .heading {
    font-family: 'Outfit', 'IBM Plex Sans', sans-serif;
    font-weight: 500;
    color: #c5d3ff;
    letter-spacing: -0.01em;
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; margin-top: 0.5rem; }
h3 { font-size: 1.5rem; margin: 1.2rem 0 0.8rem; color: #b0c4ff; }

.text-center { text-align: center; }

.styled-list {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.styled-list li {
    margin-bottom: 0.5rem;
}

.mt-2 { margin-top: 1rem; }

/* ========== ЛЕЙБЛЫ ========== */
.label {
    background: #5f7ec0;
    padding: 0.2rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    color: #fff;
    display: inline-block;
    margin-bottom: 1rem;
}

.label-outline {
    background: transparent;
    border: 1px solid #8aa4e0;
    padding: 0.2rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    color: #c5d3ff;
    display: inline-block;
    margin-bottom: 1rem;
}

/* ========== КНОПКИ ========== */
.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    background: #5f7ec0;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    background: #7b96d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-outline {
    border: 1px solid #8aa4e0;
    background: transparent;
    color: #c5d3ff;
}

.btn-outline:hover {
    background: rgba(138, 164, 224, 0.2);
    color: #fff;
    border-color: #b0c4ff;
}

/* ========== СЕТКИ ========== */
.directions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.direction-item {
    background: rgba(30, 30, 45, 0.7);
    border-radius: 1rem;
    padding: 0.8rem 1rem;
    border-left: 4px solid #7b96d6;
    transition: 0.2s;
    color: #ddd;
}

.direction-item:hover {
    background: rgba(50, 50, 70, 0.8);
    transform: translateX(4px);
}

/* Отзывы (ссылки) */
.reviews-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

/* Контакты (общие стили) */
.contact-info {
    background: rgba(30, 30, 45, 0.7);
    border-radius: 1rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid rgba(162, 185, 249, 0.2);
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.contact-row .emoji {
    font-size: 1.5rem;
}

.phone-link, .email-link {
    color: #c5d3ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.phone-link:hover, .email-link:hover {
    color: #e0e8ff;
    text-decoration: underline;
}

.contact-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}
.contact-buttons .btn {
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

.map-container {
    margin-top: 1.5rem;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

blockquote {
    margin: 1.5rem 0;
    font-style: italic;
    border-left: 3px solid #7b96d6;
    padding-left: 1rem;
    color: #ccc;
}

footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.875rem;
    color: #888;
}

/* ========== КАРУСЕЛЬ ДЛЯ СЕРТИФИКАТОВ ========== */
.cert-carousel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}

.carousel-container {
    width: 80%;
    overflow: hidden;
    margin: 0 1rem;
}

.carousel-track {
    display: flex;
    transition: transform 0.4s ease;
    align-items: stretch;
}

.cert-item {
    flex: 0 0 100%;
    padding: 0.5rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(25, 25, 35, 0.8);
    border-radius: 1rem;
    min-height: 280px;
    border: 1px solid rgba(162, 185, 249, 0.2);
}

.cert-item img {
    max-width: 100%;
    max-height: 260px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
    cursor: pointer;
}

.cert-item img:hover {
    transform: scale(1.02);
}

.carousel-btn {
    background: rgba(95, 126, 192, 0.8);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: 0.2s;
}

.carousel-btn:hover {
    background: #7b96d6;
    transform: scale(1.05);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.dot {
    width: 10px;
    height: 10px;
    background: #555;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.2s;
}

.dot.active {
    background: #8aa4e0;
    width: 20px;
    border-radius: 5px;
}

/* ========== МОДАЛЬНОЕ ОКНО ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 1rem;
    box-shadow: 0 0 30px rgba(100, 150, 255, 0.2);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
}

.close-modal:hover {
    color: #8aa4e0;
}

/* ========== ОБЛОЖКА КНИГИ ========== */
.book-cover {
    max-width: 260px;
    margin: 1.5rem auto;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.book-cover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.5);
}

/* ========== АНИМАЦИИ ========== */
@keyframes bgFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes bgOverlayFade {
    0% { background: rgba(0, 0, 0, 0); backdrop-filter: blur(0); }
    100% { background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(4px); }
}

.animate-on-load {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeSlideUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    box-shadow: 0 0 0 1px rgba(162, 185, 249, 0.4), 0 12px 24px rgba(0, 0, 0, 0.5);
}

.feature-icon, .emoji {
    transition: transform 0.2s;
}

.feature-card:hover .feature-icon {
    transform: scale(1.1);
}

/* ========== АДАПТИВ (МОБИЛЬНЫЕ УСТРОЙСТВА) ========== */
@media (max-width: 768px) {
    .card-inner {
        flex-direction: column;
    }
    .card-content {
        padding: 1.5rem;
    }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.3rem; }
    .reviews-links {
        flex-direction: column;
        align-items: center;
    }
    .btn {
        width: 100%;
        text-align: center;
    }
    .contact-buttons .btn {
        width: auto;
        flex: 1;
        text-align: center;
    }
    .cert-item {
        min-height: 220px;
    }
    .cert-item img {
        max-height: 200px;
    }
    .carousel-container {
        width: 70%;
    }
    .card {
        backdrop-filter: none;
    }

    /* ===== ИСПРАВЛЕНИЕ БЛОКА КОНТАКТОВ ===== */
    #contact .card-content {
        text-align: left !important;
        padding: 1rem !important;
        width: 100%;
    }
    #contact .contact-info {
        margin: 1rem 0;
        padding: 1rem;
    }
    #contact .contact-row {
        justify-content: flex-start;
        gap: 0.5rem;
    }
    #contact .contact-buttons {
        justify-content: center;
        gap: 0.8rem;
        margin-top: 1rem;
    }
    #contact .contact-buttons .btn {
        width: auto !important;
        min-width: 100px;
        flex: 0 0 auto;
        white-space: nowrap;
    }
    #contact .map-container {
        width: 100%;
        margin: 1rem 0 0;
    }
    #contact .card-image {
        order: 2;
        margin-top: 1rem;
    }
}

@media (min-width: 480px) {
    .cert-item {
        flex: 0 0 50%;
    }
}

@media (min-width: 768px) {
    .cert-item {
        flex: 0 0 33.333%;
    }
}

/* ========== ЦЕНТРИРОВАНИЕ ЗАГОЛОВКА И ТЕКСТА В БЛОКЕ КОНТАКТОВ ========== */
#contact h2,
#contact .card-content > p {
    text-align: center !important;
}