@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --brand-primary: #0f766e;
    --brand-primary-hover: #0d5e58;
    --brand-soft: #f0fdfa;
    --brand-border: #ccfbf1;
    --accent-amber: #f59e0b;
    --bg-page: #f4f6f9;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-light: #e2e8f0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.03);
    --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.06), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

main {
    margin-bottom: 2rem;
}

/* === НАВИГАЦИЯ (Glassmorphism) === */
.site-navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    padding: 0.65rem 0;
    z-index: 1030;
}

.site-navbar .navbar-brand {
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-main) !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.02em;
}

.brand-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0f766e 0%, #10b981 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.25);
    flex-shrink: 0;
}

.site-navbar .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.94rem;
    padding: 0.5rem 0.85rem !important;
    border-radius: var(--radius-sm);
    transition: all 0.18s ease;
}

.site-navbar .nav-link:hover,
.site-navbar .nav-link:focus,
.site-navbar .nav-link.show {
    color: var(--brand-primary) !important;
    background-color: var(--brand-soft);
}

.site-navbar .dropdown-menu {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    margin-top: 0.4rem;
}

.site-navbar .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.85rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-main);
    transition: background 0.15s ease, color 0.15s ease;
}

.site-navbar .dropdown-item:hover {
    background-color: var(--brand-soft);
    color: var(--brand-primary);
}

.btn-login-nav {
    background: var(--brand-primary);
    color: #fff !important;
    border: none;
    border-radius: 10px;
    padding: 0.5rem 1.1rem;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.25);
    transition: all 0.2s ease;
}

.btn-login-nav:hover {
    background: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.32);
}

.navbar .menu-soon,
.dropdown-menu .menu-soon {
    opacity: 0.55;
    cursor: not-allowed;
}

.menu-soon-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #64748b;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
}

/* === УНИФИКАЦИЯ BOOTSTRAP КОМПОНЕНТОВ === */
.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--brand-primary-hover) !important;
    border-color: var(--brand-primary-hover) !important;
}

.btn-outline-primary {
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    font-weight: 600;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary.active {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}

.accordion-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md) !important;
    overflow: hidden;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.accordion-button:not(.collapsed) {
    background-color: var(--brand-soft);
    color: var(--brand-primary);
    font-weight: 600;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

/* === HERO-СЕКЦИЯ НА ГЛАВНОЙ === */
.hero-banner {
    background: linear-gradient(135deg, #0f172a 0%, #134e4a 60%, #0f766e 100%);
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.25rem;
    margin-bottom: 1.75rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.hero-banner::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(45, 212, 191, 0.22) 0%, transparent 70%);
    pointer-events: none;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ccfbf1;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    color: #cbd5e1;
    font-size: 1.02rem;
    max-width: 650px;
    margin-bottom: 1.5rem;
}

.quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 12px;
    margin-bottom: 2rem;
}

.quick-nav-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1rem 1.1rem;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.quick-nav-card:hover {
    transform: translateY(-2px);
    border-color: var(--brand-primary);
    box-shadow: var(--shadow-md);
    color: var(--brand-primary);
}

.quick-nav-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.quick-nav-title {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
}

.quick-nav-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* === КАРТОЧКИ И БЛОКИ КОНТЕНТА === */
.page-title {
    font-weight: 800;
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    color: var(--text-main);
    letter-spacing: -0.025em;
    line-height: 1.25;
    margin: 0 0 1.25rem;
}

.content {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    margin: 0 auto 1.5rem;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.highlight-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.highlight-section h5 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.highlight-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.highlight-section ul li {
    margin: 0;
}

.highlight-section ul li a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.94rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.7rem 0.95rem;
    border-radius: var(--radius-sm);
    background: #f8fafc;
    border: 1px solid var(--border-light);
    transition: all 0.18s ease;
}

.highlight-section ul li a i {
    color: var(--brand-primary);
    font-size: 1.05rem;
    flex-shrink: 0;
}

.highlight-section ul li a:hover {
    background: var(--brand-soft);
    border-color: #99f6e4;
    color: var(--brand-primary);
    transform: translateX(2px);
}

