/* S-Pay · Semaka Payment — тёмная матовая тема */

:root {
  --text: #e5e5e7;
  --text-muted: #9ca3af;
  --surface: #18181b;
  --surface-2: #1f1f23;
  --border: #27272a;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --accent: #60a5fa;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 10px;
  --radius-sm: 8px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* ——— Штора загрузки (поиск реквизитов) ——— */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0c;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash.splash-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-inner {
  text-align: center;
  padding: 40px 24px;
}

.splash-logo {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  color: var(--primary);
}

.splash-logo svg {
  width: 100%;
  height: 100%;
}

.splash-name {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 4px;
}

.splash-tagline {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0 0 32px;
}

.splash-status {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.splash-dots span {
  animation: splashDot 0.6s ease-in-out infinite both;
}

.splash-dots span:nth-child(1) { animation-delay: 0s; }
.splash-dots span:nth-child(2) { animation-delay: 0.2s; }
.splash-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes splashDot {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

.splash-loader {
  width: 40px;
  height: 3px;
  margin: 0 auto;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.splash-loader::before {
  content: '';
  display: block;
  width: 40%;
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  animation: splashLoader 1.2s ease-in-out infinite;
}

@keyframes splashLoader {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(125%); }
  100% { transform: translateX(-100%); }
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: #161618;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

body:not(.order-from-link) {
  background: linear-gradient(165deg, #0f0f12 0%, #16161a 35%, #1a1a20 100%);
  background-attachment: fixed;
}

body:not(.order-from-link) .page {
  max-width: 520px;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 48px) clamp(20px, 5vw, 32px);
  padding-bottom: max(clamp(28px, 6vw, 48px), env(safe-area-inset-bottom));
  animation: pageIn 0.5s var(--ease-out) forwards;
}

@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ——— Бренд: S-Pay · Semaka Payment ——— */
.brand-header {
  text-align: center;
  margin-bottom: clamp(24px, 4vw, 32px);
}

body:not(.order-from-link) .brand-header {
  margin-bottom: clamp(20px, 4vw, 28px);
}

.brand-mark {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--primary);
}

.brand-icon svg {
  width: 100%;
  height: 100%;
}

.brand-titles {
  line-height: 1.2;
}

.brand-name {
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 2px;
}

.brand-tagline {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

body:not(.order-from-link) .brand-tagline {
  color: var(--text-muted);
  opacity: 0.9;
}

/* ——— Карточка суммы ——— */
.operation-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: clamp(20px, 4vw, 36px);
  padding: clamp(18px, 4vw, 24px) clamp(18px, 4vw, 24px) clamp(18px, 4vw, 24px) clamp(20px, 4vw, 28px);
  background: #0d0d0f;
  border-radius: var(--radius);
  border: 1px solid #1a1a1d;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  position: relative;
  overflow: hidden;
}

.operation-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  border-radius: 3px 0 0 3px;
}

@keyframes cardIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.operation-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.operation-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.operation-amount {
  font-size: clamp(1.5rem, 4.5vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.operation-amount .currency {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

.btn-ghost {
  align-self: flex-start;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  padding: 10px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: color 0.2s, transform 0.15s;
}

.btn-ghost:hover { color: var(--primary-dark); text-decoration: underline; }
.btn-ghost:active { transform: scale(0.98); }

.btn-ghost-subtle {
  font-size: 0.875rem;
  opacity: 0.85;
}
.btn-ghost-subtle:hover { opacity: 1; }

/* ——— Секция способов оплаты ——— */
/* Лендинг без заявки: показываем S-Pay и Telegram; с заявкой — форму оплаты */
.order-content {
  display: none;
}
.landing-block {
  display: block;
}
body.order-from-link .landing-block {
  display: none;
}
body.order-from-link .order-content {
  display: block;
}

/* ——— Главная (без заявки): современный лендинг ——— */
.landing-wrap {
  text-align: center;
  padding: clamp(28px, 5vw, 40px) clamp(20px, 4vw, 28px);
  margin: clamp(16px, 3vw, 28px) auto 0;
  max-width: 100%;
  background: rgba(28, 28, 32, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.03);
}
.landing-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 16px;
  padding: 6px 12px;
  background: rgba(59, 130, 246, 0.12);
  border-radius: 6px;
}
.landing-title {
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin: 0 0 14px;
  color: var(--text);
}
.landing-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.6;
  max-width: 42ch;
  margin-left: auto;
  margin-right: auto;
}
.landing-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  margin-bottom: 28px;
}
.landing-feature {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}
.landing-feature-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.9;
}
.landing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #0088cc 0%, #006699 100%);
  border-radius: 12px;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.4);
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}
.landing-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.45);
  filter: brightness(1.05);
}
.landing-cta:active {
  transform: translateY(0);
}
.landing-cta-icon {
  flex-shrink: 0;
}
.landing-support {
  margin: 20px 0 0;
  font-size: 0.9rem;
}
.landing-support a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.landing-support a:hover {
  color: var(--primary);
}
.landing-contacts {
  margin-top: 32px;
  padding: 20px;
  background: rgba(24, 24, 28, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.landing-contacts-title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.landing-contacts-text {
  font-size: 0.9375rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.landing-contacts-text a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity 0.15s;
}
.landing-contacts-text a:hover {
  opacity: 0.9;
  text-decoration: underline;
}

body:not(.order-from-link) .footer-anchors {
  display: none;
}

/* Реквизиты на странице заявки — только то, что предоставил трейдер (одна карта/СБП) */
.order-requisites-card {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--surface-2, #1f1f23);
  border-radius: var(--radius, 10px);
  border: 1px solid var(--border, #27272a);
}
.order-requisites-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px;
}
.order-requisites-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.order-requisites-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}
.order-requisites-row dt {
  flex: 0 0 90px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
  font-weight: 500;
}
.order-requisites-row dd {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.order-requisites-row-card .order-req-card-val {
  font-weight: 600;
  letter-spacing: 0.02em;
}
.order-req-comment {
  font-size: 0.875rem;
  padding: 2px 6px;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}
.btn-copy-inline {
  padding: 4px 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
  background: transparent;
  border: 1px solid var(--primary);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.btn-copy-inline:hover {
  background: var(--primary);
  color: #fff;
}

/* ——— Крупное предупреждение: чек обязателен, срок оплаты ——— */
.order-warning-block,
.pay-warning-block {
  margin-bottom: 24px;
  padding: 20px;
  background: rgba(220, 38, 38, 0.12);
  border: 2px solid rgba(220, 38, 38, 0.5);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.2);
}
.order-warning-title,
.pay-warning-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fca5a5;
  margin: 0 0 12px;
}
.order-warning-text,
.pay-warning-text {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #fecaca;
  margin: 0 0 10px;
}
.order-warning-text:last-child,
.pay-warning-text:last-child {
  margin-bottom: 0;
}

/* После оплаты — на странице заявки: загрузить чек и «Я оплатил» */
.order-after-pay {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--surface-2, #1f1f23);
  border-radius: var(--radius, 10px);
  border: 1px solid var(--border, #27272a);
}
.order-after-pay-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.order-after-pay-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.45;
}
.order-upload-area {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: var(--surface, #18181b);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.order-upload-area:hover,
.order-upload-area.is-dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}
.order-upload-area.has-file {
  border-style: solid;
  border-color: var(--primary);
}
.order-upload-placeholder {
  font-size: 0.9375rem;
  color: var(--text-muted);
}
.order-upload-filename {
  font-size: 0.875rem;
  color: var(--primary);
}
.order-upload-area .upload-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}
.order-btn-paid {
  width: 100%;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
}
.order-btn-paid:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Скрыть блок выбора способов при открытии по ссылке заявки (?order=ID) */
.section.hide-when-order-from-link,
body.order-from-link .methods-section {
  display: none;
}

.section {
  margin-bottom: 24px;
}

.section-title {
  margin-bottom: 16px;
}

.section-title-text {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.methods-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 380px) {
  .methods-grid { gap: 14px; }
}

@media (min-width: 420px) {
  .methods-grid { gap: 16px; }
}

.method-card {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 18px 14px;
  background: #0d0d0f;
  border: 1px solid #1a1a1d;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  font-family: var(--font);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  animation: cardIn 0.5s var(--ease-out) backwards;
}

.method-card-cards {
  padding: 16px 12px;
}

.method-card-cards .method-icons-cards {
  min-height: 44px;
  padding: 8px 0;
  gap: 12px;
}

.method-card-cards .method-icon-img.visa {
  height: 18px;
  width: 54px;
}

.method-card-cards .method-icon-img.mir {
  height: 30px;
  width: 30px;
}

/* Обёртка: скелетоны, затем карточки */
.methods-wrapper {
  position: relative;
  min-height: 200px;
}

.methods-skeletons {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  pointer-events: none;
}

@media (min-width: 380px) {
  .methods-skeletons { gap: 14px; }
}
@media (min-width: 420px) {
  .methods-skeletons { gap: 16px; }
}

.method-skeleton {
  background: linear-gradient(90deg, #0d0d0f 0%, #161618 50%, #0d0d0f 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius-sm);
  min-height: 88px;
  border: 1px solid var(--border);
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.methods-wrapper .methods-grid {
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.methods-wrapper.loaded .methods-skeletons {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.methods-wrapper.loaded .methods-grid {
  opacity: 1;
  position: relative;
}

.methods-grid .method-card:nth-child(n) { animation-delay: 0.1s; }

.method-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.3);
  background: #111113;
}

.method-card:active {
  transform: translateY(-1px);
  transition-duration: 0.1s;
}

.method-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.method-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 40px;
  flex-wrap: wrap;
}

.method-icons-phone {
  color: var(--text-muted);
}

.method-icons-phone svg {
  width: 32px;
  height: 32px;
}

.method-icon-img {
  display: block;
  object-fit: contain;
  height: auto;
}

.method-icon-img.visa { height: 16px; width: 48px; }
.method-icon-img.mir { height: 28px; width: 28px; }
.method-icon-img.sbp { height: 40px; width: auto; max-width: 36px; }
.method-icon-img.sbp-qr { height: 38px; width: 38px; }

.method-label {
  font-size: clamp(0.875rem, 2.2vw, 0.9375rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.method-hint {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.2;
}

/* Блок «Безопасно» под способами оплаты */
.safe-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.safe-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.safe-icon svg {
  width: 100%;
  height: 100%;
}

/* ——— Подвал ——— */
.footer {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: auto;
  padding-top: clamp(20px, 4vw, 24px);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

body:not(.order-from-link) .footer {
  padding-top: clamp(28px, 5vw, 36px);
  border-top-color: rgba(255, 255, 255, 0.06);
}

.footer-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 2;
}

.footer-copy {
  font-weight: 500;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: stretch;
  position: relative;
  z-index: 2;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font);
  transition: color 0.2s;
  padding: 12px 6px;
  min-height: 48px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  outline: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.footer-link:hover,
.footer-link:focus {
  color: var(--primary);
}

.footer-link:active {
  opacity: 0.9;
  color: var(--primary);
}

.footer-anchors {
  padding: 24px 0 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.footer-anchor-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}

.footer-anchor-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.footer-anchor-text a {
  color: var(--primary);
  text-decoration: none;
}

.footer-anchor-text a:hover { text-decoration: underline; }

.footer-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: inherit;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  padding: 10px 0;
  min-height: 44px;
  cursor: pointer;
  transition: color 0.2s, transform 0.15s;
}

.footer-help:hover { color: var(--primary-dark); text-decoration: underline; }
.footer-help:active { transform: scale(0.98); }

.footer-help-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

/* ——— Модальные окна ——— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0.25s;
  -webkit-overflow-scrolling: touch;
}

.modal[aria-hidden="false"],
.modal:not([hidden]) {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: backdropIn 0.25s ease-out;
}

@keyframes backdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.35s var(--ease-out) forwards;
}

.modal-dialog-lg { max-width: 440px; }

.modal-dialog-payment {
  max-width: 400px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.modal-dialog-legal {
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-body-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.legal-content {
  padding: 4px 0 24px;
}

.legal-section {
  margin-bottom: 24px;
}

.legal-section:last-of-type { margin-bottom: 16px; }

.legal-section h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.3;
}

.legal-section p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 10px;
}

.legal-section p:last-child { margin-bottom: 0; }

.legal-footer-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 16px 0 0 !important;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.modal-head-light {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.payment-head-method {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.payment-timer-inline {
  margin-right: auto;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm, 8px);
  background: rgba(59, 130, 246, 0.15);
  min-width: 4.5em;
  text-align: center;
}
.payment-timer-inline.is-warning {
  color: #d97706;
  background: rgba(245, 158, 11, 0.18);
}
.payment-timer-inline.is-expired {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.15);
}

.payment-body {
  padding: 24px 20px;
}

.pay-hero {
  text-align: center;
  margin-bottom: 24px;
  padding: 20px 16px;
  background: var(--surface-2, #1f1f23);
  border-radius: var(--radius, 10px);
  border: 1px solid var(--border, #27272a);
}

.pay-hero-sum {
  display: block;
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 6px;
}

.pay-hero-currency {
  font-size: 0.75em;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

.pay-hero-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.pay-details {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--surface-2, #1f1f23);
  border-radius: var(--radius, 10px);
  border: 1px solid var(--border, #27272a);
}

.pay-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
  opacity: 0;
  animation: payLineIn 0.35s var(--ease) forwards;
}
.pay-line[data-field="cardOrSbp"] .pay-line-val {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.pay-line:nth-child(1) { animation-delay: 0.05s; }
.pay-line:nth-child(2) { animation-delay: 0.12s; }
.pay-line:nth-child(3) { animation-delay: 0.19s; }
.pay-line:nth-child(4) { animation-delay: 0.26s; }

@keyframes payLineIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.pay-line:last-child { border-bottom: none; }

.pay-line-label {
  flex: 0 0 72px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.pay-line-val {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}

.pay-copy {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%233b82f6' stroke-width='2'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1'/%3E%3C/svg%3E");
  background-size: 18px;
  background-position: center;
  background-repeat: no-repeat;
}

.pay-copy:hover { opacity: 1; background-color: rgba(59, 130, 246, 0.12); }

.payment-body .btn-primary { margin-bottom: 20px; }

.pay-upload {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pay-upload-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  width: 100%;
}

.pay-upload-area {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.pay-upload-area:hover,
.pay-upload-area.is-dragover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.06);
}

.upload-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.pay-upload-placeholder,
.pay-upload-name {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.pay-upload-area.has-file .pay-upload-placeholder { display: none; }
.pay-upload-area.has-file .pay-upload-name { display: inline; color: var(--text); font-weight: 500; }

.btn-ghost-sm {
  padding: 10px 16px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}

.btn-ghost-sm:hover:not(:disabled) { background: rgba(59, 130, 246, 0.1); }
.btn-ghost-sm:disabled { opacity: 0.4; cursor: not-allowed; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.modal-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -8px -8px -8px 0;
  background: var(--surface-2);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.2s, color 0.2s;
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

.detail-row,
.contact-row {
  margin-bottom: 12px;
  font-size: 0.9375rem;
}

.detail-row:last-child,
.contact-row:last-child { margin-bottom: 0; }

.contact-row-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.contact-row-link .contact-icon {
  flex-shrink: 0;
}

.contact-icon-inline {
  vertical-align: middle;
  margin-right: 4px;
}

.detail-muted {
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.status-wait {
  color: var(--primary);
  font-weight: 600;
}

.btn-copy {
  margin-left: 8px;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-family: var(--font);
  font-weight: 600;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.15);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.btn-copy:hover {
  background: rgba(56, 189, 248, 0.25);
  color: var(--primary-dark);
}

.copy-feedback {
  margin-left: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  min-width: 0;
  transition: opacity 0.2s;
}

.copy-feedback.is-active {
  animation: copyFeedbackIn 0.2s ease;
}

@keyframes copyFeedbackIn {
  from { opacity: 0; transform: translateY(-2px); }
  to { opacity: 1; transform: translateY(0); }
}

.method-confirm-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.amount-large {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.btn {
  display: inline-block;
  padding: 14px 24px;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background 0.25s var(--ease), transform 0.15s;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.btn-primary:active { transform: scale(0.98); }

.btn-block { width: 100%; margin-top: 16px; }

.modal-body a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.modal-body a:hover { text-decoration: underline; }

/* ——— Собственное уведомление (toast) ——— */
.toast {
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  max-width: calc(100% - 32px);
  width: min(360px, calc(100% - 24px));
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s;
  z-index: 1100;
}

.toast.toast-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.toast-text {
  flex: 1;
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  padding: 8px 16px;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(59, 130, 246, 0.15);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.toast-close:hover {
  background: rgba(59, 130, 246, 0.25);
  color: var(--primary-dark);
}

/* ——— Экран «Оплата получена» ——— */
.payment-received {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}

.payment-received.is-visible {
  opacity: 1;
  visibility: visible;
}

.payment-received-inner {
  text-align: center;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 320px;
  animation: paymentReceivedIn 0.4s var(--ease);
}

@keyframes paymentReceivedIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.payment-received-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-size: 1.75rem;
  font-weight: 700;
  border-radius: 50%;
  line-height: 1;
}

.payment-received-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.payment-received-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

/* ——— Страница деталей платежа (details.html) ——— */
.content-details-page {
  max-width: 480px;
  margin: 0 auto;
}

.details-back {
  margin-bottom: 20px;
}

.link-back {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.link-back:hover { text-decoration: underline; }

.details-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.details-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 20px;
}

.brand-mark-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-mark-link:hover .brand-name { color: var(--primary); }

/* ——— Мобильная адаптация ——— */
@media (max-width: 480px) {
  .brand-header {
    margin-bottom: clamp(20px, 4vw, 28px);
  }

  .operation-amount {
    font-size: 1.5rem;
  }

  .method-card {
    padding: 16px 12px;
  }

  .method-card-cards {
    padding: 14px 10px;
  }

  .method-card-cards .method-icons-cards {
    min-height: 40px;
    padding: 6px 0;
  }

  .modal {
    align-items: flex-end;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .modal-dialog {
    max-height: 88vh;
    max-height: calc(100dvh * 0.88);
    border-radius: var(--radius) var(--radius) 0 0;
    animation: modalSlideUp 0.4s var(--ease-out) forwards;
  }

  .payment-body {
    padding: 20px 16px;
  }

  .pay-line {
    padding: 12px 0;
  }

  .pay-copy {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }

  .pay-upload-area {
    min-height: 48px;
  }

  .btn-ghost-sm,
  .btn-primary {
    min-height: 48px;
    padding: 12px 20px;
  }

  .toast {
    bottom: max(16px, env(safe-area-inset-bottom));
    width: calc(100% - 24px);
    max-width: none;
  }

  @keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 360px) {
  .methods-grid {
    gap: 10px;
  }

  .method-card {
    padding: 14px 10px;
  }

  .method-label {
    font-size: 0.8125rem;
  }
}
