/* =====================================================================
   Sign-in + Buy Panel Points pages. Builds on css/style.css (same colour
   variables, buttons and header), so both themes come for free.
   ===================================================================== */

.shop-body { min-height: 100vh; display: flex; flex-direction: column; }
.shop-main { flex: 1; padding: clamp(28px, 5vw, 56px) 0 64px; }

.shop-nav { display: flex; align-items: center; gap: 18px; }
.shop-nav a:not(.btn) { color: var(--muted); font-weight: 500; font-size: 0.95rem; }
.shop-nav a:not(.btn):hover, .shop-nav a.active { color: var(--text); }
.account-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px;
  border: 1px solid var(--border-strong); border-radius: 999px; font-size: 0.9rem; color: var(--text);
}
.account-chip button {
  border: 0; background: var(--surface-2); color: var(--muted); border-radius: 999px;
  padding: 5px 12px; font: inherit; font-size: 0.82rem; cursor: pointer;
}
.account-chip button:hover { color: var(--text); }

/* ---------- sign-in ---------- */
.auth-shell { display: grid; place-items: center; padding: clamp(24px, 6vw, 72px) 16px; flex: 1; }
.auth-panel {
  width: 100%; max-width: 440px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
  padding: clamp(28px, 5vw, 44px); box-shadow: var(--shadow);
}
.auth-panel .brand-mark { width: 56px; height: 56px; margin: 0 auto 18px; display: block; }
.auth-panel h1 { font-family: var(--font-head); font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 0 0 10px; letter-spacing: -0.02em; }
.auth-panel p { color: var(--muted); margin: 0 0 26px; line-height: 1.6; }
.btn-telegram-login { width: 100%; justify-content: center; gap: 10px; font-size: 1.02rem; padding: 1rem 1.4rem; }
.btn-telegram-login svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.auth-fine { font-size: 0.85rem; color: var(--muted); margin-top: 20px !important; margin-bottom: 0 !important; }
.auth-fine a { color: var(--gold-2); }

