/*
  Shop pages: plan picker (product page), cart lines, invoice, payment result and renewal.
  Same black-and-gold look as the rest of the site; colours come from the variables in app.css.
*/

/* ---------------------------------------------------------------- small pieces */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border: 1px solid rgba(212, 166, 52, 0.45);
  border-radius: 999px;
  background: rgba(212, 166, 52, 0.12);
  color: var(--gold-hi);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.7;
  white-space: nowrap;
}
.chip-soft {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-weight: 500;
}
.pill-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid transparent;
}
.pill-status.is-pending { background: rgba(255, 193, 79, 0.14); border-color: rgba(255, 193, 79, 0.4); color: #ffd27a; }
.pill-status.is-done { background: rgba(120, 214, 150, 0.13); border-color: rgba(120, 214, 150, 0.4); color: #8fe0a6; }
.pill-status.is-canceled { background: rgba(255, 138, 122, 0.12); border-color: rgba(255, 138, 122, 0.4); color: #ff9c8c; }
.btn-lg {
  min-height: 56px;
  padding-inline: 34px;
  font-size: 1.05rem;
}
.steps .is-done { color: var(--ok); }
.steps .is-done span { background: rgba(143, 224, 166, 0.22); color: var(--ok); }
.hero-sub { margin: 10px 0 0; color: var(--muted); }
.cart-sub { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.cart-info h2 a { color: inherit; text-decoration: none; }
.cart-info h2 a:hover { color: var(--gold-hi); }
.price-from { color: var(--muted); font-size: 0.9rem; }

/* ---------------------------------------------------------------- plan picker */
.plans { margin-top: 54px; scroll-margin-top: calc(var(--header-h) + 20px); }
.plans-head { margin-bottom: 26px; text-align: center; }
.plans-head h2 { margin: 0 0 8px; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); }
.plans-head p { margin: 0; color: var(--muted); }
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 20px;
  align-items: stretch;
}
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 26px 22px 22px;
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.plan-card:hover { transform: translateY(-3px); border-color: rgba(212, 166, 52, 0.5); }
.plan-card.is-popular {
  border-color: rgba(212, 166, 52, 0.75);
  background: linear-gradient(180deg, rgba(212, 166, 52, 0.14), rgba(212, 166, 52, 0.03));
  box-shadow: 0 24px 60px -28px rgba(212, 166, 52, 0.55);
}
.plan-flag {
  position: absolute;
  top: -13px;
  inset-inline-start: 22px;
  padding: 3px 16px;
  border-radius: 999px;
  background: var(--gold-grad);
  color: #1a1203;
  font-size: 0.82rem;
  font-weight: 800;
}
.plan-card h3 { margin: 0; font-size: 1.35rem; }
.plan-feats {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}
.plan-feats li { position: relative; padding-inline-start: 26px; }
.plan-feats li::before {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  top: 0.5em;
  width: 6px;
  height: 11px;
  border-right: 2px solid var(--gold-hi);
  border-bottom: 2px solid var(--gold-hi);
  transform: rotate(45deg);
}
.plan-opts { display: grid; gap: 10px; margin-top: auto; }
.opt-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
}
.opt {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  padding: 12px 16px;
  padding-inline-start: 46px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.opt::before {
  content: "";
  position: absolute;
  inset-inline-start: 15px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.opt:hover { border-color: rgba(212, 166, 52, 0.55); }
.opt-radio:checked + .opt {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(212, 166, 52, 0.22), rgba(212, 166, 52, 0.07));
  box-shadow: 0 0 0 3px rgba(212, 166, 52, 0.18);
}
.opt-radio:checked + .opt::before {
  border-color: var(--gold-hi);
  background: radial-gradient(circle, var(--gold-hi) 0 4px, transparent 5px);
}
.opt-radio:focus-visible + .opt { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.opt-dur { font-weight: 800; }
.opt-price { font-weight: 800; color: var(--gold-hi); text-align: end; }
.opt-note {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}
.opt-save {
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(120, 214, 150, 0.15);
  color: #8fe0a6;
  font-size: 0.78rem;
}
.plans-foot { display: grid; justify-items: center; gap: 14px; margin-top: 30px; text-align: center; }
.plans-foot p { max-width: 560px; margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.9; }

/* ---------------------------------------------------------------- invoice */
.inv-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 26px;
  align-items: start;
}
.inv {
  position: relative;
  padding: 34px clamp(18px, 4vw, 40px) 24px;
  border: 1px solid rgba(212, 166, 52, 0.4);
  border-radius: 26px;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(212, 166, 52, 0.12), transparent 60%),
    linear-gradient(180deg, #17120a, #0e0b07);
  box-shadow: 0 30px 70px -34px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}
.inv::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--gold-grad);
}
.inv-stamp {
  position: absolute;
  top: 64px;
  left: 36%;
  padding: 6px 22px;
  border: 3px solid rgba(143, 224, 166, 0.75);
  border-radius: 14px;
  color: rgba(143, 224, 166, 0.85);
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  transform: rotate(-9deg);
  pointer-events: none;
  animation: stamp-in 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
@keyframes stamp-in { from { opacity: 0; transform: rotate(-9deg) scale(2); } to { opacity: 1; transform: rotate(-9deg) scale(1); } }
.inv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
  border-bottom: 1px dashed var(--line);
}
.inv-brand { display: flex; align-items: center; gap: 12px; }
.inv-brand .brand-mark { width: 46px; height: 46px; }
.inv-brand b { display: block; font-size: 1.25rem; }
.inv-brand small { color: var(--muted); }
.inv-meta { text-align: end; }
.inv-meta h2 { margin: 0 0 4px; font-size: 1.3rem; }
.inv-meta p { margin: 0 0 8px; color: var(--muted); font-size: 0.9rem; }
.inv-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 22px 0;
}
.inv-parties > div {
  display: grid;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}
