/* Base & Variables */
:root {
    --dark-blue: #0B1A33;
    --darker-blue: #071122;
    --gold: #D4AF37;
    --gold-light: #F5D76E;
    --purple: #7C3AED;
    --white: #FFFFFF;
    --glass: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-main: #E5E7EB;
    --text-muted: #9CA3AF;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #133975;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

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

.section {
    padding: 100px 0;
}

.bg-darker {
    background-color: var(--darker-blue);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 60px;
    color: var(--white);
}

.gold-text { color: var(--gold); }
.gold-gradient-text {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Glass-morphism Utilities */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    transition: var(--transition);
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

/* Navigation */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(11, 26, 51, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    height: 80px;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    text-decoration: none;
    color: var(--white);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--gold);
}

.nav-btn {
    background: var(--purple);
    padding: 10px 20px;
    border-radius: 12px;
    color: white !important;
}

.nav-phone a {
    color: var(--white);
    font-weight: 700;
    text-decoration: none;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 750px;
    display: flex;
    align-items: center;
    background-image: url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?q=80&w=2071&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: scroll; /* Parallax support via javascript offset */
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 15, 30, 0.95) 35%, rgba(10, 15, 30, 0.75) 65%, rgba(10, 15, 30, 0.4) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 820px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5.5vw, 4.8rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 30px;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 45px;
    max-width: 650px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 24px;
}

/* Stats Section (Advantages) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.stat-item {
    padding: 40px 30px;
    text-align: center;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
}

.stat-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 70px;
    margin-bottom: 25px;
}

.stat-icon svg {
    width: 56px;
    height: 56px;
    stroke: var(--gold);
    stroke-width: 1.5;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Hover effect on stat-item (SaaS Stripe-like glow) */
.stat-item:hover {
    transform: translateY(-8px);
    border-color: rgba(212, 175, 55, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(212, 175, 55, 0.15);
    background: rgba(255, 255, 255, 0.025);
}

.stat-item:hover .stat-icon svg {
    transform: scale(1.15);
    stroke: var(--gold-light);
    filter: drop-shadow(0 0 10px rgba(245, 215, 110, 0.5));
}

.stat-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--white);
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 16px 32px;
    border-radius: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--dark-blue);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.4), 0 0 15px rgba(212, 175, 55, 0.25);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Fade up animations */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    opacity: 0;
    animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

/* Scroll Reveal */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

.btn-purple-sm {
    background: var(--purple);
    color: white;
    padding: 8px 20px;
    font-size: 0.9rem;
    border-radius: 10px;
}

.w-100 { width: 100%; text-align: center; }

/* Directions Grid & Modern Cards Design */
.directions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

.dir-card {
    position: relative;
    height: 180px;
    padding: 24px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: left;
    background-color: var(--darker-blue);
}

.dir-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 1;
}

.dir-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(7, 17, 34, 0.8) 15%, rgba(7, 17, 34, 0.4) 60%, rgba(7, 17, 34, 0.08) 100%);
    transition: opacity 0.4s ease;
    z-index: 2;
}

.dir-card-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Prevents children from interrupting pointer events */
}

.dir-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.35;
    transition: color 0.4s ease;
}

.dir-card.active {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
}

/* Hover States */
.dir-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.3);
}

.dir-card:hover .dir-card-bg {
    transform: scale(1.12);
}

.dir-card:hover .dir-card-overlay {
    opacity: 0.85; /* Gradient becomes slightly lighter to reveal more of the background image */
}

.dir-card:hover h3 {
    color: var(--gold-light);
}


/* Courses Catalog Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}


/* Diploma Cards Section */
.diploma-section {
    padding: 100px 0;
}

.diploma-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.diploma-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.diploma-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.diploma-card-img-wrapper {
    width: 100%;
    height: 240px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.diploma-card-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.diploma-card:hover .diploma-card-img {
    transform: scale(1.05);
}

.diploma-card-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.diploma-card-body h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 15px;
    line-height: 1.3;
}

.diploma-card-body p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.diploma-card-body strong {
    color: var(--gold-light);
    font-weight: 600;
}

