:root {
    --primary-color: #0d9488;
    --primary-hover: #0f766e;
    --bg-color: #f1f5f9;
    --bg-light-section: #e2e8f0;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --nav-bg: rgba(255, 255, 255, 0.92);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

body.dark-theme {
    --bg-color: #0f172a;
    --bg-light-section: #1e293b;
    --card-bg: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --input-bg: #0f172a;
    --input-border: #334155;
    --nav-bg: rgba(15, 23, 42, 0.92);
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: var(--font-family);
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-color);
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.text-center { text-align: center; }
.bg-light { background-color: var(--bg-light-section); padding: 72px 0; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.section-lead {
    text-align: center; color: var(--text-muted); max-width: 640px;
    margin: 0 auto 32px;
}
h2 { font-size: 2rem; margin-bottom: 12px; }

.navbar {
    position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
    padding: 14px 0; background: var(--nav-bg); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
}
.nav-content { display: flex; justify-content: space-between; align-items: center; gap: 12px; position: relative; }
.logo { font-size: 1.25rem; font-weight: 700; color: var(--text-color); text-decoration: none; }
.nav-links { list-style: none; display: flex; gap: 20px; align-items: center; }
.nav-links a { text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: 0.95rem; }
.nav-links a:hover { color: var(--primary-color); }
.nav-auth { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.locale-switch--landing {
    border-color: var(--border-color);
    background: var(--card-bg);
}
.locale-switch--landing .locale-switch-link { color: var(--text-muted); }
.locale-switch--landing .locale-switch-link:hover,
.locale-switch--landing .locale-switch-link.is-active {
    color: var(--primary-color);
    background: rgba(13, 148, 136, 0.12);
}
.btn-nav { padding: 6px 14px; font-size: 0.9rem; }
.nav-toggle {
    display: none; width: 42px; height: 42px; border: 1px solid var(--border-color);
    background: var(--card-bg); border-radius: 8px; cursor: pointer; flex-direction: column;
    justify-content: center; align-items: center; gap: 5px;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--text-color); }

.btn {
    padding: 12px 24px; border: none; border-radius: 6px; font-size: 1rem; font-weight: 600;
    cursor: pointer; text-decoration: none; display: inline-block; text-align: center;
    font-family: inherit;
}
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    pointer-events: none;
}
.btn-primary:disabled { background: var(--primary-color); }
.btn-outline { border: 2px solid var(--primary-color); color: var(--primary-color); background: transparent; }
.btn-outline:hover { background: var(--primary-color); color: #fff; }
.btn-light { background: #fff; color: var(--primary-color); }
.btn-light:hover { background: #f1f5f9; }
.full-width { width: 100%; }

.hero { padding: 132px 0 56px; }
.eyebrow { color: var(--primary-color); font-weight: 600; margin-bottom: 12px; letter-spacing: 0.02em; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-bottom: 16px; font-weight: 800; line-height: 1.2; }
.hero .subtitle { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 28px; max-width: 680px; margin-left: auto; margin-right: auto; }
.btn-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.grid-features, .grid-tariffs { display: grid; gap: 20px; margin-top: 28px; }
.card, .tariff-card, .config-controls, .form-container {
    border: 1px solid var(--border-color); padding: 28px 22px;
    border-radius: 12px; background: var(--card-bg); box-shadow: var(--card-shadow);
}
.card h3 { margin-bottom: 8px; }

.slider { margin: 0 auto 40px; max-width: 760px; }
.slider-viewport { overflow: hidden; border-radius: 12px; width: 100%; }
.slider-track { display: flex; width: 100%; transition: transform 0.35s ease; }
.slide { flex: 0 0 100%; width: 100%; max-width: 100%; padding: 0; }
.slide-caption { text-align: center; margin-top: 12px; color: var(--text-muted); font-size: 0.95rem; }
.slider-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.slider-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-color);
    background: var(--card-bg); color: var(--text-color); cursor: pointer; font-size: 1.3rem;
}
.slider-dots { display: flex; gap: 8px; }
.slider-dots button {
    width: 10px; height: 10px; border-radius: 50%; border: 0; background: var(--border-color); cursor: pointer;
}
.slider-dots button.is-active { background: var(--primary-color); }

.crm-mock {
    background: #e8eef2; color: #1a2332; border-radius: 12px; overflow: hidden;
    border: 1px solid #c5d0da; font-size: 0.85rem;
}
body.dark-theme .crm-mock { background: #1a222c; color: #e8eef2; border-color: #2c3a48; }
.crm-bar {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    padding: 10px 14px; background: #0f6e56; color: #fff; font-weight: 600; font-size: 0.8rem;
}
.crm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px; }
.crm-stats div { background: #fff; border-radius: 8px; padding: 10px; }
body.dark-theme .crm-stats div { background: #141b24; }
.crm-stats small { display: block; color: #5a6a7a; font-size: 0.75rem; }
.crm-stats b { font-size: 1.1rem; }
.crm-table { width: 100%; border-collapse: collapse; display: table; }
.crm-table th, .crm-table td { text-align: left; padding: 8px 14px; border-top: 1px solid #c5d0da; }
body.dark-theme .crm-table th, body.dark-theme .crm-table td { border-color: #2c3a48; }

.modules-title { margin: 40px 0 16px; font-size: 1.25rem; }
.module-pills {
    display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
    list-style: none; padding: 0; margin: 0;
}
.module-pills li {
    border: 1px solid var(--border-color); background: var(--card-bg); border-radius: 999px;
    padding: 8px 14px; font-size: 0.92rem; font-weight: 500;
}

.tariff-card {
    display: flex; flex-direction: column; text-align: center; cursor: pointer;
    color: inherit; font: inherit; width: 100%; position: relative;
}
a.tariff-card { text-decoration: none; }
.tariff-card:hover, .tariff-card:focus-within { transform: translateY(-2px); border-color: var(--primary-color); }
.tariff-card.highlighted { border: 2px solid var(--primary-color); position: relative; }
.tariff-card.highlighted::before {
    content: 'Рекомендовано'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--primary-color); color: #fff; padding: 3px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 700; white-space: nowrap; z-index: 2;
}
.tariff-audience { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 4px; }
.tariff-card .price { font-size: 1.8rem; font-weight: 800; margin: 10px 0; }
.tariff-card .price span { font-size: 0.85rem; color: var(--text-muted); font-weight: normal; }
.tariff-card ul { list-style: none; text-align: left; margin-top: 12px; flex-grow: 1; }
.tariff-card ul li { margin-bottom: 8px; padding-left: 22px; position: relative; color: var(--text-muted); font-size: 0.92rem; }
.tariff-card ul li::before { content: '✓'; position: absolute; left: 0; color: var(--primary-color); font-weight: bold; }

.tariff-actions {
    display: flex; flex-direction: column; gap: 8px; margin-top: 14px;
    opacity: 0; max-height: 0; overflow: hidden; pointer-events: none;
    transition: opacity 0.2s ease, max-height 0.2s ease, margin 0.2s ease;
}
.tariff-card:hover .tariff-actions,
.tariff-card:focus-within .tariff-actions {
    opacity: 1; max-height: 120px; pointer-events: auto; margin-top: 14px;
}
.tariff-actions .btn { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 12px; font-size: 0.85rem; }
.btn-secondary {
    background: transparent; color: var(--primary-color);
    border: 1px solid var(--primary-color);
}
.btn-secondary:hover { background: rgba(20, 145, 130, 0.08); }

.tariff-modal[hidden] { display: none !important; }
.tariff-modal {
    position: fixed; inset: 0; z-index: 1200;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.tariff-modal-backdrop {
    position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45);
}
.tariff-modal-dialog {
    position: relative; z-index: 1; width: min(480px, 100%);
    background: var(--card-bg); border-radius: 14px; padding: 28px 24px 22px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2); text-align: center;
    max-height: min(90vh, 720px); overflow: auto;
}
.tariff-modal-close {
    position: absolute; top: 10px; right: 12px; border: 0; background: transparent;
    font-size: 1.6rem; line-height: 1; color: var(--text-muted); cursor: pointer;
    width: 36px; height: 36px; border-radius: 8px;
}
.tariff-modal-close:hover { background: var(--bg-light-section); color: var(--text-color); }
.tariff-modal-dialog .price { font-size: 1.8rem; font-weight: 800; margin: 10px 0; }
.tariff-modal-dialog .price span { font-size: 0.85rem; color: var(--text-muted); font-weight: normal; }
.tariff-modal-dialog ul {
    list-style: none; text-align: left; margin: 16px 0;
    padding: 14px 0; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
}
.tariff-modal-dialog ul li {
    margin-bottom: 8px; padding-left: 22px; position: relative;
    color: var(--text-muted); font-size: 0.95rem;
}
.tariff-modal-dialog ul li:last-child { margin-bottom: 0; }
.tariff-modal-dialog ul li::before {
    content: '✓'; position: absolute; left: 0; color: var(--primary-color); font-weight: bold;
}
.tariff-modal-desc { color: var(--text-muted); font-size: 0.95rem; text-align: left; margin: 0 0 18px; }
.tariff-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.tariff-modal-actions .btn { flex: 1 1 160px; justify-content: center; text-decoration: none; }
.tariff-modal-note {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.45;
    text-align: center;
    text-wrap: pretty;
}
.tariff-modal-note a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.tariff-modal-note a:hover { text-decoration: underline; }
body.tariff-modal-open { overflow: hidden; }

@media (hover: none) {
    .tariff-actions {
        opacity: 1; max-height: none; pointer-events: auto; margin-top: 14px;
    }
}

.config-wrapper { display: grid; gap: 24px; margin-top: 24px; align-items: start; }
.form-group, .modules-group { margin-bottom: 18px; }
.form-group > label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; font-size: 0.95rem; }
.group-label { display: block; font-weight: 600; margin-bottom: 10px; }
.hint { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }
.number-input { width: 75px !important; padding: 6px 8px !important; text-align: center; font-weight: 700; }

.biz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.biz-card {
    display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--border-color);
    border-radius: 8px; padding: 12px; cursor: pointer; color: var(--text-muted); font-size: 0.9rem;
    text-align: left; justify-content: flex-start;
}
.biz-card span { flex: 1; }
.biz-card:has(input:checked) { border-color: var(--primary-color); color: var(--text-color); }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"], select, textarea {
    width: 100%; padding: 12px 14px; border: 1px solid var(--input-border);
    border-radius: 6px; font-size: 0.95rem; background-color: var(--input-bg);
    color: var(--text-color); font-family: var(--font-family);
}
textarea { resize: vertical; min-height: 96px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-color); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; background: var(--border-color); border-radius: 3px; outline: none; margin: 10px 0; }
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 20px; height: 20px; background: var(--primary-color);
    border-radius: 50%; cursor: pointer; border: 3px solid var(--card-bg);
}

