/* Общие стили внутренних страниц P2U. Шапка и подвал — те же классы, что на главной. */
:root {
  --bg: #0f1115; --panel: #171a21; --panel-2: #1e222b; --line: #2a2f3a; --text: #e8eaed; --muted: #8b919c;
  --accent: #f0b90b; --buy: #20b26c; --sell: #ef454a; --warn: #ffb020; --hover: rgba(255, 255, 255, .03);
  --warn-bg: rgba(255, 176, 32, .08); --warn-line: rgba(255, 176, 32, .25); --warn-text: #d9c08a;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f5f6f8; --panel: #ffffff; --panel-2: #eef0f3; --line: #e1e4e8; --text: #121214; --muted: #6b7280; --hover: rgba(0, 0, 0, .02);
  --warn-bg: #fff8e6; --warn-line: #f5d68a; --warn-text: #7a5a12;
  color-scheme: light;
}
html { scrollbar-gutter: stable; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { flex: 1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.up { color: var(--buy); } .down { color: var(--sell); }

/* ===== Шапка ===== */
.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 56px; }
.logo { font-weight: 700; font-size: 18px; letter-spacing: .3px; flex: none; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 20px; color: var(--muted); }
.nav a:hover, .nav a.on { color: var(--text); }
.top .right { margin-left: auto; display: flex; gap: 10px; flex: none; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer;
  display: grid; place-items: center; color: var(--text); flex: none; }
.icon-btn .sun { display: none; }
[data-theme="light"] .icon-btn .sun { display: block; }
[data-theme="light"] .icon-btn .moon { display: none; }
.burger { display: none !important; }
.mnav { display: none; }
.sub { border-bottom: 1px solid var(--line); }
.sub .wrap { display: flex; gap: 24px; height: 48px; align-items: center; color: var(--muted); overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.sub a:hover { color: var(--text); }
.sub a.on { color: var(--text); font-weight: 600; }

/* ===== Общие блоки ===== */
.page-head { padding: 32px 0 8px; }
.page-head h1 { margin: 0 0 6px; font-size: 32px; line-height: 1.2; }
.page-head p { margin: 0; color: var(--muted); font-size: 16px; max-width: 720px; }
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.crumbs a:hover { color: var(--text); }
.section { margin: 40px 0; }
.section h2 { font-size: 22px; margin: 0 0 6px; }
.section > p.lead { color: var(--muted); margin: 0 0 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; min-width: 0; }
.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); }
.grid2, .grid3, .grid4 { display: grid; gap: 16px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 32px; align-items: start; padding: 24px 0 48px; }
.split > * { min-width: 0; }
.ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-2); font-size: 20px; margin-bottom: 12px; }
.num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-bg); color: #fff; font-weight: 700; margin-bottom: 12px; }
.stat b { display: block; font-size: 26px; }
.stat span { color: var(--muted); }
.note { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--panel-2); color: var(--muted); }
.pill.blue { background: rgba(240, 185, 11, .15); color: var(--accent); }
.pill.green { background: rgba(32, 178, 108, .15); color: var(--buy); }
ul.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
ul.checks li { display: flex; gap: 10px; }
ul.checks li::before { content: "✓"; color: var(--buy); font-weight: 700; }
.prose { max-width: 820px; padding-bottom: 48px; }
.prose h2 { font-size: 20px; margin: 32px 0 8px; }
.prose p, .prose li { color: var(--muted); font-size: 15px; line-height: 1.7; }
.prose li { margin: 6px 0; }
.coin-logo { border-radius: 50%; }
.coin-dot { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: 12px; flex: none; }