/* Contact & Lead Capture Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    background: rgba(11, 26, 51, 0.4);
}

.contact-info {
    padding: 60px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(11, 26, 51, 0.6) 100%);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.demo-badge {
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.35);
    color: white;
    display: inline-block;
    padding: 8px 18px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    align-self: flex-start;
    margin-bottom: 30px;
}

.contact-info h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1.25;
    margin-bottom: 20px;
}

.contact-info p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}

.date-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.25);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--gold-light);
    align-self: flex-start;
    margin-top: auto;
}

.contact-form {
    padding: 60px;
    background: rgba(7, 17, 34, 0.25);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input {
    width: 100%;
    height: 56px;
    padding: 0 24px;
    background: rgba(7, 17, 34, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    color: var(--white);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(7, 17, 34, 0.8);
}

.form-group input:focus {
    border-color: var(--gold);
    background: rgba(7, 17, 34, 0.9);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--purple);
    cursor: pointer;
}

.contact-form .btn-gold {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 14px;
    transition: var(--transition);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.2);
}

.contact-form .btn-gold:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.45);
}

.contact-form .btn-gold:active:not(:disabled) {
    transform: translateY(0) scale(0.99);
}

.form-subtext {
    margin-top: 15px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Footer Section */
.footer {
    background-color: var(--darker-blue);
    border-top: 1px solid var(--glass-border);
    padding: 80px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 50px;
    margin-bottom: 60px;
}

.footer-brand .logo {
    display: inline-block;
    margin-bottom: 15px;
}

.standards-icons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

.standards-icons span {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 0.5px;
}

.footer-links h4, .footer-contact h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
    margin-bottom: 25px;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    display: inline-block;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 6px 12px;
    margin-left: -12px;
    border-radius: 8px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--gold);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(6px);
}

.footer-contact .contact-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: flex-start;
}

.footer-contact .contact-item .icon {
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--gold);
    flex-shrink: 0;
}

.footer-contact p {
    line-height: 1.6;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.phone-link {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--white);
    text-decoration: none;
    transition: var(--transition);
    display: inline-block;
    margin-top: 4px;
}

.phone-link:hover {
    color: var(--gold);
    transform: translateY(-1px);
}

.footer-bottom {
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 60px;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .contact-wrapper, .footer-content {
        grid-template-columns: 1fr;
    }
    .contact-info {
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        padding: 40px 30px;
        gap: 30px;
    }
    .contact-form {
        padding: 40px 30px;
    }
    .footer-content {
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: rgba(7, 10, 16, 0.98);
        border-bottom: 1px solid var(--glass-border);
        padding: 30px 20px;
        gap: 20px;
        text-align: center;
        z-index: 999;
    }
    .nav-links.mobile-active {
        display: flex;
    }
    .nav-phone { display: none; }
    .mobile-menu-btn { display: block; }

    /* Оптимизация контактной секции "Начните обучение бесплатно" на мобильных */
    .contact-section {
        padding: 50px 0;
    }
    .contact-wrapper {
        border-radius: 20px;
    }
    .contact-info {
        padding: 24px 20px;
        gap: 15px;
    }
    .demo-badge {
        padding: 5px 12px;
        font-size: 0.75rem;
        margin-bottom: 12px;
    }
    .contact-info h2 {
        font-size: 1.5rem !important;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    .contact-info p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 15px;
    }
    .date-badge {
        padding: 6px 12px;
        font-size: 0.78rem;
        border-radius: 8px;
        margin-top: 10px;
    }
    .contact-form {
        padding: 24px 20px;
    }
    .form-group {
        margin-bottom: 14px;
    }
    .form-group input {
        height: 48px;
        padding: 0 16px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    .form-checkbox {
        margin-bottom: 18px;
        font-size: 0.82rem;
        gap: 8px;
    }
    .form-checkbox input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
    .contact-form .btn-gold {
        height: 48px;
        font-size: 0.95rem;
        border-radius: 10px;
    }
    .form-subtext {
        margin-top: 10px;
        font-size: 0.75rem;
    }
}

/* Courses Page Specific Styles */
.courses-page-hero {
    position: relative;
    padding-top: 160px;
    padding-bottom: 80px;
    background: linear-gradient(135deg, rgba(12, 30, 62, 0.95), rgba(7, 17, 34, 0.95));
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}

.courses-page-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--white);
}

.courses-breadcrumbs {
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.courses-breadcrumbs a {
    color: var(--gold);
    text-decoration: none;
    transition: var(--transition);
}

.courses-breadcrumbs a:hover {
    color: var(--gold-light);
}

.courses-section {
    padding: 80px 0;
    background-color: var(--darker-blue);
}

.course-card-enhanced {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
}

.course-card-enhanced:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(212, 175, 55, 0.12);
    border-color: rgba(212, 175, 55, 0.25);
}

.course-card-image {
    width: 100%;
    height: 190px; /* Увеличено до 190px (~50% высоты) для лучшей композиции */
    object-fit: cover;
    border-bottom: 1px solid var(--glass-border);
}