.checkbox-label, .radio-label { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; cursor: pointer; color: var(--text-muted); font-size: 0.95rem; }
.checkbox-label input, .radio-label input, .biz-card input { width: 18px; height: 18px; accent-color: var(--primary-color); flex-shrink: 0; }
.period-toggle { display: flex; gap: 20px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border-color); }

.config-result {
    background: var(--primary-color); color: #fff; padding: 28px;
    border-radius: 12px; text-align: center; position: sticky; top: 88px;
}
.price-display { font-size: 2.6rem; font-weight: 800; margin: 8px 0 0; }
.price-year { opacity: 0.9; margin-bottom: 8px; }
.result-details { list-style: none; text-align: left; margin: 16px 0; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.2); }
.result-details li { margin-bottom: 6px; font-size: 0.95rem; }

.form-container { max-width: 480px; margin: 24px auto 0; }
.form-container--compact {
    padding: 20px 22px;
    display: grid;
    gap: 14px;
    justify-items: stretch;
}
.logged-in-note {
    margin: 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.98rem;
}
.form-container form, .support-form { display: grid; gap: 14px; width: 100%; }
.form-container form > *,
.support-form > * { width: 100%; min-width: 0; max-width: 100%; }
.form-container .field-label {
    display: grid;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
}
.form-container .plan-hint {
    margin: -6px 0 0;
    text-align: left;
}
.form-container select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1.4 0.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}
.config-chip {
    background: var(--bg-light-section);
    border: 1px solid var(--primary-color); border-radius: 8px; padding: 10px 12px;
    font-size: 0.9rem; margin-bottom: 12px;
}
.alert {
    padding: 14px; background: #ccfbf1; color: #115e59; border-radius: 6px;
    text-align: center; margin-bottom: 14px;
}
.alert-error { background: #fee2e2; color: #991b1b; }
body.dark-theme .alert { background: #134e4a; color: #ccfbf1; }
body.dark-theme .alert-error { background: #7f1d1d; color: #fecaca; }
.auth-switch { margin: 16px 0 0; font-size: 0.95rem; color: var(--text-muted); text-align: center; }
.auth-switch a { color: var(--primary-color); font-weight: 600; text-decoration: none; }
.recaptcha-note {
    margin: 14px 0 0;
    font-size: 0.75rem;
    line-height: 1.55;
    text-align: center;
    color: var(--text-muted);
}
.recaptcha-note a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
}
.recaptcha-note a:hover { color: var(--primary-color); }

.support-grid { display: grid; gap: 20px; align-items: start; }
.contact-card .contact-list {
    list-style: none; padding: 0; margin: 12px 0 20px; display: grid; gap: 12px;
}
.contact-card .contact-list li {
    display: grid; grid-template-columns: 7.5rem 1fr; gap: 8px; align-items: baseline;
    color: var(--text-muted); font-size: 0.95rem;
}
.contact-card .contact-list span { font-weight: 600; color: var(--text-color); }
.contact-card .contact-list a { color: var(--primary-color); font-weight: 600; text-decoration: none; word-break: break-all; }
.contact-card .contact-list a:hover { text-decoration: underline; }
.contact-card .btn { width: 100%; }
.faq { max-width: 720px; margin: 0 auto; }
.faq details {
    border: 1px solid var(--border-color); background: var(--card-bg); border-radius: 10px;
    padding: 14px 16px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin-top: 8px; color: var(--text-muted); }
.docs-note { margin-top: 24px; }

/* Публічні юридичні сторінки (/terms, /refund-policy, /public-offer) */
.legal-nav .nav-content { justify-content: space-between; }
.legal-nav-actions {
    display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center;
}
.legal-nav-actions a {
    color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.95rem;
}
.legal-nav-actions a:hover { color: var(--primary-color); }
.legal-page {
    padding: 110px 0 48px;
    min-height: 60vh;
}
.legal-article {
    max-width: 1000px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 32px 28px 40px;
}
.legal-article h1 {
    font-size: clamp(1.55rem, 2.4vw, 2rem);
    line-height: 1.25;
    margin: 0 0 16px;
    color: var(--text-color);
}
.legal-article h2 {
    font-size: 1.2rem;
    margin: 28px 0 12px;
    color: var(--text-color);
}
.legal-article p,
.legal-article li {
    color: var(--text-color);
    font-size: 1.02rem;
    line-height: 1.7;
}
.legal-article p { margin: 0 0 12px; }
.legal-article ul,
.legal-article ol {
    margin: 0 0 14px 1.25rem;
    display: grid;
    gap: 8px;
}
.legal-article a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}
.legal-article a:hover { text-decoration: underline; }
.legal-footer {
    padding: 28px 0 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}
.legal-footer a {
    color: var(--text-muted);
    text-decoration: none;
}
.legal-footer a:hover { color: var(--primary-color); }
@media (max-width: 767px) {
    .legal-page { padding: 96px 0 32px; }
    .legal-article { padding: 24px 18px 32px; border-radius: 10px; }
}

footer { padding: 36px 0 24px; border-top: 1px solid var(--border-color); margin-top: 24px; color: var(--text-muted); font-size: 0.9rem; }
.footer-grid { display: grid; gap: 24px; margin-bottom: 24px; }
.footer-grid p { margin: 0 0 8px; }
.footer-grid a { color: var(--text-muted); text-decoration: none; }
.footer-grid a:hover { color: var(--primary-color); }
.footer-grid .logo { color: var(--text-color); margin-bottom: 8px; }

@media (min-width: 768px) {
    .grid-features { grid-template-columns: repeat(2, 1fr); }
    .config-wrapper { grid-template-columns: 3fr 2fr; }
    .support-grid { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
@media (min-width: 1024px) {
    .grid-features { grid-template-columns: repeat(4, 1fr); }
    .grid-tariffs { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; }
    .nav-links {
        display: none; position: absolute; top: calc(100% + 14px); left: -20px; right: -20px;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--nav-bg); border-bottom: 1px solid var(--border-color);
        padding: 8px 20px 16px;
    }
    .nav-links.is-open { display: flex; }
    .nav-links a { display: block; padding: 12px 0; }
}
@media (max-width: 767px) {
    .hero { padding: 110px 0 40px; }
    .btn-group { flex-direction: column; }
    .config-result { position: relative; top: 0; }
    .biz-grid { grid-template-columns: 1fr; }
    .crm-stats { grid-template-columns: 1fr; }
    .contact-card .contact-list li { grid-template-columns: 1fr; gap: 2px; }
}