.inv-parties span { color: var(--muted); font-size: 0.82rem; }
.inv-parties bdi { color: var(--muted); font-size: 0.9rem; }
.inv-table { display: grid; border: 1px solid var(--line-soft); border-radius: 18px; overflow: hidden; }
.inv-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 70px 150px;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
}
.inv-row + .inv-row { border-top: 1px solid var(--line-soft); }
.inv-th { background: rgba(212, 166, 52, 0.1); color: var(--gold-hi); font-size: 0.86rem; font-weight: 700; }
.inv-desc { display: grid; gap: 6px; }
.inv-desc em { display: flex; flex-wrap: wrap; gap: 6px; font-style: normal; }
.inv-line { font-weight: 800; color: var(--gold-hi); }
.inv-total { display: grid; gap: 8px; margin: 20px 0 0; margin-inline-start: auto; max-width: 380px; }
.inv-total div { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.inv-total dd, .inv-total dt { margin: 0; }
.inv-total .is-grand {
  margin-top: 6px;
  padding: 14px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(212, 166, 52, 0.25), rgba(154, 116, 24, 0.18));
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 800;
}
.inv-total .is-grand dd { color: var(--gold-hi); }
.inv-note { margin: 18px 0 0; padding: 12px 16px; border-radius: 14px; background: rgba(255, 255, 255, 0.03); color: var(--muted); }
.inv-codes { margin-top: 28px; }
.inv-codes h2, .inv-codes h3 { margin: 0 0 12px; font-size: 1.1rem; color: var(--gold-hi); }
.code-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(212, 166, 52, 0.5);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(212, 166, 52, 0.16), rgba(212, 166, 52, 0.04));
}
.code-card + .code-card { margin-top: 10px; }
.code-card small { display: block; color: var(--muted); }
.code-card code {
  padding: 8px 16px;
  border: 1px dashed rgba(212, 166, 52, 0.7);
  border-radius: 12px;
  background: #0a0806;
  color: var(--gold-hi);
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  user-select: all;
}
.inv-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------- payment panel */
.pay-panel {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  display: grid;
  gap: 16px;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
}
.pay-panel h2 { margin: 0; font-size: 1.25rem; }
.pay-amount {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(212, 166, 52, 0.25), rgba(154, 116, 24, 0.15));
}
.pay-amount span { color: var(--muted); font-size: 0.85rem; }
.pay-amount b { color: var(--gold-hi); font-size: 1.6rem; }
.pay-trust { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.92rem; }
.pay-trust li { position: relative; padding-inline-start: 26px; line-height: 1.7; }
.pay-trust li::before {
  content: "";
  position: absolute;
  inset-inline-start: 4px;
  top: 0.45em;
  width: 6px;
  height: 11px;
  border-right: 2px solid var(--ok);
  border-bottom: 2px solid var(--ok);
  transform: rotate(45deg);
}
.pay-note { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.8; }
.pay-panel .btn { width: 100%; justify-content: center; }
.pay-panel .link-btn { justify-self: center; }
.pay-done { display: grid; justify-items: center; gap: 6px; text-align: center; }
.pay-done .icon { width: 54px; height: 54px; padding: 12px; border-radius: 50%; background: rgba(143, 224, 166, 0.16); color: var(--ok); fill: none; stroke: currentColor; stroke-width: 2.4; }
.pay-done h2 { font-size: 1.15rem; }
.pay-done p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.9; }
.pay-done.is-bad h2 { color: var(--danger); }