.course-card-body {
    padding: 15px; /* Уменьшено до 15px для компактности */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.course-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px; /* Уменьшено с 12px */
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 4.2em; /* Ровно 3 строки */
}

.course-card-description {
    display: none; /* Полностью скрыто */
}

.course-card-btn {
    width: 100%;
    margin-top: auto; /* Всегда прижата к низу */
    background: var(--purple);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
}

.course-card-btn:hover {
    background: #6D28D9;
    transform: translateY(-2px);
}

.no-courses-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--glass);
    border: 1px dashed var(--glass-border);
    border-radius: 20px;
}

.no-courses-message h3 {
    margin-bottom: 10px;
    color: var(--white);
}

.no-courses-message p {
    color: var(--text-muted);
}

/* Lightbox Modal CSS */
.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(7, 17, 34, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    padding: 20px;
}

.lightbox-modal.lightbox-active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-image {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transform: scale(0.92);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.lightbox-modal.lightbox-active .lightbox-image {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 3rem;
    font-weight: 200;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
    opacity: 0.6;
    z-index: 2010;
}

.lightbox-close:hover {
    color: var(--gold);
    opacity: 1;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 2.5rem;
    }
    .lightbox-image {
        max-width: 95%;
        max-height: 75vh;
    }
}

/* Course Details Modal Styles */
.course-detail-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background-color: rgba(7, 17, 34, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start; /* Изменено на flex-start для корректного скролла длинных окон */
    justify-content: center;
    padding: 40px 20px; /* Отступы от краев экрана */
    overflow-y: auto; /* Скроллится оверлей, а не сама модалка */
    animation: fadeIn 0.3s ease forwards;
}

.course-detail-modal {
    width: 100%;
    max-width: 800px;
    background: rgba(11, 26, 51, 0.98);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    margin: auto; /* Позволяет автоматически выровнять по центру и избежать пропадания верха */
    animation: zoomIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.15) forwards;
    max-height: none; /* Убираем max-height, так как скролл на оверлее */
    overflow: visible; /* Контент больше не обрезается */
}

.course-detail-close {
    position: absolute;
    top: 24px;
    right: 24px; /* Безопасные отступы от верха и права */
    background: rgba(7, 17, 34, 0.7);
    border: 1px solid var(--glass-border);
    color: var(--white);
    font-size: 1.8rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
    transition: var(--transition);
}

.course-detail-close:hover {
    background: var(--gold);
    color: var(--dark-blue);
    transform: rotate(90deg);
}

.course-detail-header {
    position: relative;
    min-height: 150px; /* Высота подстраивается под текст, но не меньше 150px */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-bottom: 1px solid var(--glass-border);
    border-top-left-radius: 28px;
    border-top-right-radius: 28px;
    overflow: hidden; /* Обрезает фоновый баннер точно по границам скругления модалки */
}

.course-detail-banner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.12; /* Приглушенный фон */
    filter: blur(8px);
    z-index: 1;
}

.course-detail-title-block {
    position: relative;
    z-index: 2;
    padding: 30px 80px 24px 30px; /* Справа отступ 80px, чтобы текст не пересекался с крестиком закрытия */
    background: linear-gradient(to top, rgba(11, 26, 51, 0.85) 0%, rgba(11, 26, 51, 0.65) 60%, rgba(11, 26, 51, 0.3) 100%);
}

.detail-category-badge {
    display: inline-block;
    background: var(--purple);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.course-detail-title-block h2 {
    font-size: 1.5rem; /* Оптимальный читаемый размер */
    font-weight: 800;
    color: var(--white);
    line-height: 1.3;
    margin-bottom: 8px;
}

.detail-price-hours {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.detail-price-hours strong {
    color: var(--gold-light);
}

.old-price-line {
    text-decoration: line-through;
    font-size: 0.85rem;
    margin-left: 8px;
    opacity: 0.6;
}

.course-detail-body {
    padding: 24px 30px; /* Комфортные отступы */
}

.course-detail-body h3 {
    font-size: 1.05rem; /* Уменьшено на 12.5% */
    font-weight: 700;
    color: var(--white);
    margin-bottom: 12px;
}

.course-detail-desc-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Accordion */
.course-modules-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-item {
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
}

.accordion-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--white);
    transition: var(--transition);
    user-select: none;
}

.accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.accordion-arrow {
    font-size: 0.8rem;
    color: var(--gold);
    transition: transform 0.3s ease;
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    background: rgba(7, 17, 34, 0.3);
    border-top: 0 solid var(--glass-border);
}

