/* ============================================================
   doc-page.css — текстовые страницы (about.html, terms.html).
   Только семантические токены из variables.css: цвета берутся из
   палитры, выбранной в ЛК (theme-boot.js ставит переменные на <html>),
   светлые и тёмные темы работают без отдельных night-правил.
   ============================================================ */

* { box-sizing: border-box; }

/* Язык: виден только блок языка, выбранного на сайте (см. js/doc-lang.js) */
[data-lang] { display: none; }
html[lang="ru"] [data-lang="ru"],
html[lang="en"] [data-lang="en"],
html[lang="ar"] [data-lang="ar"] { display: revert; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-1);
    font-family: var(--font-primary);
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
html[dir="rtl"] body {
    font-family: var(--font-arabic-display);
    font-size: 17px;
    line-height: 1.85;
}

/* ── Шапка — как у модулей (эталон Ифта: css/ifta/ifta-header.css) ── */
.doc-header {
    padding: 13px 20px;
    background: var(--surface-1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 100;
}
.doc-header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 16px;
}
.doc-header-left { display: flex; align-items: center; }
.doc-title {
    font-family: var(--font-arabic-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    direction: rtl;
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition-fast);
}
.doc-title:hover { color: var(--emerald-dark); }
.doc-header-center { display: flex; justify-content: center; align-items: center; }
.doc-header-right { display: flex; justify-content: flex-end; }
.doc-back {
    color: var(--text-2);
    text-decoration: none;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: color var(--transition-fast);
}
.doc-back:hover { color: var(--accent); }

/* ── Текст ─────────────────────────────────────────────── */
.wrap { flex: 1 0 auto; padding: 28px 40px 64px; }

header.doc {
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 18px;
    margin-bottom: 8px;
}
h1 { font-size: var(--text-xl); line-height: 1.25; margin: 0 0 6px; color: var(--text-1); }
h2 { font-size: 1.1rem; margin: 30px 0 8px; color: var(--accent); }
.sub { color: var(--text-2); font-size: 0.95rem; }
.ar { font-family: var(--font-arabic-display); font-size: 1.1em; }
p, li { color: var(--text-1); }
ul { padding-inline-start: 22px; }
li { margin: 6px 0; }
a { color: var(--accent); }
code {
    background: var(--surface-2);
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 0.9em;
}

.lead {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-inline-start: 4px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin: 18px 0;
    box-shadow: var(--shadow-sm);
}



/* ── Подвал — как у модулей (css/global.css .module-footer) ── */
.module-footer {
    background: #1f2937;
    padding: 32px 24px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
}
.night-mode .module-footer { background: #0f172a; }
.module-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 0 16px;
}
.module-footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.module-footer-link {
    font-size: 13px;
    color: var(--emerald-light, #6ee7b7);
    text-decoration: none;
    transition: color 0.15s;
}
.module-footer-link:hover { color: var(--gold-light, #fde68a); }

/* ── Гармошки разделов (about) ─────────────────────────── */
details {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin: 8px 0;
    padding: 0 16px;
    transition: border-color var(--transition-fast);
}
details:hover, details[open] { border-color: var(--border-strong); }
details[open] { padding-bottom: 12px; }
summary {
    cursor: pointer;
    padding: 12px 0;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
details[open] summary::after { content: "−"; }
summary:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: 4px; }
details p { margin: 4px 0 10px; }
.howto { color: var(--text-2); font-size: 0.95em; }
.go { font-size: 0.95em; }

/* ── Контакты (about) ──────────────────────────────────── */
table.contacts { width: 100%; border-collapse: collapse; margin: 12px 0; }
table.contacts td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: top;
}
table.contacts td:first-child { white-space: nowrap; width: 1%; }
table.contacts a { unicode-bidi: isolate; direction: ltr; }

.cta {
    display: inline-block;
    margin-top: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    background: var(--accent);
    color: var(--on-accent);
    text-decoration: none;
    font-weight: 600;
    box-shadow: var(--accent-glow);
    transition: background var(--transition-fast);
}
.cta:hover { background: var(--emerald-dark); }
.cta:focus-visible { outline: none; box-shadow: var(--focus-ring); }

@media (max-width: 700px) {
    .doc-header { padding: 10px 12px; }
    .doc-header-inner { padding: 0 4px; }
    .doc-title { font-size: 22px; }
    .wrap { padding: 22px 16px 56px; }
    .module-footer { padding: 24px 16px; }
    .module-footer-inner { flex-direction: column; text-align: center; gap: 16px; }
    .module-footer-links { gap: 12px 16px; }
    table.contacts, table.contacts tbody, table.contacts tr, table.contacts td { display: block; width: auto; }
    table.contacts tr { border-bottom: 1px solid var(--border-subtle); padding: 8px 0; }
    table.contacts td { border: 0; padding: 2px 0; }
}

/* ── Тарифы (/pricing): карточки планов ── */
.pricing .plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 22px 0 10px; }
.pricing .plan { display: flex; flex-direction: column; padding: 16px; border-radius: 12px; border: 1px solid var(--border-subtle, #e5e7eb); background: var(--white, #fff); }
.pricing .plan-hl { border-color: var(--emerald, #059669); box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald, #059669) 14%, transparent); }
.pricing .plan-name { font-weight: 700; font-size: 1.05rem; color: var(--dark-gray, #1f2937); }
.pricing .plan-price { font-weight: 700; font-size: 1.6rem; margin: 4px 0 10px; color: var(--emerald-dark, #047857); }
.pricing .plan-price small { font-size: 0.8rem; font-weight: 500; color: var(--medium-gray, #6b7280); margin-inline-start: 2px; }
.pricing .plan ul { margin: 0; padding-inline-start: 18px; font-size: 0.92rem; line-height: 1.5; }
.pricing .plan li { margin: 0 0 6px; }
