/* /pay/ — публичная страница продления.
   Подключает /lk/styles.css как базу (палитра, фон-grid, scan-line, шапка),
   добавляет лендинг-стилистику (большой hero, неон-карточки, electric-blue glow). */

.pay-wrap {
  position: relative; z-index: 10;
  min-height: 100vh;
  padding: calc(var(--header-h) + 32px) 16px 60px;
  display: flex; flex-direction: column; align-items: center;
}

#root { width: 100%; max-width: 540px; }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 28px;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  border: 1px solid rgba(59,130,246,0.35);
  border-radius: 999px;
  background: rgba(59,130,246,0.08);
  font-size: 12px; letter-spacing: 0.05em;
  color: #9DB7E8;
  margin-bottom: 16px;
}
.hero-eyebrow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: #3B82F6;
  box-shadow: 0 0 8px #3B82F6;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 8vw, 52px);
  letter-spacing: 0.02em;
  line-height: 1;
  background: linear-gradient(180deg, #ffffff 0%, #5BA8FF 60%, #1E40AF 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(59,130,246,0.35);
  margin-bottom: 6px;
}
.hero-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 380px;
  margin: 0 auto;
}

/* ── Card ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  backdrop-filter: blur(8px);
}
.card + .card { margin-top: 14px; }
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 14px;
  color: var(--foreground);
}

/* ── Inputs ─────────────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}
.input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--foreground);
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  outline: none;
  border-color: rgba(59,130,246,0.6);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.input::placeholder { color: rgba(255,255,255,0.3); }

/* ── Button ─────────────────────────────────────────────────────────────── */
.btn {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary {
  background: linear-gradient(135deg, #1E90FF, #3B82F6);
  color: #fff;
  box-shadow: 0 4px 24px rgba(59,130,246,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:hover  { box-shadow: 0 6px 32px rgba(59,130,246,0.55), inset 0 1px 0 rgba(255,255,255,0.2); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--foreground);
  border: 1px solid var(--border);
}
.btn-ghost:hover  { background: rgba(255,255,255,0.07); }
.btn-tg {
  background: linear-gradient(135deg, #2AABEE, #229ED9);
  color: #fff;
  box-shadow: 0 4px 18px rgba(42,171,238,0.35);
}

/* ── Tariffs ────────────────────────────────────────────────────────────── */
.tariffs { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 18px; }
.tariff {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.2s;
  overflow: hidden;
}
.tariff::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: 14px;
  padding: 1px;
  background: linear-gradient(135deg, transparent, transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
}
.tariff:hover { background: rgba(255,255,255,0.045); }
.tariff[data-plan="1m"]::before  { background: linear-gradient(135deg, #3B82F6, #1E90FF); }
.tariff[data-plan="3m"]::before  { background: linear-gradient(135deg, #8B5CF6, #6366F1); }
.tariff[data-plan="12m"]::before { background: linear-gradient(135deg, #FF9F43, #FF6B35); }
.tariff.selected {
  background: rgba(59,130,246,0.08);
  border-color: transparent;
}
.tariff.selected::before { opacity: 1; }
.tariff.selected[data-plan="3m"]  { background: rgba(139,92,246,0.08); }
.tariff.selected[data-plan="12m"] { background: rgba(255,159,67,0.08); }

.tariff-radio {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s;
}
.tariff.selected .tariff-radio { border-color: #3B82F6; }
.tariff.selected[data-plan="3m"]  .tariff-radio { border-color: #8B5CF6; }
.tariff.selected[data-plan="12m"] .tariff-radio { border-color: #FF9F43; }
.tariff.selected .tariff-radio::after {
  content: '';
  position: absolute; inset: 3px;
  border-radius: 50%;
  background: currentColor;
}
.tariff.selected[data-plan="1m"]  .tariff-radio { color: #3B82F6; }
.tariff.selected[data-plan="3m"]  .tariff-radio { color: #8B5CF6; }
.tariff.selected[data-plan="12m"] .tariff-radio { color: #FF9F43; }

.tariff-info { flex: 1; min-width: 0; }
.tariff-name { font-weight: 700; font-size: 16px; color: var(--foreground); }
.tariff-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tariff-price { text-align: right; flex-shrink: 0; }
.tariff-price-amount { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.tariff-price-month { font-size: 11px; color: var(--muted); margin-top: 2px; }

.tariff-badge {
  position: absolute; top: -1px; right: 12px;
  padding: 3px 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  border-radius: 0 0 6px 6px;
  background: linear-gradient(135deg, #FF9F43, #FF6B35);
  color: #000;
}

/* ── Devices ────────────────────────────────────────────────────────────── */
.devices {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: rgba(255,255,255,0.025);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 14px;
}
.devices-info { font-size: 14px; }
.devices-info b { color: var(--foreground); font-weight: 600; }
.devices-info small { color: var(--muted); display: block; margin-top: 2px; font-size: 11px; }
.devices-ctrl { display: flex; align-items: center; gap: 10px; }
.devices-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--foreground);
  font-size: 18px; font-weight: 600;
  cursor: pointer;
}
.devices-btn:hover:not(:disabled) { background: rgba(59,130,246,0.15); border-color: rgba(59,130,246,0.5); }
.devices-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.devices-count { min-width: 24px; text-align: center; font-weight: 600; font-size: 16px; }

/* ── Promo ──────────────────────────────────────────────────────────────── */
.promo-row { display: flex; gap: 8px; }
.promo-row .input { flex: 1; }
.promo-row .btn { width: auto; padding: 0 16px; flex-shrink: 0; }
.promo-applied {
  font-size: 13px; color: var(--success);
  margin-top: 8px;
  display: flex; align-items: center; gap: 6px;
}

/* ── Total ──────────────────────────────────────────────────────────────── */
.total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(34,211,238,0.06));
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 14px;
  margin-bottom: 14px;
}
.total-label { font-size: 14px; color: var(--muted); }
.total-amount {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  background: linear-gradient(180deg, #ffffff, #9DB7E8);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.total-old {
  color: rgba(255,255,255,0.4);
  text-decoration: line-through;
  font-size: 14px;
  margin-right: 8px;
}

/* ── States ─────────────────────────────────────────────────────────────── */
.user-found {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.25);
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 13px;
}
.user-found-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 50%;
  background: rgba(74,222,128,0.15);
  color: var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.user-found-text b { color: var(--foreground); }
.user-found-text small { color: var(--muted); display: block; margin-top: 2px; font-size: 11px; }

.error-box {
  padding: 12px 14px;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: 10px;
  color: var(--danger);
  font-size: 13px;
  margin-top: 10px;
}

.help-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.5;
  text-align: center;
}
.help-text a { color: #5BA8FF; text-decoration: none; }
.help-text a:hover { text-decoration: underline; }

.muted-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}
.muted-link:hover { color: var(--foreground); }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal (lookup popup) ───────────────────────────────────────────────── */
.modal-stack {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  width: 100%; max-width: 460px; margin: 0 auto;
}
.modal-backdrop {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(59,130,246,0.18), transparent 70%),
    rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 0;
  pointer-events: none;
}
.modal {
  position: relative; z-index: 1;
  width: 100%;
  background: rgba(12,18,32,0.92);
  border: 1px solid rgba(59,130,246,0.22);
  border-radius: 20px;
  padding: 26px 22px 22px;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.6),
    0 0 0 1px rgba(59,130,246,0.08),
    inset 0 1px 0 rgba(255,255,255,0.05);
  text-align: center;
}
.modal-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(59,130,246,0.25), rgba(34,211,238,0.15));
  border: 1px solid rgba(59,130,246,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 24px rgba(59,130,246,0.3);
}
.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--foreground);
  margin-bottom: 8px;
}
.modal-sub {
  color: rgba(255,255,255,0.7);
  font-size: 14px; line-height: 1.5;
  margin-bottom: 18px;
}
.modal-sub b { color: var(--foreground); font-weight: 600; }

.hint-list {
  text-align: left;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,0.78);
}
.hint-row {
  display: flex; gap: 10px;
  align-items: flex-start;
}
.hint-row + .hint-row { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(255,255,255,0.06); }
.hint-bullet {
  flex-shrink: 0;
  font-weight: 700;
  color: #5BA8FF;
  font-size: 14px;
  margin-top: 1px;
}
.hint-list b { color: var(--foreground); font-weight: 600; }
.hint-list code,
.modal code,
.help-text code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.2);
  padding: 1px 6px;
  border-radius: 5px;
  color: #9DB7E8;
}

/* mobile fine-tune */
@media (max-width: 480px) {
  .pay-wrap { padding: calc(var(--header-h) + 20px) 12px 40px; }
  .card { padding: 18px; border-radius: 14px; }
  .hero h1 { font-size: 36px; }
  .modal { padding: 22px 18px 18px; border-radius: 18px; }
  .modal-title { font-size: 19px; }
}