.accordion-item.active .accordion-body {
    max-height: 500px;
    overflow-y: auto;
    border-top-width: 1px;
}

.accordion-item.active .accordion-arrow {
    transform: rotate(180deg);
}

.lessons-list {
    padding: 15px 20px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lessons-list li {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.4;
}

.lessons-list li span {
    color: var(--text-main);
}

.loading-lessons {
    list-style: none;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Spinner Loader */
.course-detail-loader {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--gold);
    border-radius: 50%;
    margin: 0 auto 15px auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 768px) {
    .course-detail-modal {
        max-height: none;
        border-radius: 20px;
        margin: 20px auto; /* Обеспечивает безопасные внешние отступы при прокрутке */
    }
    .course-detail-header {
        min-height: 120px; /* Адаптивная минимальная высота */
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }
    .course-detail-title-block {
        padding: 20px 60px 16px 20px; /* Отступы с учетом крестика закрытия */
    }
    .course-detail-title-block h2 {
        font-size: 1.25rem;
    }
    .course-detail-body {
        padding: 20px;
    }
}

/* Новые улучшенные стили для интерфейса каталога и модальных окон */

/* Мета-информация и цены на карточках курсов */
.course-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px; /* Уменьшено с 8px */
}

.course-card-pricing {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px; /* Уменьшено с 16px */
    margin-top: auto; /* Прижимает блок цен к кнопке внизу */
}

.course-card-price {
    font-size: 1.35rem; /* Крупнее на 10% для акцента */
    font-weight: 800;
    color: var(--gold-light);
}

.course-card-old-price {
    font-size: 0.95rem;
    text-decoration: line-through;
    color: var(--text-muted);
    opacity: 0.6;
}

/* Улучшенный аккордеон модулей */
.accordion-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-grow: 1;
    padding-right: 15px;
}

.accordion-lessons-badge {
    background: rgba(124, 58, 237, 0.08); /* Визуально легче */
    border: 1px solid rgba(124, 58, 237, 0.2);
    color: #c084fc;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.lessons-list li svg {
    width: 16px;
    height: 16px;
    color: var(--gold);
    flex-shrink: 0;
    margin-top: 2px;
}

/* Измененный аккордеон с увеличенными отступами и более плавной анимацией */
.accordion-item {
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.01);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.accordion-header {
    padding: 18px 24px; /* Увеличено */
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--white);
    transition: var(--transition);
    user-select: none;
}

.lessons-list {
    padding: 20px 24px; /* Увеличенные отступы */
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px; /* Одинаковые отступы между уроками */
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1); /* Более плавное раскрытие */
    background: rgba(7, 17, 34, 0.15);
    border-top: 0 solid var(--glass-border);
}

/* Главный продающий CTA блок */
.modal-cta-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-radius: 20px;
    padding: 24px;
    margin-top: 25px;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-cta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.modal-cta-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-cta-prices {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.modal-cta-discount-badge {
    background: #ef4444;
    color: var(--white);
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.modal-cta-hours {
    font-size: 0.9rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-cta-btn-wrapper {
    width: 100%;
}

.modal-cta-submit-btn {
    background: #7c3aed; /* Насыщенный фиолетовый */
    color: var(--white);
    font-size: 1.1rem; /* Увеличено */
    font-weight: 700;
    width: 100%;
    padding: 18px 24px; /* Высота увеличена */
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1); /* Плавная hover-анимация */
    text-align: center;
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.modal-cta-submit-btn:hover {
    background: #6d28d9;
    box-shadow: 0 8px 30px rgba(109, 40, 217, 0.55);
    transform: translateY(-3px) scale(1.015); /* Заметная hover-анимация */
}

.modal-cta-submit-btn:active {
    transform: translateY(-1px) scale(1);
}

/* Блок преимуществ */
.modal-benefits-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-main);
}

.benefit-icon {
    width: 18px;
    height: 18px;
    color: #10b981; /* Зеленая галочка */
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .modal-benefits-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .hero {
        padding-top: 100px;
        min-height: 600px;
        height: auto;
        padding-bottom: 60px;
    }
    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }
    .hero-actions .btn {
        width: 100%;
        text-align: center;
    }
    .section-title {
        font-size: 1.8rem !important;
        margin-bottom: 30px !important;
    }
    .contact-form form {
        width: 100%;
    }
    .contact-form form .btn {
        width: 100%;
    }
    body, html {
        overflow-x: hidden;
        width: 100%;
    }
}