.alert {
  border-radius: 12px; padding: 12px 14px; margin: 0 0 18px; font-size: 0.92rem; text-align: left; line-height: 1.5;
  background: rgba(248, 113, 113, 0.1); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.25);
}
.alert.info { background: rgba(255, 185, 13, 0.08); color: var(--gold-2); border-color: rgba(255, 185, 13, 0.25); }
.alert.ok { background: rgba(37, 211, 102, 0.1); color: #6ee7a0; border-color: rgba(37, 211, 102, 0.3); }
[data-theme="light"] .alert { color: #b42318; }
[data-theme="light"] .alert.info { color: #d59700; }
[data-theme="light"] .alert.ok { color: #0f7a3d; }

/* ---------- buy page ---------- */
.shop-head { margin-bottom: 28px; }
.shop-head h1 { font-family: var(--font-head); font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -0.03em; margin: 8px 0 10px; }
.shop-head p { color: var(--muted); max-width: 62ch; margin: 0; line-height: 1.6; }

.buy-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.shop-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: clamp(20px, 3vw, 28px);
}
.shop-card h2 { font-family: var(--font-head); font-size: 1.15rem; margin: 0 0 18px; letter-spacing: -0.01em; }

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.field label { font-weight: 600; font-size: 0.92rem; }
.field .hint { color: var(--muted); font-size: 0.82rem; }
.field select, .field input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 12px; padding: 13px 14px;
}
.field select:focus, .field input:focus { outline: 0; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 185, 13, 0.18); }
.field input.points-input { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  border: 1px solid var(--border-strong); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 0.85rem; cursor: pointer;
}
.chips button:hover { color: var(--text); border-color: var(--gold); }

.breakdown { display: flex; flex-direction: column; gap: 0; margin: 0 0 18px; }
.breakdown .row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--border-strong); font-size: 0.95rem; }
.breakdown .row span:first-child { color: var(--muted); }
.breakdown .row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 6px 0 18px; }
.total .lbl { color: var(--muted); font-weight: 600; }
.total .amt { font-family: var(--font-head); font-size: clamp(1.9rem, 5vw, 2.4rem); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.total .amt small { font-size: 0.95rem; font-weight: 600; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.pay-btn { width: 100%; justify-content: center; }
.pay-btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.fine { color: var(--muted); font-size: 0.82rem; line-height: 1.55; margin: 12px 0 0; }

/* ---------- payment status ---------- */
.pay-card { margin-top: 22px; }
.pay-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px;
  font-size: 0.8rem; font-weight: 700; text-transform: capitalize; background: var(--surface-2); color: var(--muted);
}
.pill.pending, .pill.confirming, .pill.confirmed, .pill.creating { background: rgba(250, 204, 21, 0.12); color: #facc15; }
.pill.completed { background: rgba(37, 211, 102, 0.14); color: #4ade80; }
.pill.expired, .pill.failed, .pill.cancelled, .pill.partially_paid { background: rgba(248, 113, 113, 0.12); color: #f87171; }
[data-theme="light"] .pill.pending, [data-theme="light"] .pill.confirming, [data-theme="light"] .pill.confirmed { color: #a16207; }
[data-theme="light"] .pill.completed { color: #15803d; }
[data-theme="light"] .pill.expired, [data-theme="light"] .pill.failed, [data-theme="light"] .pill.partially_paid { color: #b42318; }
.addr {
  display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: 12px; padding: 12px 14px; margin: 8px 0 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem;
}
.addr span { flex: 1; word-break: break-all; }
.addr button { flex-shrink: 0; }
.pay-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.countdown { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 0.9rem; }

/* ---------- my orders ---------- */
.orders { margin-top: 28px; }
.table-scroll { overflow-x: auto; }
.orders table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.orders th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 10px 12px; border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
.orders td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: nowrap; }
.orders td.num { text-align: right; font-variant-numeric: tabular-nums; }
.orders tr.clickable { cursor: pointer; }
.orders tr.clickable:hover td { background: var(--surface-2); }
.orders .empty { color: var(--muted); padding: 24px 0; text-align: center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; }

@media (max-width: 860px) {
  .buy-grid { grid-template-columns: 1fr; }
  .shop-nav .hide-sm { display: none; }
}

[hidden] { display: none !important; }
.shop-nav a { text-decoration: none; }

/* ---------- on-site payment: QR, amount, address, then success ---------- */
.pay-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; margin: 4px 0 18px; }
.qr-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr-box { width: 220px; max-width: 100%; aspect-ratio: 1; background: #fff; border-radius: 16px; padding: 10px; }
.qr-box svg { display: block; width: 100%; height: 100%; }
.qr-caption { font-size: 0.82rem; color: var(--muted); }
.pay-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pay-field { display: flex; flex-direction: column; gap: 6px; }
.pay-label { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.copy-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pay-amount { font-family: var(--font-head); font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pay-note { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
.pay-col .addr { margin: 0; }
.pay-meta { display: flex; flex-direction: column; gap: 8px; }
.countdown-big { font-weight: 700; font-variant-numeric: tabular-nums; }
.live-dot { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); }
.live-dot i { width: 8px; height: 8px; border-radius: 50%; background: #facc15; animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.order-lines { margin-bottom: 16px; }

.paid-view { text-align: center; padding: 18px 8px 24px; }
.paid-check { width: 76px; height: 76px; margin: 0 auto 14px; }
.paid-check svg { width: 100%; height: 100%; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.paid-check circle { stroke: #25d366; fill: rgba(37, 211, 102, 0.12); }
.paid-check path { stroke: #25d366; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw-check 0.5s 0.15s ease-out forwards; }
@keyframes draw-check { to { stroke-dashoffset: 0; } }
.paid-view h3 { font-family: var(--font-head); font-size: 1.6rem; margin: 0 0 8px; letter-spacing: -0.02em; }
.paid-view p { color: var(--muted); max-width: 56ch; margin: 0 auto; line-height: 1.6; }

@media (max-width: 640px) {
  .pay-grid { grid-template-columns: 1fr; }
  .qr-box { width: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot i, .paid-check path { animation: none; stroke-dashoffset: 0; }
}

.qr-warning {
  margin: 0; padding: 10px 12px; border-radius: 10px; font-size: 0.86rem; line-height: 1.5;
  background: rgba(250, 204, 21, 0.1); border: 1px solid rgba(250, 204, 21, 0.3); color: #fde68a;
}
[data-theme="light"] .qr-warning { color: #854d0e; }

.network-warning {
  margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 0.88rem; line-height: 1.5; font-weight: 500;
  background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.45); color: #fecaca;
}
.network-warning strong { color: #fff; }
[data-theme="light"] .network-warning { color: #991b1b; }
[data-theme="light"] .network-warning strong { color: #7f1d1d; }
