/* SMMtogo – одна светлая тема, крупный шрифт, без внешних шрифтов и картинок. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1b1f24;
  --muted: #5b6470;
  --border: #dfe3e8;
  --accent: #3451e6;
  --accent-dark: #2640c4;
  --accent-soft: #eef0ff;
  --ok: #1f7a45;
  --ok-soft: #e7f6ed;
  --warn: #8a5a00;
  --warn-soft: #fff5e6;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --focus: 0 0 0 3px #fff, 0 0 0 6px #3451e6;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
main:focus { outline: none; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 3.5vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
code { font: .95em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.wizard-container { max-width: 820px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* --- шапка и подвал --- */

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 68px; padding-top: 8px; padding-bottom: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--text); text-decoration: none; }
.logo-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 1.1rem; }
.site-nav { display: flex; align-items: center; gap: 18px; justify-content: flex-end; white-space: nowrap; margin-left: auto; }
.site-nav a:not(.button) { color: var(--text); text-decoration: none; font-weight: 600; }

.site-footer { margin-top: 48px; padding: 28px 0 36px; border-top: 1px solid var(--border); background: var(--surface); font-size: .95rem; }
.footer-inner p { margin: 0 0 .4em; }

/* --- кнопки и формы --- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px;
  border: 2px solid var(--accent); border-radius: 12px;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.button:disabled { opacity: .55; cursor: progress; }
.button-secondary { background: var(--surface); color: var(--accent); }
.button-secondary:hover { background: var(--accent-soft); color: var(--accent-dark); }
.button-small { min-height: 40px; padding: 6px 14px; font-size: .95rem; }
.button-large { min-height: 56px; padding: 14px 28px; font-size: 1.1rem; }
.button-danger { background: var(--danger); border-color: var(--danger); }
.button-danger:hover { background: #8f1c13; border-color: #8f1c13; }
.link-button { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; }
.link-button:hover { color: var(--accent); }

input[type="text"], input[type="email"], input[type="url"], input[type="number"], input[type="date"],
input[type="search"], input[type="password"], select, textarea {
  min-height: 48px; padding: 8px 12px; border: 2px solid var(--border); border-radius: 10px;
  font: inherit; background: #fff; color: var(--text); max-width: 100%;
}
input:focus-visible { border-color: var(--accent); }
input[type="number"] { width: 7em; }
input[type="radio"], input[type="checkbox"] { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); flex: none; }

fieldset { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
fieldset label { display: flex; align-items: center; gap: 12px; padding: 6px 0; cursor: pointer; }
fieldset label.with-input { flex-wrap: wrap; row-gap: 8px; }
.nowrap, .date-range { display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.hint { color: var(--muted); font-size: .95rem; margin-bottom: 8px; }

.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 18px; }
.inline-form label { flex-basis: 100%; font-weight: 600; }
.inline-form input { flex: 1 1 240px; }

.form-error { color: var(--danger); font-weight: 600; margin: 12px 0 0; }
.form-error:empty, .form-status:empty, .status-line:empty { display: none; }
.form-status { margin: 10px 0 0; flex-basis: 100%; }
.status-line { font-weight: 600; margin-top: 16px; }

/* --- общие блоки --- */

.section { padding: 48px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 40em; }

.badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: .9rem; margin-bottom: 14px; }
.badge-beta { background: var(--ok-soft); color: var(--ok); }

.notice { border-radius: 12px; padding: 14px 18px; background: var(--accent-soft); margin: 18px 0; }
.notice p:last-child { margin-bottom: 0; }
.notice-warn { background: var(--warn-soft); }
.notice-error { background: var(--danger-soft); }
.notice-ok { background: var(--ok-soft); }
.notice:empty { display: none; }
.step-body [data-action] ~ [data-panel] { margin-top: 18px; }

.icon { width: 56px; height: 56px; flex: none; }

.check-list, .cross-list { list-style: none; padding: 0; margin: 0 0 1em; }
.check-list li, .cross-list li { position: relative; padding-left: 32px; margin-bottom: 8px; }
.check-list li::before, .cross-list li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
.check-list li::before { content: "✓"; color: var(--ok); }
.cross-list li::before { content: "✕"; color: var(--danger); }

