/* Сайт «Калимы». Палитра — как в приложении (src/styles.css). */
@font-face { font-family: 'Amiri'; font-weight: 400; font-display: swap; src: url('/fonts/amiri-arabic-400-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: 'Amiri'; font-weight: 700; font-display: swap; src: url('/fonts/amiri-arabic-700-normal.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF; }

:root {
  --bg: #ece5d6; --panel: #faf6ee; --panel-2: #f3ecdf; --paper: #fffcf4; --ink: #2a241a; --muted: #6f6355; --line: #e0d5c1;
  --accent: #1f6a52; --accent-hover: #185a45; --accent-ink: #fff; --accent-soft: #dcebe3; --gold: #9a6f1f; --gold-soft: #f4e5c4;
  --danger: #b0442e; --danger-soft: #f6dfd8; --ok-soft: #dcebe3; --info-soft: #f4e5c4;
  --shadow: 0 1px 2px rgba(60, 40, 10, .08), 0 8px 28px rgba(60, 40, 10, .09);
  --radius: 14px;
  --ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', Arial, sans-serif;
  --ar: 'Amiri', 'Traditional Arabic', serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131619; --panel: #1b1f22; --panel-2: #22272b; --paper: #1f2327; --ink: #e9e3d6; --muted: #a39b8c; --line: #30363b;
    --accent: #4fb48e; --accent-hover: #63c49f; --accent-ink: #0d1512; --accent-soft: #1f3a31; --gold: #d7a64a; --gold-soft: #3a3020;
    --danger: #e0705a; --danger-soft: #3a211b; --ok-soft: #1f3a31; --info-soft: #3a3020;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 26px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--ui); }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 5vw, 48px); }
h2 { font-size: clamp(24px, 3.4vw, 32px); }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
[lang='ar'] { font-family: var(--ar); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.section { padding-top: 48px; padding-bottom: 48px; } /* боковые отступы даёт .wrap */
main.wrap > .section:first-child { padding-top: 40px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.lead { font-size: 19px; color: var(--ink); opacity: .92; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--panel); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
mark.todo { background: #ffe58a; color: #3a2c00; padding: 0 4px; border-radius: 4px; }

/* ---------- шапка ---------- */
.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand img { border-radius: 9px; }
.brand-name { font-weight: 800; font-size: 20px; }
.brand-ar { font-family: var(--ar); font-size: 24px; color: var(--accent); line-height: 1; padding-top: 4px; }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--ink); padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a[aria-current='page'] { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 760px) {
  .top-row { gap: 8px; padding-top: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; justify-content: space-between; gap: 0; margin: 0 -6px; width: calc(100% + 12px); }
  .nav a { padding: 6px 4px; white-space: nowrap; font-size: 14px; }
}

/* ---------- кнопки и формы ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 600 16px/1.2 var(--ui); text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; }
.btn:hover { background: var(--panel-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.btn.primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.stack { display: grid; gap: 16px; }
label { display: grid; gap: 6px; font-weight: 600; }
.input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); font: 18px var(--ui); }
.input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); border-color: var(--accent); }
.input.code { letter-spacing: .4em; font-size: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.row-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.inline { display: inline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.alert { padding: 12px 16px; border-radius: 12px; margin: 0 0 20px; border: 1px solid transparent; }
.alert.error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.alert.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.alert.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }

/* ---------- карточки ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.form-card { max-width: 480px; margin: 40px auto; }
.web-card { display: grid; gap: 16px; align-items: center; margin-bottom: 20px; border: 2px solid var(--accent); }
.web-card p { margin-bottom: .5em; }
@media (min-width: 760px) { .web-card { grid-template-columns: 1fr auto; } }
.grid2, .grid3 { display: grid; gap: 20px; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } }
.feature-ar { font-family: var(--ar); font-size: 34px; color: var(--accent); line-height: 1.3; margin-bottom: 8px; text-align: left; }
.feature p { margin: 0; color: var(--muted); }

/* ---------- главная ---------- */
.hero { display: grid; gap: 32px; align-items: center; padding: 48px 16px 24px; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr .9fr; padding-top: 72px; } }
.hero h1 { margin-bottom: .4em; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 12px; }
.hero-shots { position: relative; display: flex; justify-content: center; min-height: 300px; }
.phone { margin: 0; width: min(300px, 70vw); border-radius: 36px; overflow: hidden; border: 8px solid #1d1d1f; background: #1d1d1f; box-shadow: 0 30px 60px rgba(40, 30, 10, .25); }
.phone img { display: block; width: 100%; }
.hero-shots .phone:first-child { position: relative; z-index: 2; }
.hero-shots .phone.back { position: absolute; transform: translate(42%, 8%) rotate(5deg) scale(.88); opacity: .95; z-index: 1; }
@media (max-width: 899px) { .hero-shots .phone.back { display: none; } }
.split { display: grid; gap: 32px; align-items: center; }
.split .phone { justify-self: center; width: min(280px, 70vw); }
@media (min-width: 900px) { .split { grid-template-columns: .8fr 1.2fr; } .split.reverse .phone { order: 2; } }

.plus-band { display: grid; gap: 24px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #0d2b22)); color: #fff; border-radius: 22px; padding: 32px; box-shadow: var(--shadow); }
.plus-band .eyebrow { color: #f4e5c4; }
.plus-band .btn.primary { background: #fff; color: var(--accent); border-color: #fff; box-shadow: none; }
.plus-band .muted, .plus-band .checks .muted { color: rgba(255, 255, 255, .8); }
.plus-band .checks li::before { color: #f4e5c4; }
@media (prefers-color-scheme: dark) { .plus-band { color: #0d1512; } .plus-band .muted, .plus-band .checks .muted { color: rgba(13, 21, 18, .75); } .plus-band .eyebrow { color: #3a3020; } .plus-band .checks li::before { color: #0d1512; } .plus-band .btn.primary { background: #0d1512; color: #4fb48e; border-color: #0d1512; } }
@media (min-width: 900px) { .plus-band { grid-template-columns: 1fr 1fr; padding: 44px; } }

.checks { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 28px; }
.checks li::before { content: '✓'; position: absolute; left: 0; top: 0; font-weight: 800; color: var(--accent); }
.soon { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 1px 8px; border-radius: 99px; background: var(--gold-soft); color: var(--gold); vertical-align: 2px; }
.plus-band .soon { background: rgba(255, 255, 255, .2); color: #fff; }
@media (prefers-color-scheme: dark) { .plus-band .soon { background: rgba(0, 0, 0, .2); color: #0d1512; } }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
details summary { cursor: pointer; font-weight: 600; list-style-position: outside; }
details[open] summary { margin-bottom: 8px; }
details p { margin: 0 0 8px; color: var(--muted); }

/* ---------- цены ---------- */
.prices { display: grid; gap: 20px; margin: 28px 0 20px; align-items: start; }
@media (min-width: 900px) { .prices { grid-template-columns: .8fr 1.2fr; } }
.price .amount { font-size: 34px; font-weight: 800; margin: 4px 0 16px; }
.price.plus { border: 2px solid var(--accent); }
.plans { display: grid; gap: 16px; }
@media (min-width: 640px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--paper); display: grid; gap: 4px; align-content: start; }
.plan.best { border-color: var(--gold); }
.plan-name { font-weight: 700; }
.plan .amount { font-size: 28px; margin: 0 0 8px; }
.per { display: block; font-size: 14px; font-weight: 500; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--gold-soft); color: var(--gold); vertical-align: 2px; }
.buy { display: grid; gap: 12px; }
.buy .check { font-size: 14px; line-height: 1.45; }

/* ---------- кабинет ---------- */
.status { font-size: 18px; }
.status.ok { color: var(--accent); }
.table-wrap { overflow-x: auto; margin-bottom: 24px; }
.pays { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: 12px; overflow: hidden; font-size: 15px; }
.pays th, .pays td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.pays th { font-weight: 600; color: var(--muted); background: var(--panel-2); }
.pays .num { text-align: right; font-variant-numeric: tabular-nums; }
.st.succeeded { color: var(--accent); }
.st.canceled { color: var(--danger); }
.danger-zone { display: grid; gap: 12px; justify-items: start; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.danger-zone details { border: 0; padding: 0; max-width: 560px; }
.danger-zone summary { color: var(--danger); }
.steps { padding-left: 22px; }
.steps li { margin-bottom: 8px; }

/* ---------- библиотека ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.section-head a { font-weight: 600; }
.lib-grid { margin: 24px 0; }
.lib-card { display: flex; flex-direction: column; gap: 6px; }
.lib-card h3 { margin: 0; font-size: 21px; }
.lib-card h3 a { color: var(--ink); text-decoration: none; }
.lib-card h3 a:hover { color: var(--accent); text-decoration: underline; }
.lib-card-ar { font-family: var(--ar); font-size: 26px; line-height: 1.5; color: var(--accent); text-align: right; }
.lib-author { margin: 0; }
.ar-name { font-family: var(--ar); font-size: 1.15em; white-space: nowrap; }
.lib-desc { margin: 4px 0 14px; }
.lib-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.tag { font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
.lib-how { margin: 8px 0 20px; }
.lib-how h2 { font-size: 22px; }
.lib-how .steps { margin: 0; }
.crumbs { margin-bottom: 20px; color: var(--muted); }
.lib-title-ar { font-family: var(--ar); font-size: clamp(30px, 6vw, 44px); line-height: 1.5; color: var(--accent); text-align: right; margin-bottom: 4px; }
.lib-book h1 { margin-bottom: .2em; }
.lib-sub { font-size: 19px; color: var(--muted); margin-bottom: .4em; }
.lib-book h2 { font-size: 24px; margin-top: 1.6em; }
.lib-toc { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.lib-toc li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lib-toc .ar { font-family: var(--ar); font-size: 21px; line-height: 1.5; margin-left: auto; text-align: right; }
.lib-excerpt { position: relative; max-height: 440px; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; font-family: var(--ar); font-size: 24px; line-height: 2; }
.lib-excerpt::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 96px; background: linear-gradient(color-mix(in srgb, var(--paper) 0%, transparent), var(--paper)); }
.lib-excerpt p { margin: 0 0 .4em; }
.center { text-align: center; margin-top: 20px; }

/* ---------- документы ---------- */
.legal h2 { font-size: 21px; margin-top: 1.6em; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 22px; }

/* ---------- подвал ---------- */
.foot { margin-top: 48px; padding: 36px 0 28px; border-top: 1px solid var(--line); background: var(--panel-2); }
.foot-grid { display: grid; gap: 24px; }
@media (min-width: 760px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot-grid a { display: block; color: var(--ink); text-decoration: none; padding: 3px 0; }
.foot-grid a:hover { color: var(--accent); text-decoration: underline; }
.foot-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 8px; }
.foot-brand img { border-radius: 7px; }
.foot-h { font-weight: 700; margin-bottom: 6px; }
.foot-req { margin-top: 24px; }
