/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0A2540;
    --secondary: #00C9A7;
    --bg-white: #FFFFFF;
    --bg-footer: #F1F4F8;
    --text-primary: #0A2540;
    --text-secondary: #475569;
    --text-light: #94A3B8;
    --radius: 20px;
    --shadow-card: 0 12px 40px rgba(10, 37, 64, 0.08);
    --shadow-card-hover: 0 20px 60px rgba(10, 37, 64, 0.15);
    --shadow-btn: 0 8px 24px rgba(10, 37, 64, 0.20);
    --transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-white);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ===== ФОНОВАЯ СЕТКА ===== */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.06;
    background-image:
        linear-gradient(rgba(10, 37, 64, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 37, 64, 0.07) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0) 100%);
    animation: gridPulse 8s ease-in-out infinite alternate;
}

@keyframes gridPulse {
    0% { opacity: 0.04; }
    100% { opacity: 0.09; }
}

.grid-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 201, 167, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 201, 167, 0.04) 1px, transparent 1px);
    background-size: 96px 96px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.3) 70%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.3) 70%, rgba(0, 0, 0, 0) 100%);
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 18px 0;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid rgba(10, 37, 64, 0.04);
    transition: box-shadow 0.4s ease, background 0.4s ease;
}

.header.scrolled {
    box-shadow: 0 4px 30px rgba(10, 37, 64, 0.06);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), #1a3a5c);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: white;
    position: relative;
    box-shadow: 0 4px 16px rgba(10, 37, 64, 0.20);
    flex-shrink: 0;
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--secondary), transparent 60%);
    opacity: 0.3;
    z-index: -1;
    filter: blur(4px);
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--primary);
}

.logo-text span {
    color: var(--secondary);
}

.header-cta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 60px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-decoration: none;
    letter-spacing: -0.2px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(10, 37, 64, 0.30);
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent 60%);
    pointer-events: none;
}

.btn-secondary {
    background: transparent;
    color: var(--primary);
    border: 2px solid rgba(10, 37, 64, 0.12);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(10, 37, 64, 0.04);
    transform: translateY(-2px);
}

.btn-logout {
    background: transparent;
    color: var(--primary);
    border: 2px solid rgba(10, 37, 64, 0.12);
    display: none;
}

.btn-logout:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.04);
    transform: translateY(-2px);
}

/* ===== HERO ===== */
.hero {
    position: relative;
    z-index: 1;
    padding: 100px 0 40px;
    min-height: 60vh;
    display: flex;
    align-items: center;
    background: var(--bg-white);
}

.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    overflow: visible;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 201, 167, 0.10);
    color: var(--secondary);
    padding: 6px 16px 6px 10px;
    border-radius: 60px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 201, 167, 0.15);
}

.hero-badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

.hero h1 {
    font-size: clamp(40px, 5vw, 60px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -2px;
    color: var(--primary);
    margin-bottom: 16px;
}

.hero h1 .highlight {
    background: linear-gradient(135deg, var(--secondary), #00a88a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: clamp(16px, 1.1vw, 18px);
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.6;
    font-weight: 400;
    margin-bottom: 28px;
}

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

.hero-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -140px;
    z-index: 1;
}

.hero-image-placeholder {
    width: 100%;
    max-width: 680px;
    aspect-ratio: 1/0.85;
    border-radius: var(--radius);
    background: linear-gradient(145deg, #f0f4f9, #e8edf4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.8s ease, border-color 0.6s ease;
    transform: scale(1.12);
    transform-origin: center;
}

.hero-image-placeholder:hover {
    border-color: var(--secondary);
    background: linear-gradient(145deg, #f5f9fe, #eaf0f8);
}

.hero-image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
    display: block;
}

.hero-image::before {
    content: '';
    position: absolute;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(0, 201, 167, 0.12), transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    animation: glowFloat 6s ease-in-out infinite alternate;
}

@keyframes glowFloat {
    0% { transform: translate(-10%, -10%) scale(1); }
    100% { transform: translate(10%, 10%) scale(1.2); }
}

/* ===== MODULES ===== */
.modules {
    position: relative;
    z-index: 1;
    padding: 40px 0 60px;
    background: var(--bg-white);
    border-top: 1px solid rgba(10, 37, 64, 0.04);
}

.modules::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, transparent, var(--bg-white));
    pointer-events: none;
    z-index: 2;
}

.section-label {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--secondary);
    margin-bottom: 6px;
}

.section-title {
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--primary);
    margin-bottom: 30px;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.module-card {
    background: var(--bg-white);
    padding: 28px 24px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(10, 37, 64, 0.04);
    cursor: default;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 260px;
    opacity: 0.7;
    pointer-events: none;
    will-change: transform, opacity;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.6s ease,
                box-shadow 0.6s ease,
                border-color 0.6s ease;
}

.module-card.active {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

.module-card.active:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(0, 201, 167, 0.12);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease,
                border-color 0.4s ease;
}

.module-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 201, 167, 0.03), transparent 70%);
    pointer-events: none;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.module-card.active:hover::after {
    transform: scale(1.5);
}

/* ===== OVERLAY-LINK ===== */
.card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    text-decoration: none;
    color: inherit;
    cursor: default;
    pointer-events: none;
}

.module-card.active .card-link {
    cursor: pointer;
    pointer-events: auto;
}