.progress { display: block; height: 12px; border-radius: 999px; background: #e6e9ee; overflow: hidden; margin: 12px 0; }
.progress-large { height: 18px; }
.progress-bar { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .4s; }

.status { display: inline-block; font-weight: 700; padding: 2px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.status-done { background: var(--ok-soft); color: var(--ok); }
.status-failed { background: var(--danger-soft); color: var(--danger); }
.status-paused { background: var(--warn-soft); color: var(--warn); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }

/* --- лендинг --- */

.hero { padding: 64px 0 40px; }
.hero h1 { max-width: 16em; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: step; }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); counter-increment: step; }
.step-card h3::before { content: counter(step) ". "; color: var(--accent); }
.step-card .icon { margin-bottom: 12px; }

.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; max-width: 520px; box-shadow: var(--shadow); }
.price { font-size: 1.3rem; }
.price strong { font-size: 2.4rem; }
.price-card ul { padding-left: 1.2em; }

.faq details { background: var(--bg); border-radius: 12px; margin-bottom: 10px; padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style-position: outside; }
.faq details p { padding-bottom: 14px; margin: 0; }

.soon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.soon-card { background: var(--surface); border: 1px dashed #b8c0f5; border-radius: var(--radius); padding: 22px; margin-top: 24px; }
.soon-grid .soon-card { margin-top: 0; }
.lead-form { display: flex; flex-wrap: wrap; gap: 10px; }
.lead-form input { flex: 1 1 220px; }

/* --- кабинет --- */

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.migration-card { display: grid; gap: 6px; color: var(--text); text-decoration: none; }
.migration-card:hover { border-color: var(--accent); }
.migration-card .channels { font-weight: 700; font-size: 1.1rem; }
.migration-card .status { justify-self: start; }
.empty { text-align: left; }

.login-card { margin-top: 22px; display: grid; gap: 12px; justify-items: start; }
.qr { margin: 12px 0 18px; }
.qr svg { width: 200px; height: 200px; display: block; border-radius: 10px; border: 1px solid var(--border); }

/* --- мастер --- */

.wizard { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 16px; }
.wizard-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.wizard-step h2 { display: flex; align-items: center; gap: 12px; font-size: 1.35rem; margin: 0; }
.step-number { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; flex: none; }
.step-body { margin-top: 16px; }
.step-summary { margin: 10px 0 0 48px; color: var(--muted); }
.wizard-step.is-locked { opacity: .55; box-shadow: none; }
.wizard-step.is-done .step-number { background: var(--ok-soft); color: var(--ok); font-size: 0; }
.wizard-step.is-done .step-number::before {
  content: ""; width: 18px; height: 18px; background: currentColor;
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask: var(--check) center / contain no-repeat; mask: var(--check) center / contain no-repeat;
}
.wizard-step.is-active { border-color: var(--accent); border-width: 2px; }

.bot-name { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bot-nick { font-size: .95rem; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bot-nick code { font-size: .9rem; }
.bot-name code { font-size: 1.15rem; font-weight: 700; background: var(--bg); padding: 6px 12px; border-radius: 8px; }
.howto { margin: 12px 0 18px; }
.howto summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.howto ol { margin: 10px 0 0; padding-left: 1.3em; }
.howto .bot-name { margin-top: 12px; }
.howto-title { font-weight: 700; margin: 14px 0 0; }
.choices { display: grid; gap: 4px; }
.choices label { border: 2px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.choices label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.link-code { font: 700 2.2rem/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .25em; }
.schema { margin: 14px 0; }
.schema svg { width: 100%; max-width: 360px; height: auto; display: block; }
.schema figcaption { color: var(--muted); font-size: .95rem; margin-top: 6px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 22px; }
.stats div { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.stats dt { color: var(--muted); font-size: .9rem; }
.stats dd { margin: 0; font-weight: 800; font-size: 1.25rem; }
.stats .wide { grid-column: span 2; }
.options { margin-top: 8px; }
.summary-line { font-size: 1.25rem; }

/* --- прогресс и отчёт --- */

.counters { font-weight: 600; }
.current { background: var(--bg); border-radius: 10px; padding: 10px 14px; font-size: .95rem; overflow-wrap: anywhere; }
.report { margin-top: 32px; }
.table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.report-table th, .report-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.report-table th { background: var(--bg); font-size: .95rem; }
.report-table td:first-child, .report-table td:nth-child(2) { white-space: nowrap; }

/* --- телефон --- */

/* --- админка --- */

.container-wide { max-width: 1320px; }
.admin { padding-top: 24px; padding-bottom: 24px; font-size: 16px; }
.admin h1 { font-size: 2rem; }
.admin h1 .status { font-size: 1rem; vertical-align: middle; }
.admin h2 { font-size: 1.3rem; }
.admin .button-small { min-height: 40px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 0 6px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.admin-nav a { padding: 10px 14px; color: var(--text); text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.admin-nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--accent-dark); }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 20px 0; align-items: start; }
.admin-section { margin: 28px 0; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.card .table-wrap { border: 0; border-radius: 0; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table thead th { background: var(--bg); white-space: nowrap; }
.admin-table tbody tr:last-child > * { border-bottom: 0; }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap-cell { white-space: nowrap; }
.text-cell { min-width: 16em; }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .95rem; }
.filters input[type="search"] { min-width: 18em; }
.filters input, .filters select { min-height: 40px; padding: 6px 10px; font-weight: 400; }
.admin-table .status { white-space: nowrap; font-size: .85rem; }
.subhead { margin-top: 20px; }
.facts { display: grid; grid-template-columns: minmax(9em, auto) 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.action-form { margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.action-form > label { font-weight: 600; }
.action-form textarea { width: 100%; resize: vertical; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.action-row input { min-height: 40px; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.action-buttons form { margin: 0; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 400; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tabs a { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 16px 0; }
.plain-list { list-style: none; padding: 0; margin: 0 0 12px; }
.plain-list li { margin-bottom: 8px; }
form.inline { display: inline; margin: 0; }
.auth-card { max-width: 460px; margin: 0 auto; }
.auth-card label { display: block; font-weight: 600; margin: 12px 0 4px; }
.auth-card input { width: 100%; }
.auth-card .password-field input { width: auto; }
.codes { columns: 2; font: 700 1.1rem ui-monospace, Menlo, Consolas, monospace; list-style: none; padding: 0; }
.secret-value { font-family: ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; background: var(--bg); padding: 8px 10px; border-radius: 8px; }
.settings-form { max-width: 760px; }
.settings-form label { display: block; font-weight: 600; margin: 14px 0 4px; }
.password-field { display: flex; gap: 8px; align-items: stretch; width: 100%; }
.password-field input { flex: 1; min-width: 0; }
.secret-row { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--border); }
.secret-row:first-of-type { border-top: 0; }
.secret-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; background: var(--bg); color: var(--muted); }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-bad { background: var(--danger-soft); color: var(--danger); }
.group-help { color: var(--muted); margin: -4px 0 8px; }
.settings-form input[type="text"], .settings-form input[type="number"], .settings-form input[type="password"], .settings-form textarea { width: 100%; }
.settings-form label.check { font-weight: 400; }

@media (max-width: 800px) {
  .steps, .columns, .soon-grid { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 36px 0; }
  .hero { padding: 40px 0 24px; }
}

@media (max-width: 520px) {
  body { font-size: 17px; }
  .header-inner { gap: 10px; }
  .logo { font-size: 1.1rem; gap: 8px; }
  .site-nav { gap: 12px; font-size: .95rem; }
  .wizard-step { padding: 16px; }
  .step-summary { margin-left: 0; }
  .button-large { width: 100%; }
  .lead-form .button, .inline-form .button { width: 100%; }
  .report-table thead { display: none; }
  .report-table tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .report-table td { display: block; border: 0; padding: 4px 12px; }
  .report-table td::before { content: attr(data-label) ": "; font-weight: 700; }
  .link-code { font-size: 1.8rem; }
  .date-range { display: grid; grid-template-columns: auto 1fr; gap: 8px 10px; flex: 1 1 calc(100% - 34px); margin-left: 34px; }
  .date-range input { width: 100%; min-width: 0; }
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 8px; }
  .filters label, .filters input[type="search"] { width: 100%; min-width: 0; }
  .nowrap input[type="number"] { width: 5em; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