/* ---------------------------------------------------------------- payment result */
.result { padding: clamp(110px, 12vw, 150px) 0 80px; }
.result-inner { display: grid; justify-items: center; gap: 20px; max-width: 760px; text-align: center; }
.result h1 { margin: 0; font-size: clamp(1.6rem, 1.1rem + 2vw, 2.5rem); }
.bad-text { color: var(--danger); }
.result-sub { margin: 0; color: var(--muted); line-height: 1.9; }
.result-hex { position: relative; width: 150px; height: 172px; }
.result-hex svg { width: 100%; height: 100%; overflow: visible; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hex-line {
  stroke: var(--gold);
  stroke-width: 4;
  fill: rgba(212, 166, 52, 0.09);
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: draw 1s ease forwards;
}
.tick { stroke: var(--gold-hi); stroke-width: 8; stroke-dasharray: 90; stroke-dashoffset: 90; animation: draw 0.6s 0.7s ease forwards; }
.is-bad .hex-line { stroke: #ff8a7a; fill: rgba(255, 138, 122, 0.08); }
.is-bad .tick { stroke: #ff8a7a; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.result.is-ok .result-hex { animation: pop 0.6s 0.9s ease both; filter: drop-shadow(0 0 26px rgba(212, 166, 52, 0.45)); }
@keyframes pop { 40% { transform: scale(1.08); } }
.spark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 10px;
  margin: -5px;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: var(--gold-hi);
  opacity: 0;
  animation: fly 1.4s 1.1s ease-out forwards;
}
.spark.s1 { --x: -120px; --y: -70px; }
.spark.s2 { --x: 120px; --y: -80px; }
.spark.s3 { --x: -140px; --y: 30px; }
.spark.s4 { --x: 140px; --y: 40px; }
.spark.s5 { --x: -60px; --y: 120px; }
.spark.s6 { --x: 70px; --y: 125px; }
@keyframes fly {
  0% { opacity: 1; transform: translate(0, 0) scale(0.4); }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) scale(1.3) rotate(120deg); }
}
.result-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  width: 100%;
  margin: 8px 0 0;
}
.result-facts div { padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 16px; background: rgba(255, 255, 255, 0.03); }
.result-facts dt { color: var(--muted); font-size: 0.82rem; }
.result-facts dd { margin: 4px 0 0; font-weight: 800; color: var(--gold-hi); overflow-wrap: anywhere; }
.result-facts dd[dir="ltr"] { font-size: 0.92rem; white-space: nowrap; }
.result-codes { width: 100%; text-align: start; }
.result-hint { margin: 12px 0 0; color: var(--muted); font-size: 0.88rem; line-height: 1.9; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 10px; }