/* ===== КНОПКА "ПОДРОБНЕЕ" ===== */
.btn-detail {
    position: relative;
    z-index: 2;
    display: block;
    margin: 16px auto 0;
    padding: 6px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #7A9A96;
    background: transparent;
    border: 1.5px solid rgba(10, 37, 64, 0.15);
    border-radius: 60px;
    text-decoration: none;
    letter-spacing: 0.3px;
    text-align: center;
    width: fit-content;
    flex-shrink: 0;
    cursor: default;
    pointer-events: none;
    opacity: 0.5;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.module-card.active .btn-detail {
    cursor: pointer;
    pointer-events: auto;
    opacity: 1;
}

.btn-detail:hover {
    background: var(--secondary);
    border-color: var(--secondary);
    color: #FFFFFF;
    transform: translateY(-2px) scale(1.02);
}

/* ===== ИКОНКИ ===== */
.module-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 14px;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.module-icon img {
    width: 36px;
    height: 36px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

.module-card.active:hover .module-icon {
    transform: scale(1.12) rotate(-4deg);
}

.module-card:nth-child(1) .module-icon {
    background: linear-gradient(135deg, rgba(0, 201, 167, 0.15), rgba(0, 201, 167, 0.05));
    color: var(--secondary);
}
.module-card:nth-child(2) .module-icon {
    background: linear-gradient(135deg, rgba(10, 37, 64, 0.10), rgba(10, 37, 64, 0.04));
    color: var(--primary);
}
.module-card:nth-child(3) .module-icon {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.10), rgba(30, 58, 95, 0.04));
    color: #1E3A5F;
}
.module-card:nth-child(4) .module-icon {
    background: linear-gradient(135deg, rgba(10, 37, 64, 0.12), rgba(10, 37, 64, 0.04));
    color: var(--primary);
}
.module-card:nth-child(5) .module-icon {
    background: linear-gradient(135deg, rgba(0, 201, 167, 0.12), rgba(10, 37, 64, 0.04));
    color: #0A2540;
}
.module-card:nth-child(6) .module-icon {
    background: linear-gradient(135deg, rgba(10, 37, 64, 0.12), rgba(0, 201, 167, 0.04));
    color: var(--secondary);
}
.module-card:nth-child(7) .module-icon {
    background: linear-gradient(135deg, rgba(0, 201, 167, 0.15), rgba(10, 37, 64, 0.06));
    color: #0A2540;
}
.module-card:nth-child(8) .module-icon {
    background: linear-gradient(135deg, rgba(10, 37, 64, 0.12), rgba(0, 201, 167, 0.04));
    color: var(--secondary);
}
.module-card:nth-child(9) .module-icon {
    background: linear-gradient(135deg, rgba(0, 201, 167, 0.15), rgba(10, 37, 64, 0.05));
    color: var(--secondary);
}
.module-card:nth-child(10) .module-icon {
    background: linear-gradient(135deg, rgba(10, 37, 64, 0.10), rgba(10, 37, 64, 0.04));
    color: var(--primary);
}

.module-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.module-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    flex: 1;
    margin-bottom: 0;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 37, 64, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--radius);
    max-width: 440px;
    width: 100%;
    padding: 48px 40px 40px;
    box-shadow: 0 40px 80px rgba(10, 37, 64, 0.25);
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--primary);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.modal .form-group {
    margin-bottom: 18px;
}

.modal .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.modal .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(10, 37, 64, 0.08);
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: var(--bg-white);
    outline: none;
}

.modal .form-group input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(0, 201, 167, 0.10);
}

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

.modal .btn-primary {
    width: 100%;
    justify-content: center;
    padding: 14px;
    font-size: 16px;
    margin-top: 6px;
}

.modal-error {
    background: rgba(231, 76, 60, 0.08);
    color: #e74c3c;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    display: none;
    margin-bottom: 14px;
}

.modal-error.show {
    display: block;
}

/* ===== FOOTER ===== */
.footer {
    position: relative;
    z-index: 1;
    background: var(--bg-footer);
    padding: 40px 0 32px;
    border-top: 1px solid rgba(10, 37, 64, 0.04);
}

.footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-copy {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

.footer-copy strong {
    color: var(--primary);
    font-weight: 600;
}

.footer-links {
    display: flex;
    gap: 28px;
}

.footer-links a {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: 500;
    position: relative;
}

.footer-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--secondary);
    transition: width 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links a:hover::after {
    width: 100%;
}

.footer-policy {
    font-size: 13px;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-policy:hover {
    color: var(--primary);
}

/* ===== АНИМАЦИИ ПРИ СКРОЛЛЕ ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .container {
        padding: 0 28px;
    }
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    .hero p {
        margin-left: auto;
        margin-right: auto;
    }
    .hero-actions {
        justify-content: center;
    }
    .hero-image {
        margin-left: 0;
    }
    .hero-image-placeholder {
        max-width: 500px;
        margin: 0 auto;
        transform: scale(1);
    }
    .hero-image::before {
        width: 80%;
        height: 80%;
    }
    .modules-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .hero {
        min-height: 50vh;
        padding: 90px 0 30px;
    }
    .modal {
        padding: 36px 28px 32px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    .header {
        padding: 12px 0;
    }
    .logo-text {
        font-size: 18px;
    }
    .logo-icon {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    .hero {
        padding: 80px 0 20px;
        min-height: auto;
    }
    .hero h1 {
        font-size: 32px;
    }
    .hero-image-placeholder {
        max-width: 100%;
        aspect-ratio: 1/0.7;
    }
    .modules-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .modules {
        padding: 30px 0 40px;
    }
    .footer .container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
    .section-title {
        font-size: 26px;
        margin-bottom: 20px;
    }
    .module-card {
        padding: 24px 20px 22px;
        min-height: 200px;
    }
    .modal {
        padding: 28px 20px 28px;
        margin: 16px;
    }
    .modal-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .header .container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    .hero h1 {
        font-size: 28px;
    }
    .hero-actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }
    .hero {
        padding: 70px 0 16px;
    }
    .module-card {
        min-height: 180px;
    }
}

h1 .tb-soft { color: rgba(10, 37, 64, 0.40); }
