/* Общие детали страниц-приложений: заявка, отслеживание, кабинет, админка.
   Токены, шапка, кнопки и подвал лежат в site.css. */

:root {
}

/* ---------- Страница ---------- */
.section { max-width: var(--wrap); margin: 0 auto; padding: 48px var(--gutter) 96px; }
.section-title { font-size: var(--fs-40); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.section-sub { font-size: var(--fs-16); color: var(--ink-2); margin: 0 0 32px; max-width: 40em; }
.note { font-size: var(--fs-14); color: var(--ink-2); margin-top: 8px; }
.note.warn { color: var(--amber); }
.note.center { text-align: center; }
.badge { display: inline-block; padding: 2px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.center { text-align: center; }

/* Кнопки: без модификатора кнопка главная */
.btn { background: var(--brand); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16); }
.btn:hover { background: var(--brand-hover); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { background: var(--surface); border-color: var(--ink-2); }
.btn-lg { min-height: 52px; padding: 0 28px; }
.btn-tg { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-tg:hover { background: var(--surface); border-color: var(--ink-2); }
.btn-tg svg { width: 20px; height: 20px; fill: var(--brand); flex: none; }
.order-actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Карточки ---------- */
.order-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; }
.order-head { margin-bottom: 24px; }
.order-number { font-size: var(--fs-40); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.order-number span { font-family: var(--mono); font-weight: 500; }
.order-msg { min-height: 20px; margin-top: 12px; font-size: var(--fs-14); color: var(--down); }
.order-msg.ok { color: var(--ink-2); }

/* ---------- Поля ---------- */
.field { margin-bottom: 16px; }
.field label, .step-label { display: block; font-size: var(--fs-14); font-weight: 500; color: var(--ink-2); margin-bottom: 8px; }
.input-row {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.input-row:focus-within { border-color: var(--brand); outline: 3px solid rgba(var(--brand-rgb), 0.25); outline-offset: 0; }
.input-row input { flex: 1; min-width: 0; min-height: 50px; border: 0; outline: 0; background: transparent; font: inherit; color: inherit; }
.input-row input::placeholder, textarea::placeholder { color: var(--placeholder); }
.input-row .cur-icon { width: 24px; height: 24px; border-radius: 50%; flex: none; }
.input-row .currency { font-family: var(--mono); font-size: var(--fs-14); color: var(--ink-2); }
textarea, select.plain-select {
  width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; color: inherit;
}
textarea:focus, select.plain-select:focus { border-color: var(--brand); outline: 3px solid rgba(var(--brand-rgb), 0.25); outline-offset: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.select-wrap { position: relative; }
.consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font-size: var(--fs-14); color: var(--ink-2); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); flex: none; }

/* ---------- Сообщения ---------- */
.notice { margin-bottom: 16px; padding: 12px 16px; background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: var(--r-sm); font-size: var(--fs-14); }
.notice.paused { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber); }

/* ---------- Статусы ---------- */
.status-badge {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--surface); font-size: var(--fs-14); font-weight: 500; white-space: nowrap;
}
.status-new { background: var(--surface); }
.status-in_progress { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-dark); }
.status-awaiting_payment { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber); }
.status-paid { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }
.status-completed { background: var(--brand); border-color: var(--brand); color: #fff; }
.status-cancelled { background: var(--paper); color: var(--ink-2); text-decoration: line-through; }

/* История статусов */
.timeline { margin: 16px 0 0; }
.timeline-item { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 0 0 16px 32px; }
.timeline-item::before { content: ""; position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border: 2px solid var(--line); border-radius: 50%; background: var(--surface); }
.timeline-item::after { content: ""; position: absolute; left: 7px; top: 22px; bottom: 2px; width: 2px; background: var(--line); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child::after { display: none; }
.timeline-item.done::before { background: var(--brand); border-color: var(--brand); }
.timeline-item.done::after { background: var(--brand); }
.timeline-item.current::before { border-color: var(--brand); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--brand); }
.timeline-item.todo .timeline-label { color: var(--ink-2); }
.timeline-item.cancelled::before { border-color: var(--ink-2); background: var(--paper); }
.timeline-item.cancelled .timeline-label { text-decoration: line-through; color: var(--ink-2); }
.timeline-label { font-weight: 600; }
.timeline-time { font-family: var(--mono); font-size: var(--fs-14); color: var(--ink-2); }
.timeline-title { font-size: var(--fs-16); font-weight: 600; margin: 24px 0 0; }

/* ---------- Блок действий по заявке (extras.js) ---------- */
.order-extras { display: grid; gap: 12px; margin-top: 20px; }
.order-extras:empty { display: none; }
.lock-line { padding: 12px 16px; background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: var(--r-sm); color: var(--amber); font-size: var(--fs-14); font-variant-numeric: tabular-nums; }
.lock-line:empty { display: none; }
.lock-line.expired { background: var(--paper); border-color: var(--line); color: var(--ink-2); }
.docs-box, .receipt-box, .review-box { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.docs-box { border-color: var(--amber-line); background: var(--amber-soft); }
.docs-box.done { border-color: var(--line); background: var(--surface); }
.docs-box p, .receipt-box p, .review-box p { margin: 4px 0 12px; font-size: var(--fs-14); color: var(--ink-2); }
.docs-box strong, .receipt-box strong, .review-box strong { font-weight: 600; }
.uploader { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.uploader-msg { font-size: var(--fs-14); color: var(--ink-2); }
.uploader-msg.ok { color: var(--up); }
.uploader-msg.bad { color: var(--down); }
.notify-on { font-size: var(--fs-14); color: var(--ink-2); }
.notify-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.notify-hint { font-size: var(--fs-14); color: var(--ink-2); }
.star-row { display: flex; gap: 4px; margin-bottom: 12px; }
.star-btn { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--star-off); font-size: 22px; cursor: pointer; }
.star-btn:hover { border-color: var(--ink-2); }
.star-btn.on { color: var(--amber); background: var(--amber-soft); border-color: var(--amber-line); }
.review-text { margin-bottom: 12px; resize: vertical; }
.review-own-text { font-style: normal; }

@media (max-width: 760px) {
  .section { padding-top: 28px; padding-bottom: 56px; }
  .order-card { padding: 20px; }
  .order-number { font-size: var(--fs-28); }
  .btn-lg { width: 100%; }
}

/* ---------- Оплата криптовалютой: панель клиента ---------- */
.crypto-panel { padding: 20px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); }
.crypto-panel h3 { margin: 16px 0 8px; font-size: var(--fs-20); font-weight: 600; }
.crypto-panel > p { margin: 0; color: var(--ink-2); }
.crypto-panel.ok { border-color: var(--brand); background: var(--brand-soft); }
.crypto-panel.done { border-color: var(--brand); }
.pay-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; list-style: none; }
.pay-stages li { padding-top: 10px; border-top: 3px solid var(--line); font-size: var(--fs-14); color: var(--ink-2); }
.pay-stages li.done { border-top-color: var(--brand); color: var(--ink); }
.pay-stages li.current { border-top-color: var(--brand); color: var(--ink); font-weight: 600; }
.deposit-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; margin: 12px 0; }
.deposit-info { flex: 1 1 320px; min-width: 0; margin: 0; border-top: 1px solid var(--line); }
.deposit-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: start; }
.deposit-row dt { font-size: var(--fs-14); color: var(--ink-2); }
.deposit-row dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.deposit-value { font-family: var(--mono); font-size: var(--fs-14); overflow-wrap: anywhere; word-break: break-all; }
.copy-mini { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer; }
.copy-mini:hover { border-color: var(--ink-2); }
.deposit-qr { flex: none; width: 168px; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.deposit-qr svg { display: block; width: 100%; height: auto; }
.pay-note { margin: 0 0 16px; padding: 12px 16px; border-left: 3px solid var(--amber); background: var(--amber-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: var(--fs-14); }
.pay-warn { margin-top: 16px; padding: 12px 16px; border: 1px solid var(--amber-line); border-radius: var(--r-sm); background: var(--amber-soft); color: var(--amber); font-size: var(--fs-14); }
.pay-warn p { margin: 4px 0 0; }
.pay-need { margin-bottom: 16px; }
.pay-need > p { margin: 0 0 8px; font-size: var(--fs-14); color: var(--ink-2); }
.pay-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.pay-done { min-width: 200px; }

/* Таиланд, деньги получены: отдельный «гостеприимный» экран вместо анимации автоотправки — дальше нужен менеджер */
.thb-handoff { text-align: center; padding: 36px 28px; }
.thb-handoff h3 { margin: 4px 0 10px; }
.thb-handoff > p { max-width: 36em; margin: 0 auto; }
.thb-visual .ripple { width: 56px; height: 56px; }
.thb-badge { position: relative; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.tg-icon { display: inline-flex; }
.tg-icon svg { width: 18px; height: 18px; fill: currentColor; flex: none; }
.thb-badge .tg-icon svg { width: 24px; height: 24px; }
.thb-cta { margin: 22px 0 14px; }
.thb-cta .btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.thb-hint { margin: 0; font-size: var(--fs-14); color: var(--ink-2); }
@media (max-width: 760px) {
  .crypto-panel { padding: 16px; }
  .deposit-qr { width: 100%; max-width: 220px; }
  .deposit-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .pay-done { width: 100%; }
  .thb-handoff { padding: 28px 16px; }
  .thb-cta .btn { width: 100%; }
}

/* ---------- Движение: показывает, что изменилось (уважает prefers-reduced-motion, см. site.css) ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { from { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.12); } }
@keyframes draw { from { stroke-dashoffset: 160; } }
@keyframes ripple { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes dot-move { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - 8px); opacity: 0; } }
@keyframes indeterminate { 0% { left: -35%; } 100% { left: 100%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes tick-in { from { opacity: 0.3; transform: translateY(-4px); } }
@keyframes ring-pulse {
  0% { box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--brand), 0 0 0 0 rgba(var(--brand-rgb), 0.35); }
  100% { box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--brand), 0 0 0 9px rgba(var(--brand-rgb), 0); }
}

/* Блоки формы мягко появляются, когда становятся нужны */
.order-step, .thb-panel, .payout-panel, .notice, .crypto-pay, #thb-note-text { animation: rise 0.3s ease-out; }
.choice, .pay-chip, .service-tab, .saved-chip { transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; }
.choice.selected .choice-check { animation: pop 0.3s both; }
.input-row.tick { animation: tick-in 0.35s ease-out; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading::before { content: ""; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }

/* Галочка, которая рисуется сама */
.check-anim { display: inline-grid; place-items: center; }
.check-anim svg { width: 56px; height: 56px; }
.check-anim.big svg { width: 72px; height: 72px; }
.check-circle { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-dasharray: 152; animation: draw 0.7s ease-out both; }
.check-mark { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; animation: draw 0.4s 0.5s ease-out both; }
.success-icon.check-anim { width: 64px; height: 64px; margin-bottom: 8px; background: none; color: inherit; border-radius: 0; }
.success-icon.check-anim svg { width: 64px; height: 64px; }

/* Экран «Заявка создана»: блоки появляются по очереди */
.success > * { animation: rise 0.5s ease-out both; }
.success > *:nth-child(2) { animation-delay: 0.08s; }
.success > *:nth-child(3) { animation-delay: 0.14s; }
.success > *:nth-child(4) { animation-delay: 0.2s; }
.success > *:nth-child(5) { animation-delay: 0.26s; }
.success > *:nth-child(6) { animation-delay: 0.32s; }
.success > *:nth-child(n + 7) { animation-delay: 0.38s; }

/* Панель оплаты криптовалютой */
.crypto-panel.enter { animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
.pay-stages li { position: relative; padding-top: 12px; border-top: 0; }
.pay-stages li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; border-radius: 1px; background: var(--line); }
.pay-stages li.done::before { background: var(--brand-line); }
.pay-stages li.current::before { background: var(--brand); }
.pay-stages li.done::after { content: " ✓"; color: var(--brand); }
.pay-visual { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 20px 0 4px; }
.pay-visual:empty { display: none; }
.pay-coin { width: 44px; height: 44px; border-radius: 50%; }
.ripple { position: relative; width: 44px; height: 44px; }
.ripple .ring { position: absolute; inset: 0; border: 2px solid var(--brand); border-radius: 50%; animation: ripple 2.2s ease-out infinite; }
.ripple .ring:nth-child(2) { animation-delay: 1.1s; }
.ripple .pay-coin { position: relative; }
.coin-badge { position: relative; }
.badge-check { position: absolute; right: -4px; bottom: -4px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; animation: pop 0.4s 0.2s both; }
.transfer { position: relative; width: 120px; height: 0; border-top: 2px dashed var(--line); }
.transfer i { position: absolute; top: -6px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: dot-move 1.6s ease-in-out infinite; }
.pay-progress { position: relative; height: 4px; margin-top: 16px; border-radius: 2px; background: var(--line); overflow: hidden; }
.pay-progress::after { content: ""; position: absolute; top: 0; bottom: 0; width: 35%; border-radius: 2px; background: var(--brand); animation: indeterminate 1.6s ease-in-out infinite; }
.pay-wait { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 16px; font-size: var(--fs-14); color: var(--ink-2); }
.pay-elapsed { font-family: var(--mono); font-size: var(--fs-16); color: var(--ink); font-variant-numeric: tabular-nums; }
.pay-slow { margin: 12px 0 0; font-size: var(--fs-14); color: var(--amber); }
.pay-ok { color: var(--up); }
.timeline-item.current::before { animation: ring-pulse 2s ease-out infinite; }

/* Куда получает клиент: те же панели, что у способов получения батов */
.payout-panel { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); }
.payout-panel .field:last-child { margin-bottom: 0; }
.payout-panel .saved-list { margin-bottom: 12px; }
.payout-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 760px) { .payout-grid-2 { grid-template-columns: minmax(0, 1fr); } }
.status-sent { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }

/* Отмена заявки */
.cancel-box { margin-top: 4px; }
.cancel-link { padding: 0; border: 0; background: none; color: var(--ink-2); font-size: var(--fs-14); text-decoration: underline; cursor: pointer; min-height: 32px; }
.cancel-link:hover { color: var(--ink); }
.cancel-confirm { padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--paper); animation: rise 0.25s ease-out; }
.cancel-confirm p { margin: 0 0 12px; font-size: var(--fs-14); }
.cancel-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.btn.cancel-yes { background: var(--solid); }
.btn.cancel-yes:hover { background: var(--solid-hover); }

/* Согласие на публикацию отзыва */
.review-consent { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 4px; font-size: var(--fs-14); color: var(--ink-2); line-height: 1.45; cursor: pointer; }
.review-consent input { flex: none; width: 18px; height: 18px; margin-top: 2px; }

/* Всплывающая подсказка, например «Где найти QR-код?» */
.popover { position: relative; }
.popover > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; color: var(--brand); font-size: var(--fs-14); font-weight: 500; white-space: nowrap; }
.popover > summary::-webkit-details-marker { display: none; }
.popover > summary:hover { text-decoration: underline; }
.popover > summary::before { content: "?"; flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 11px; font-weight: 700; }
.popover-panel { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: 300px; max-width: calc(100vw - 32px); padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 10px 28px rgba(var(--shadow-rgb), 0.18); font-size: var(--fs-14); color: var(--ink); }
.popover-panel ol { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 6px; }
.popover-panel .qr-help-note { color: var(--ink-2); font-size: 0.75rem; margin: 0 0 10px; }
.popover-panel a { font-weight: 600; color: var(--brand); }
