/* ИИ — это просто. Крупно, контрастно, спокойно. */
:root {
  --bg: #fbf7f0;
  --paper: #ffffff;
  --ink: #1d1a16;
  --ink-2: #4a443c;
  --line: #e4dccf;
  --brand: #1d5c4f;
  --brand-2: #164a3f;
  --brand-soft: #e3efe9;
  --accent: #c8572b;
  --accent-soft: #fbe9df;
  --warn: #9c2f1c;
  --warn-soft: #fde8e3;
  --radius: 18px;
  --lesson-scale: 1;
  font-size: 20px;
}
@media (min-width: 900px) { :root { font-size: 21px; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "PT Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6; -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { font-family: Georgia, "PT Serif", "Times New Roman", serif; line-height: 1.2; font-weight: 700; color: var(--ink); }
h1 { font-size: 2.1rem; margin: .2em 0 .5em; }
h2 { font-size: 1.55rem; margin: 1.6em 0 .6em; }
h3 { font-size: 1.15rem; margin: .4em 0 .3em; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-2); }
:focus-visible { outline: 4px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 800px; }
.center { text-align: center; }
.small { font-size: .88rem; color: var(--ink-2); }
.muted { color: var(--ink-2); font-size: .85rem; }
.mono { font-family: Consolas, "Courier New", monospace; word-break: break-all; }
.lead { font-size: 1.15rem; color: var(--ink-2); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--accent); margin-bottom: .3em; }
section { padding: 56px 0; }
.band { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 10px; top: 10px; background: #fff; padding: 10px; z-index: 10; }

/* Шапка */
.top { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 72px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-family: Georgia, serif; font-weight: 700; font-size: 1.15rem; }
.logo-mark { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1.3rem; }
.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a { padding: 10px 14px; border-radius: 12px; text-decoration: none; font-weight: 700; color: var(--ink); }
.nav a:hover { background: var(--brand-soft); }
.nav .nav-btn { background: var(--brand); color: #fff; }
.nav .nav-btn:hover { background: var(--brand-2); color: #fff; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 64px; padding: 14px 30px;
  border-radius: 16px; font-size: 1.1rem; font-weight: 700; text-decoration: none; border: 3px solid transparent;
  cursor: pointer; font-family: inherit; line-height: 1.2; text-align: center; }
.btn-main { background: var(--accent); color: #fff; box-shadow: 0 4px 0 #8f3a19; }
.btn-main:hover { background: #b34a21; color: #fff; }
.btn-main:active { transform: translateY(3px); box-shadow: 0 1px 0 #8f3a19; }
.btn-ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.cta-row, .btns { display: flex; gap: 14px; flex-wrap: wrap; margin: 1.2em 0 .8em; }

/* Главный экран */
.hero { padding: 56px 0 64px; }
.hero-in { display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 2.45rem; }
@media (max-width: 900px) { .hero-in { grid-template-columns: 1fr; } .hero h1 { font-size: 1.9rem; } }

.hero-chat, .chat { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 0 10px 30px rgba(60, 40, 10, .08); }
.chat { margin: 1.2em 0 1.5em; box-shadow: none; }
.chat-head { font-weight: 700; color: var(--ink-2); font-size: .9rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.chat-head .dot { width: 12px; height: 12px; background: var(--accent); border-radius: 50%; display: inline-block; }
.msg { padding: 14px 16px; border-radius: 16px; margin: 10px 0; font-size: .98rem; }
.msg.you { background: var(--brand-soft); margin-left: 12%; }
.msg.ai { background: #f5f1ea; margin-right: 6%; }
.msg b { display: block; font-size: .82rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }

/* Карточки */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card-ico { font-size: 2rem; }
.card p { color: var(--ink-2); margin: 0; }
.checks { list-style: none; padding: 0; margin: 0 0 1.4em; }
.checks li { padding: 10px 0 10px 48px; position: relative; font-size: 1.08rem; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 8px; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; }
.note-box { background: var(--accent-soft); border-left: 6px solid var(--accent); padding: 18px 22px; border-radius: 12px; }
.note-box p:last-child { margin: 0; }

.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.steps li { display: flex; gap: 16px; }
.step-n { flex: 0 0 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1.5rem; font-weight: 700; font-family: Georgia, serif; }
.steps p { color: var(--ink-2); }

/* Программа */
.program { list-style: none; padding: 0; margin: 1em 0; display: grid; gap: 10px; }
.program a { display: flex; align-items: center; gap: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; text-decoration: none; color: var(--ink); }
.program a:hover { border-color: var(--brand); }
.pnum { flex: 0 0 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 1.15rem; }
.ptext { flex: 1; display: flex; flex-direction: column; }
.ptext span { color: var(--ink-2); font-size: .92rem; }
.badge { flex: 0 0 auto; font-size: .8rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: #f0ebe2; color: var(--ink-2); white-space: nowrap; }
.badge.free { background: var(--brand); color: #fff; }
@media (max-width: 640px) { .program a { flex-wrap: wrap; } .badge { margin-left: 66px; } }

/* Тарифы */
.plans { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 1.5em 0; align-items: stretch; }
@media (max-width: 1080px) { .plans { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.plan { background: var(--bg); border: 2px solid var(--line); border-radius: 20px; padding: 26px 14px 20px; text-align: center; display: flex; flex-direction: column; position: relative; }
.plan h3 { margin-top: 6px; }
.plan .btn { margin-top: auto; width: 100%; }
.price { font-size: 1.8rem; white-space: nowrap; font-weight: 700; font-family: Georgia, serif; margin: .2em 0 0; }
.price.big { font-size: 2.4rem; color: var(--accent); }
.per { color: var(--ink-2); font-size: .9rem; min-height: 2.6em; }
.plan-hit { border-color: var(--accent); background: #fff; }
.plan-forever { border-color: var(--brand); background: #fff; }
.plan-flag { position: absolute; top: -15px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.plan-flag.flag-dark { background: var(--brand); }

/* Вопросы */
details { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; padding: 0 20px; }
summary { cursor: pointer; font-weight: 700; padding: 18px 0; font-size: 1.05rem; list-style-position: inside; }
details p { color: var(--ink-2); }
.final { background: var(--brand); color: #fff; }
.final h2, .final .lead { color: #fff; }

/* Формы */
.form { display: flex; flex-direction: column; gap: 10px; margin: 1em 0; }
.form label { font-weight: 700; font-size: 1.05rem; }
.form .hint { margin: 0; color: var(--ink-2); font-size: .9rem; }
input[type=email], input[type=text], .form input:not([type]), .admin-form input, .admin-form select {
  font-size: 1.15rem; padding: 16px 18px; border: 2px solid #b9ad9a; border-radius: 14px; background: #fff; font-family: inherit; width: 100%; }
input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-soft); }
.code-input { font-family: Consolas, monospace; letter-spacing: .12em; text-transform: uppercase; }
.check { display: flex; gap: 12px; align-items: center; font-weight: 400 !important; }
.check input { width: 28px; height: 28px; }
.error { background: var(--warn-soft); color: var(--warn); padding: 14px 18px; border-radius: 12px; font-weight: 700; }
.form .btn { align-self: flex-start; margin-top: 8px; }
.form .btn + .btn { margin-top: 0; }
#pay { align-items: center; }
#pay .btn { align-self: center; min-width: 320px; }
.code { font-family: Consolas, "Courier New", monospace; font-size: 2.2rem; font-weight: 700; letter-spacing: .14em; background: #fff; border: 3px dashed var(--brand); padding: 18px; border-radius: 16px; text-align: center; }
.ok b { color: var(--brand); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.spinner { width: 56px; height: 56px; border: 6px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; margin: 24px 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } html { scroll-behavior: auto; } }

/* Урок */
.crumbs { margin: 0 0 1em; }
.crumbs a { font-weight: 700; text-decoration: none; }
.lesson { padding-top: 32px; }
.fontsize { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: .9rem; margin-bottom: 1.5em; }
.fontsize button { font-size: 1rem; font-weight: 700; min-width: 56px; min-height: 48px; border-radius: 12px; border: 2px solid var(--brand); background: #fff; color: var(--brand); cursor: pointer; }
.lesson-body { font-size: calc(1.05rem * var(--lesson-scale)); }
.lesson-body h2 { font-size: 1.4em; }
.lesson-body h3 { font-size: 1.12em; margin-top: 1.4em; }
.lesson-body ul, .lesson-body ol { padding-left: 1.4em; }
.lesson-body li { margin: .45em 0; }
.lesson-body .chat { font-size: .95em; }
.lesson-body .msg { font-size: 1em; }
.tip, .warn, .task, .remember { border-radius: 14px; padding: 18px 22px 18px 22px; margin: 1.4em 0; }
.tip { background: var(--brand-soft); border-left: 6px solid var(--brand); }
.warn { background: var(--warn-soft); border-left: 6px solid var(--warn); }
.task { background: #fff; border: 3px solid var(--accent); }
.remember { background: #fff8d6; border-left: 6px solid #c79a00; }
.tip > :last-child, .warn > :last-child, .task > :last-child, .remember > :last-child { margin-bottom: 0; }
.label { display: block; font-weight: 700; text-transform: uppercase; font-size: .78em; letter-spacing: .07em; margin-bottom: .3em; }
.tip .label { color: var(--brand); } .warn .label { color: var(--warn); } .task .label { color: var(--accent); } .remember .label { color: #8a6a00; }
.steps-list { list-style: none; padding: 0 !important; counter-reset: s; }
.steps-list > li { counter-increment: s; position: relative; padding: 4px 0 14px 62px; margin: 0 !important; }
.steps-list > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 1.1em; }
kbd { display: inline-block; font-family: inherit; font-size: .9em; font-weight: 700; background: #fff; border: 2px solid #b9ad9a; border-bottom-width: 4px; border-radius: 8px; padding: 0 10px; white-space: nowrap; }
.ui { display: inline-block; background: var(--ink); color: #fff; border-radius: 8px; padding: 0 10px; font-weight: 700; font-size: .92em; white-space: nowrap; }
.screen { background: #fff; border: 2px solid #cfc5b5; border-radius: 22px; padding: 16px; margin: 1.2em 0; max-width: 520px; }
.screen-bar { background: #eee8de; border-radius: 12px; padding: 10px 14px; font-family: Consolas, monospace; font-size: .85em; margin-bottom: 12px; }
.screen-box { border: 2px solid var(--brand); border-radius: 16px; padding: 14px; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; color: var(--ink-2); min-height: 90px; }
.screen-send { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: 0 0 44px; }
.screen-cap { font-size: .85em; color: var(--ink-2); margin-top: 8px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 1.2em 0; }
.compare > div { border-radius: 14px; padding: 16px 18px; }
.compare .bad { background: var(--warn-soft); }
.compare .good { background: var(--brand-soft); }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }
.lesson-nav { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 3em 0 1em; padding-top: 1.5em; border-top: 1px solid var(--line); }
.paywall { background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 28px; }
.paywall h2 { margin-top: .3em; }
.prose h2 { font-size: 1.25rem; }
.print-sheet { background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 22px 26px; }
.print-sheet h3 { border-bottom: 2px solid var(--line); padding-bottom: 4px; }

/* Таблицы в админке */
.tbl { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .8rem; background: #fff; }
th, td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.admin-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; align-items: center; }
.admin-form input, .admin-form select { font-size: .9rem; padding: 10px; }

/* Подвал */
.foot { background: #2a2620; color: #e9e2d6; padding: 40px 0; margin-top: 40px; }
.foot a { color: #fff; }
.foot-in { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
.foot .muted { color: #b8ae9f; }
.foot-logo { font-family: Georgia, serif; font-size: 1.2rem; font-weight: 700; color: #fff; }
@media (max-width: 700px) { .foot-in { grid-template-columns: 1fr; } }

@media print {
  .top, .foot, .fontsize, .lesson-nav, .crumbs { display: none !important; }
  body { background: #fff; }
  .print-sheet { border: none; padding: 0; }
}

@media (max-width: 520px) { .top-in { min-height: 60px; padding-top: 8px; padding-bottom: 8px; } .nav a { padding: 8px 10px; } h1 { font-size: 1.7rem; } .btn { width: 100%; } }