/* === СПИСОК ТЕМ ПРЕДМЕТА (math_all.php) === */
.materials-block {
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.topic-group {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.topic-group-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.topic-desc {
    display: block;
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.topics {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.topics li {
    margin: 0;
    padding: 0.85rem 1.1rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: all 0.18s ease;
}

.topics li:not(.topic-locked):hover {
    background-color: var(--brand-soft);
    border-color: #5eead4;
    transform: translateY(-1px);
}

.topics li a {
    text-decoration: none;
    color: var(--brand-primary);
    font-weight: 600;
    font-size: 0.98rem;
}

.topics li a:hover {
    text-decoration: underline;
}

.subtopic-desc {
    display: block;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 3px;
}

.topics li.topic-locked {
    background-color: #f8fafc;
    border-style: dashed;
    border-color: #cbd5e1;
    opacity: 0.8;
}

.topics li.topic-locked .topic-soon {
    color: #64748b;
    font-weight: 600;
    cursor: not-allowed;
}

.topic-soon-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 9px;
    border-radius: 999px;
    background-color: #e2e8f0;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 600;
}

.topic-soon-note {
    display: block;
    margin-top: 3px;
    font-size: 0.82rem;
    color: #94a3b8;
}

/* === ОФОРМЛЕНИЕ СТАТЕЙ И ТЕОРИИ === */
.repeat-section {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid #99f6e4;
    background: #f0fdfa;
    margin-top: 2rem;
}

.repeat-section h3 {
    color: var(--brand-primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.repeat-block {
    margin-top: 1.25rem;
    padding: 1.15rem 1.35rem;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--radius-sm);
}

.repeat-block h4 {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.error-block {
    margin-top: 1.25rem;
    padding: 1.15rem 1.35rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: var(--radius-sm);
}

.error-block h4 {
    color: #b91c1c;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.example-box {
    margin-top: 1.25rem;
    padding: 1.15rem 1.35rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: var(--radius-sm);
}

.example-box h5 {
    margin-bottom: 0.65rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #b45309;
}

.example-box .highlight {
    font-weight: 700;
    color: #dc2626;
}

.praktika {
    margin-top: 1.25rem;
    padding: 1.15rem 1.35rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-left: 4px solid #16a34a;
    border-radius: var(--radius-sm);
}

.avtor {
    display: flex;
    justify-content: flex-end;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding-top: 1rem;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-light);
}

/* === МОДАЛЬНЫЕ ОКНА === */
.modal-content {
    background-color: var(--bg-surface);
    color: var(--text-main);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border-light);
    padding: 1.1rem 1.5rem;
}

.modal-title {
    font-weight: 700;
    font-size: 1.15rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-light);
    background-color: #f8fafc;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 0.9rem 1.5rem;
}

/* === СТРАНИЦЫ ЮРИДИЧЕСКИХ ДОКУМЕНТОВ === */
.legal-doc h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.65rem;
    color: var(--text-main);
}
.legal-doc p, .legal-doc li {
    font-size: 0.96rem;
    line-height: 1.65;
    color: var(--text-secondary);
}

/* === ФУТЕР === */
.site-footer {
    background-color: #0f172a;
    color: #cbd5e1;
    margin-top: auto;
    border-top: 1px solid #1e293b;
}

.site-footer .footer-title {
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.85rem;
}

.site-footer .footer-text {
    color: #94a3b8;
    font-size: 0.875rem;
    line-height: 1.6;
}

.site-footer .footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}

.site-footer .footer-links li {
    margin-bottom: 0.5rem;
}

.site-footer .footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-footer .footer-links a:hover {
    color: #2dd4bf;
}

.site-footer .footer-bottom {
    border-top: 1px solid #1e293b;
    margin-top: 1.5rem;
    padding: 1rem 0;
    font-size: 0.82rem;
    color: #64748b;
    text-align: center;
}

/* === COOKIE ПЛАШКА === */
.cookie-notice {
    display: none;
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 520px;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(8px);
    color: #f8fafc;
    padding: 12px 16px;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    z-index: 1040;
}

.cookie-notice.show {
    display: flex;
}

.cookie-notice p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.4;
}

.cookie-notice .cookie-link {
    background: none;
    border: none;
    padding: 0;
    color: #5eead4;
    font-size: 12.5px;
    text-decoration: underline;
    cursor: pointer;
}

.cookie-notice .cookie-accept {
    flex-shrink: 0;
    background: var(--brand-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.cookie-notice .cookie-accept:hover {
    background: var(--brand-primary-hover);
}

/* === АДАПТИВ === */
.top-75 { top: 75% !important; }
.calc-notice { border-radius: var(--radius-md); }

@media (max-width: 768px) {
    .hero-banner {
        padding: 1.65rem 1.25rem;
        border-radius: var(--radius-md);
    }
    .content {
        padding: 1.15rem;
        border-radius: var(--radius-md);
    }
    .highlight-section ul {
        grid-template-columns: 1fr;
    }
}