/* ===== Кнопки и формы ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 18px;
  cursor: pointer; background: var(--panel-2); font-weight: 600; }
.btn.primary { background: var(--accent-bg); border-color: var(--accent-bg); color: #fff; }
.btn.green { background: var(--buy-bg); border-color: var(--buy-bg); color: #fff; }
.btn.block { width: 100%; height: 48px; }
.btn:disabled { opacity: .5; cursor: default; }
label.lbl { display: block; color: var(--muted); font-size: 13px; margin: 14px 0 6px; }
.input { display: flex; align-items: center; min-height: 46px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.input:focus-within { border-color: var(--accent); }
.input.bad { border-color: var(--sell); }
.input input, .input select, .input textarea { flex: 1; min-width: 0; height: 44px; padding: 0 12px; background: transparent; border: 0; outline: 0; }
.input textarea { height: auto; min-height: 120px; padding: 12px; resize: vertical; }
.input select option { background: var(--panel-2); }
.input .suf { padding: 0 12px; color: var(--muted); border-left: 1px solid var(--line); align-self: stretch; display: flex; align-items: center; }
.err { color: var(--sell); font-size: 12px; min-height: 16px; margin-top: 4px; }
.kv { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 8px 16px; font-size: 14px; overflow-wrap: anywhere; }
.kv > :nth-child(odd) { color: var(--muted); }
.kv > :nth-child(even) { text-align: right; }
.seg { display: inline-flex; gap: 4px; padding: 3px; background: var(--panel-2); border-radius: 8px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 6px; cursor: pointer; color: var(--muted); font-weight: 600; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }

/* ===== Таблицы ===== */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 13px; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--hover); }
th.r, td.r { text-align: right; }

/* ===== FAQ ===== */
details.q { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
details.q summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.q summary::-webkit-details-marker { display: none; }
details.q summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; }
details.q[open] summary::after { content: "−"; }
details.q p { margin: 0; padding: 0 18px 16px; color: var(--muted); }

/* ===== Подвал ===== */
footer { margin-top: 48px; background: var(--panel); border-top: 1px solid var(--line); padding: 40px 0 24px; font-size: 14px; }
footer .cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; }
footer h4 { margin: 0 0 12px; font-size: 14px; }
footer .cols a { display: block; color: var(--muted); margin: 8px 0; }
footer .cols a:hover { color: var(--text); }
footer .bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 32px; padding-top: 20px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer .bottom a { color: var(--muted); }
footer .bottom a:hover { color: var(--text); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line); padding: 10px 16px;
  border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 30; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }

/* ===== Иконки в плашках ===== */
.ico { color: var(--accent); }
.ico.blue { background: rgba(240, 185, 11, .12); color: var(--accent); }
.ico.green { background: rgba(32, 178, 108, .12); color: #2bc27a; }
.ico.amber { background: rgba(255, 176, 32, .13); color: #f0a417; }
.ico.purple { background: rgba(162, 92, 255, .13); color: #b07cff; }
.ico.red { background: rgba(239, 69, 74, .12); color: #f2565b; }
.lock { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; }
.lock.blue { background: rgba(240, 185, 11, .12); color: var(--accent); }

/* ===== Кликабельные карточки и фокус ===== */
a.card { display: block; transition: border-color .15s, transform .15s, box-shadow .15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
a.card .go { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--accent); font-weight: 600; font-size: 13px; }
a.card .go svg { transition: transform .15s; }
a.card:hover .go svg { transform: translateX(3px); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { a.card, a.card .go svg { transition: none; } a.card:hover { transform: none; } }

/* ===== Поля только для чтения и отступы под ошибками ===== */
.input.readonly { background: transparent; border-style: dashed; }
.input.readonly input { cursor: default; font-weight: 600; }
.err + label.lbl { margin-top: 6px; }
.lockbox { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.lockbox .ico { margin: 0; width: 36px; height: 36px; flex: none; }

/* ===== Адаптив ===== */
@media (max-width: 1100px) {
  .nav { display: none !important; }
  .burger { display: grid !important; }
  .top.open .mnav { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; padding: 8px 20px 14px;
    border-top: 1px solid var(--line); background: var(--panel); }
  .mnav a { padding: 10px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
  .mnav a.on, .mnav a:hover { background: var(--panel-2); color: var(--text); }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  footer .cols { grid-template-columns: repeat(2, 1fr); }
  .page-head h1 { font-size: 24px; }
  .page-head p { font-size: 15px; }
}
@media (max-width: 1100px) {
  /* Форма действия (купить, пополнить, заявка) — первой, описание под ней */
  .split.action-first > :last-child { order: -1; }
}
@media (max-width: 860px) {
  /* Поля 16 px: iPhone не приближает страницу при вводе */
  input, select, textarea { font-size: 16px !important; }
  .input { min-height: 48px; }
  .icon-btn { width: 40px; height: 40px; }
  /* Места для нажатия не меньше ~40 px */
  .sub .wrap { gap: 4px; }
  .sub a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; border-radius: 8px; }
  .sub a.on { background: var(--panel-2); }
  .seg button { min-height: 40px; }
  .seg { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .seg button { flex: none; }
  details.q summary { min-height: 52px; align-items: center; }
  footer .cols a { padding: 6px 0; margin: 2px 0; }
  .pill { font-size: 12px; }
  .page-head { padding-top: 20px; }
  .section { margin: 28px 0; }
  .split { gap: 20px; padding-top: 16px; }
  .toast { bottom: 24px; text-align: center; }
  td, th { padding: 12px 10px; }
  .kv { font-size: 13px; }
}
@media (max-width: 480px) {
  .wrap { padding: 0 14px; }
  .grid4 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; }
}

/* ===== Светлая тема: цвета с достаточным контрастом на белом (от 4.5:1 для текста) ===== */
/* Заливки кнопок с белым текстом: контраст от 4.5:1 в обеих темах (текстовые --accent/--buy/--sell остаются ярче) */
  :root { --warn-strong: #ffb020; --accent-bg: #f0b90b; --buy-bg: #15803d; --sell-bg: #dc2626; }
[data-theme="light"] { --accent: #8f7114; --buy: #0b7a44; --sell: #d42f35; --muted: #596170; --warn-strong: #a15c07; }
[data-theme="light"] .ico.blue { color: var(--accent); }
[data-theme="light"] .ico.green { color: #0b7a44; }
[data-theme="light"] .ico.red { color: #d42f35; }
[data-theme="light"] .ico.amber { color: #b45309; }
[data-theme="light"] .ico.purple { color: var(--accent); }
[data-theme="light"] .login-strip b, [data-theme="light"] .strip-ico, [data-theme="light"] .notice .ico { color: var(--warn-strong); }
[data-theme="light"] .tag.warn { color: #a15c07; }
[data-theme="light"] .stars button { color: #8a919d; }
[data-theme="light"] .stars button.on { color: #f59e0b; }
[data-theme="light"] a.card:hover, [data-theme="light"] .guide:hover, [data-theme="light"] .news-card:hover,
[data-theme="light"] .lead-card:hover, [data-theme="light"] .card:hover { box-shadow: 0 10px 24px rgba(16, 24, 40, .08); }
[data-theme="light"] .side-switch, [data-theme="light"] .dd .menu { box-shadow: 0 8px 20px rgba(16, 24, 40, .10); }
[data-theme="light"] .support { box-shadow: 0 6px 16px rgba(240, 185, 11, .30); }
[data-theme="light"] .pill.blue { background: rgba(240, 185, 11, .09); color: var(--accent); }
[data-theme="light"] .pill.green { background: rgba(11, 122, 68, .09); }
/* Тёмная тема: синий ярлык светлее на тёмной плашке, пустые звёзды заметнее */
:root:not([data-theme="light"]) .pill.blue { color: var(--accent); }
:root:not([data-theme="light"]) .stars button { color: #6b7280; }
:root:not([data-theme="light"]) .stars button.on { color: var(--warn); }

/* Видимый фокус у полей ввода (сами поля без обводки, обводится рамка поля) */
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.input.bad:focus-within { border-color: var(--sell); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sell, #ef454a) 25%, transparent); }