/* ---------------------------------------------------------------- renewal */
.renew-wrap { display: grid; gap: 22px; max-width: 760px; }
.renew-state {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(212, 166, 52, 0.07);
}
.renew-state p { margin: 0; color: var(--muted); line-height: 1.9; }
.renew-state code { padding: 6px 14px; border: 1px dashed var(--line); border-radius: 10px; background: #0a0806; color: var(--gold-hi); font-weight: 800; letter-spacing: 0.08em; }
.renew-form h2 { margin: 0 0 14px; font-size: 1.2rem; }
.renew-opts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-top: 0; }
.renew-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 24px; }

/* ---------------------------------------------------------------- small screens and print */
@media (max-width: 900px) {
  .inv-layout { grid-template-columns: 1fr; }
  .pay-panel { position: static; order: -1; }
  .inv-row { grid-template-columns: 1fr 1fr; }
  .inv-th { display: none; }
  .inv-desc { grid-column: 1 / -1; }
  .inv-cell::before { content: attr(data-label) ": "; color: var(--muted); font-size: 0.8rem; font-weight: 400; }
  .inv-line { grid-column: 1 / -1; }
  .inv-meta { text-align: start; }
  .inv-stamp { top: auto; bottom: 120px; inset-inline-end: 14px; font-size: 1.15rem; opacity: 0.9; }
  .inv-parties { grid-template-columns: 1fr; }
  .code-card { grid-template-columns: 1fr; }
  .code-card .btn { justify-self: start; }
}
@media print {
  .site-header, .page-hero, .pay-panel, .sw, footer, .inv-foot .link-btn, [data-copy] { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .inv { border-color: #999; background: #fff; box-shadow: none; color: #000; }
  .inv * { color: #000 !important; background: transparent !important; border-color: #aaa !important; }
  .inv-layout { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .hex-line, .tick { animation: none; stroke-dashoffset: 0; }
  .spark, .inv-stamp, .result.is-ok .result-hex { animation: none; }
  .spark { display: none; }
}

.inv-facts { margin: 22px 0 0; }
.inv-facts div { background: rgba(255, 255, 255, 0.02); }

.opt-old { margin-inline-end: 8px; color: var(--muted); font-size: 0.82rem; font-weight: 400; text-decoration: line-through; }
.opt-off {
  padding: 1px 9px;
  border-radius: 999px;
  background: rgba(255, 138, 122, 0.16);
  color: #ff9c8c;
  font-size: 0.78rem;
}

/* a normal product: one card with just the lengths */
.plan-card.is-bare { padding-top: 22px; }
.plan-grid[data-plan-count="1"] { grid-template-columns: minmax(0, 460px); justify-content: center; }

.inv-code { margin: 0 0 6px !important; color: var(--gold-hi) !important; font-weight: 700; font-size: 0.92rem !important; }
.code-card.no-code { grid-template-columns: 1fr; }

.pill-status.is-paid { background: rgba(120, 180, 255, 0.14); border-color: rgba(120, 180, 255, 0.4); color: #8cc4ff; }
.pill-status.is-expired { background: rgba(255, 255, 255, 0.07); border-color: var(--line-soft); color: var(--muted); }
.pay-wait { margin: 0; padding: 12px 14px; border: 1px dashed rgba(120, 180, 255, 0.5); border-radius: 14px; background: rgba(120, 180, 255, 0.08); color: #b9d9ff; font-size: 0.9rem; line-height: 1.9; }
.inv-wait { margin: 22px 0 0; padding: 16px 18px; border: 1px dashed rgba(120, 180, 255, 0.5); border-radius: 16px; background: rgba(120, 180, 255, 0.07); color: #b9d9ff; line-height: 1.9; }
.result-state { margin: 0; padding: 6px 18px; border: 1px solid var(--line); border-radius: 999px; font-weight: 700; color: var(--gold-hi); }
.result-state.is-paid { border-color: rgba(120, 180, 255, 0.5); color: #8cc4ff; background: rgba(120, 180, 255, 0.08); }
.result-state.is-done { border-color: rgba(143, 224, 166, 0.5); color: var(--ok); background: rgba(143, 224, 166, 0.08); }
