/* ==========================================================================
   TopUp Star — storefront stylesheet (minimal / clean light)
   Flat surfaces, one Telegram-blue accent, generous whitespace.
   Manrope everywhere; Unbounded only for the logo wordmark.
   Hand-written. No frameworks, no CDNs at runtime.
   ========================================================================== */

:root {
  --font:      'Manrope', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-logo: 'Unbounded', 'Segoe UI', system-ui, sans-serif;
  --mono:      ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --brand:        #2AA7E6;
  --brand-strong: #1B8CC9;
  --brand-tint:   #EAF6FD;
  --gold:         #F5B301;
  --success:      #12A150;
  --danger:       #E5484D;
  --warn:         #B7791F;

  --bg:      #FFFFFF;
  --panel:   #F6F8FB;
  --card:    #FFFFFF;
  --ink:     #0F1B2D;
  --ink-2:   #33445A;
  --muted:   #6B7A8D;
  --line:    #E6EBF1;
  --line-2:  #EEF2F7;

  --shadow:    0 1px 2px rgba(16,27,45,.05);
  --shadow-md: 0 10px 28px -14px rgba(16,27,45,.22);
  --ring:      0 0 0 3px rgba(42,167,230,.22);

  --radius:      16px;
  --radius-sm:   10px;
  --radius-pill: 999px;
  --maxw:   1080px;
  --gutter: 22px;
}

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition-duration: .001ms !important; } }

body {
  font-family: var(--font);
  font-size: 1rem; line-height: 1.6;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-strong); text-decoration: none; }
a:hover { color: var(--brand); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.18; color: var(--ink); letter-spacing: -.02em; font-weight: 800; }
.tabular, .price, .stars-num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
::selection { background: var(--brand-tint); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---- Layout -------------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(2.75rem, 6vw, 4.5rem); }
.section-head { max-width: 620px; margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.section-head p { color: var(--muted); margin-top: .6rem; }
.eyebrow { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); margin-bottom: .7rem; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--card); color: var(--ink); padding: .6rem 1rem; border-radius: 0 0 var(--radius-sm) 0; }
.skip-link:focus { left: 0; }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: 0 1.25rem; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .96rem; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:hover { border-color: #D3DBE5; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn-ghost { background: transparent; }
.btn-outline { background: var(--card); }
.btn-block { width: 100%; }
.btn-lg { min-height: 52px; font-size: 1rem; padding-inline: 1.6rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.icon-btn { width: 46px; height: 46px; padding: 0; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---- Header -------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.9); backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; gap: 1rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: .34rem; font-family: var(--font-logo); font-weight: 700; font-size: 1.14rem; letter-spacing: -.02em; }
.brand .brand-name { color: var(--brand); }
.brand:hover .brand-name { color: var(--brand-strong); }
.brand .brand-star { width: 1.1em; height: 1.1em; flex: 0 0 auto; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

/* ---- Hero ---------------------------------------------------------------- */
.hero { border-bottom: 1px solid var(--line); }
.hero .hero-copy { max-width: 720px; margin-inline: auto; text-align: center; padding-block: clamp(3rem, 7vw, 5rem); }
.hero-badge { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.3rem; font-size: .8rem; font-weight: 700; color: var(--ink-2); padding: .4rem .85rem; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--card); }
.hero-badge b { color: var(--success); font-weight: 700; }
.hero-badge .live-dot { width: 8px; height: 8px; flex: 0 0 auto; color: var(--success); }
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.2rem); letter-spacing: -.03em; }
.hero h1 .accent { color: var(--brand); }
.hero .sub { margin-top: 1.1rem; font-size: clamp(1rem, 2vw, 1.15rem); color: var(--muted); max-width: 46ch; margin-inline: auto; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; margin-top: 1.9rem; }
.hero .price-note { margin-top: 1.15rem; font-size: .88rem; color: var(--muted); }
.hero .price-note strong { color: var(--ink); }

/* ---- Trust bar ----------------------------------------------------------- */
.trust { background: var(--panel); border-bottom: 1px solid var(--line); }
.trust .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding-block: 1.1rem; }
.trust .item { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .88rem; font-weight: 600; }
.trust .item svg { width: 20px; height: 20px; color: var(--brand); flex: 0 0 auto; }
.trust .item b { color: var(--ink); font-weight: 700; }

/* ---- Cards --------------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }

/* ---- Buy layout: package list (left) + order panel (right), EQUAL height -- */
.buy-layout { display: grid; grid-template-columns: 1fr 372px; gap: 1.5rem; align-items: stretch; }

/* Left column fills the row height (set by the order panel); the list scrolls
   inside it. Absolute list keeps its long content from inflating the row. */
.pkg-col { position: relative; min-height: 0; }
.pkg-list { position: absolute; inset: 0; display: flex; flex-direction: column; gap: .5rem; overflow-y: auto; padding-right: .5rem; }
.pkg-list::-webkit-scrollbar { width: 8px; }
.pkg-list::-webkit-scrollbar-track { background: transparent; }
.pkg-list::-webkit-scrollbar-thumb { background: #D7DEE8; border-radius: 8px; }
.pkg-list { scrollbar-width: thin; scrollbar-color: #D7DEE8 transparent; }

.pkg-row {
  display: flex; align-items: center; gap: .85rem; width: 100%; text-align: left;
  padding: .8rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  cursor: pointer; transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.pkg-row:hover { border-color: #CBD5E1; background: #FBFCFE; }
.pkg-row[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.pkg-row .radio { width: 20px; height: 20px; flex: 0 0 auto; border: 2px solid #C3CEDC; border-radius: 50%; position: relative; transition: border-color .12s ease; }
.pkg-row[aria-pressed="true"] .radio { border-color: var(--brand); }
.pkg-row[aria-pressed="true"] .radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--brand); }
.pkg-row .row-star { width: 22px; height: 22px; flex: 0 0 auto; }
.pkg-row .row-name { flex: 1; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .35rem; }
.pkg-row .row-name .stars-num { font-size: 1.02rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.pkg-row .row-name .stars-num.num-lg { font-size: .92rem; }
.pkg-row .row-name .stars-unit { font-size: .82rem; font-weight: 600; color: var(--muted); }
.pkg-row .row-badge { font-size: .58rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: .15rem .4rem; border-radius: var(--radius-pill); background: var(--gold); color: #3a2600; }
.pkg-row .row-badge.best { background: var(--brand); color: #fff; }
.pkg-row .row-right { display: flex; flex-direction: column; align-items: flex-end; gap: .05rem; flex: 0 0 auto; }
.pkg-row .price { font-size: 1.05rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
.pkg-row .price.price-lg { font-size: .92rem; }
.pkg-row .price .cur { font-size: .8rem; font-weight: 700; color: var(--muted); vertical-align: .1em; margin-right: 1px; }
.pkg-row .row-save { font-size: .72rem; font-weight: 700; color: var(--success); }
.pkg-row .row-sub { font-size: .7rem; color: var(--muted); }

/* Order panel (single container). Row height is driven by this panel; the
   left list stretches to match it. */
.order-panel { height: 100%; }
.summary h3 { font-size: 1.02rem; font-weight: 800; margin-bottom: .8rem; }
.summary .empty { color: var(--muted); font-size: .95rem; }
.summary .line { display: flex; justify-content: space-between; align-items: baseline; padding: .55rem 0; border-bottom: 1px solid var(--line-2); }
.summary .line:last-of-type { border-bottom: 0; }
.summary .line .lbl { color: var(--muted); }
.summary .line .val { font-weight: 700; }
.summary .total { margin-top: .5rem; padding-top: .8rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.summary .total .lbl { font-weight: 700; }
.summary .total .val { font-size: 1.5rem; font-weight: 800; color: var(--brand); }
.summary .save-pill { display: inline-block; margin-top: .6rem; font-size: .8rem; font-weight: 700; color: var(--success); }
.panel-note { margin-top: 1rem; font-size: .82rem; }

.field { margin-bottom: 1.1rem; }
.field > label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: .45rem; }
.field .hint { color: var(--muted); font-size: .82rem; font-weight: 500; }
.input, input[type="text"], input[type="email"], input[type="number"], select, textarea {
  width: 100%; min-height: 46px; padding: .65rem .85rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #97A4B4; }
.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); transition: border-color .15s ease, box-shadow .15s ease; }
.input-group:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.input-group .adorn { display: inline-flex; align-items: center; padding: 0 .8rem; background: var(--panel); color: var(--muted); font-weight: 700; border-right: 1px solid var(--line); }
.input-group input { border: 0; box-shadow: none !important; border-radius: 0; background: transparent; }
.validity { font-size: .82rem; margin-top: .35rem; min-height: 1.1em; font-weight: 600; }
.validity.ok { color: var(--success); }
.validity.err { color: var(--danger); }

.pay-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.pay-opt { position: relative; }
.pay-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pay-opt label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 64px; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); font-weight: 700; font-size: .84rem; text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.pay-opt label svg { width: 22px; height: 22px; color: var(--muted); }
.pay-opt input:checked + label { border-color: var(--brand); background: var(--brand-tint); }
.pay-opt input:checked + label svg { color: var(--brand); }
.pay-opt input:focus-visible + label { box-shadow: var(--ring); }

/* ---- FAQ ----------------------------------------------------------------- */
.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-child { border-top: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 1.1rem .25rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .chev { transition: transform .2s ease; color: var(--muted); flex: 0 0 auto; }
.faq details[open] summary .chev { transform: rotate(180deg); }
.faq .answer { padding: 0 .25rem 1.1rem; color: var(--muted); max-width: 68ch; }

/* ---- Footer -------------------------------------------------------------- */
.site-footer { background: var(--panel); border-top: 1px solid var(--line); margin-top: 2rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem; padding-block: 2.5rem; }
.site-footer .foot-brand p { color: var(--muted); font-size: .9rem; margin-top: .6rem; max-width: 32ch; }
.site-footer h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .7rem; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer a { color: var(--ink-2); }
.site-footer a:hover { color: var(--brand); }
.site-footer .pay-logos { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.site-footer .pay-logos span { font-size: .72rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 7px; padding: .25rem .5rem; background: var(--card); }
.foot-bottom { border-top: 1px solid var(--line); }
.foot-bottom .wrap { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; justify-content: space-between; padding-block: 1.1rem; }
.foot-bottom p { color: var(--muted); font-size: .82rem; }
.foot-bottom .support { font-weight: 700; }

/* ---- Status pills -------------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700; padding: .28rem .65rem; border-radius: var(--radius-pill); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-pending    { color: var(--warn);    background: color-mix(in srgb, var(--warn) 12%, #fff); }
.pill-paid       { color: var(--brand-strong); background: var(--brand-tint); }
.pill-delivering { color: var(--brand-strong); background: var(--brand-tint); }
.pill-delivered  { color: var(--success); background: color-mix(in srgb, var(--success) 12%, #fff); }
.pill-cancelled, .pill-failed { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, #fff); }

/* ---- Alerts -------------------------------------------------------------- */
.alert { border-radius: var(--radius-sm); padding: .8rem 1rem; margin-bottom: 1rem; border: 1px solid var(--line); font-size: .92rem; font-weight: 600; background: var(--card); }
.alert-ok  { border-color: color-mix(in srgb, var(--success) 40%, var(--line)); background: color-mix(in srgb, var(--success) 7%, #fff); }
.alert-err { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: color-mix(in srgb, var(--danger) 7%, #fff); }
.alert-info{ border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--brand-tint); }

/* ---- Confirmation (order.php) -------------------------------------------- */
.confirm { max-width: 680px; margin-inline: auto; }
.confirm .check { width: 68px; height: 68px; margin: 0 auto 1.1rem; border-radius: 50%; background: color-mix(in srgb, var(--success) 12%, #fff); border: 1px solid color-mix(in srgb, var(--success) 35%, var(--line)); display: grid; place-items: center; color: var(--success); }
.confirm .check svg { width: 36px; height: 36px; }
.confirm h1 { text-align: center; font-size: clamp(1.4rem, 4vw, 1.8rem); }
.confirm .lead { text-align: center; color: var(--muted); margin-top: .55rem; }
.code-box { display: flex; align-items: center; justify-content: center; gap: .75rem; margin: 1.6rem auto; padding: 1rem 1.25rem; background: var(--panel); border: 1px dashed var(--brand); border-radius: var(--radius); max-width: 420px; }
.code-box .code { font-family: var(--mono); font-size: 1.45rem; font-weight: 700; letter-spacing: .06em; color: var(--ink); }
.copy-btn { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-sm); min-height: 40px; padding: 0 .8rem; display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 700; }
.copy-btn:hover { border-color: #D3DBE5; }
.copy-btn svg { width: 16px; height: 16px; }
.pay-instructions { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; margin-top: 1.35rem; box-shadow: var(--shadow); }
.pay-instructions h3 { font-size: 1.02rem; display: flex; align-items: center; gap: .5rem; }
.pay-instructions .pay-block { margin-top: .8rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem; display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.pay-instructions .pay-block pre { font-family: var(--mono); font-size: .9rem; white-space: pre-wrap; word-break: break-word; margin: 0; color: var(--ink); }
.order-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .9rem; margin-top: 1.35rem; }
.order-facts .fact { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .85rem 1rem; }
.order-facts .fact .k { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.order-facts .fact .v { font-weight: 800; font-size: 1.05rem; margin-top: .2rem; }

/* ---- Track timeline ------------------------------------------------------ */
.track-form { max-width: 520px; margin-inline: auto; }
.timeline { display: flex; align-items: flex-start; justify-content: space-between; position: relative; margin: 2rem 0 1rem; }
.timeline::before { content: ""; position: absolute; top: 18px; left: 6%; right: 6%; height: 2px; background: var(--line); }
.timeline .prog { position: absolute; top: 18px; left: 6%; height: 2px; background: var(--brand); transition: width .4s ease; }
.timeline .step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .5rem; flex: 1; text-align: center; }
.timeline .dot { width: 38px; height: 38px; border-radius: 50%; background: var(--card); border: 2px solid var(--line); display: grid; place-items: center; color: var(--muted); font-weight: 800; }
.timeline .dot svg { width: 18px; height: 18px; }
.timeline .step.done .dot { border-color: var(--brand); background: var(--brand); color: #fff; }
.timeline .step.current .dot { border-color: var(--brand); background: var(--card); color: var(--brand); box-shadow: var(--ring); }
.timeline .step .caption { font-size: .8rem; font-weight: 700; color: var(--muted); }
.timeline .step.done .caption, .timeline .step.current .caption { color: var(--ink); }
.track-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-top: 1.6rem; }
.track-meta .fact { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .85rem 1rem; }
.track-meta .fact .k { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.track-meta .fact .v { font-weight: 700; margin-top: .2rem; }

/* ---- Toast --------------------------------------------------------------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: .7rem 1.15rem; border-radius: var(--radius-pill); font-weight: 700; font-size: .9rem; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Utilities ----------------------------------------------------------- */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 860px) {
  .buy-layout { grid-template-columns: 1fr; }
  .pkg-col { position: static; }
  .pkg-list { position: static; inset: auto; max-height: 58vh; }
  .order-panel { height: auto; }
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
  .site-footer .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  :root { --gutter: 16px; }
  .trust .wrap { grid-template-columns: 1fr 1fr; }
  .pay-picker { grid-template-columns: 1fr 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .timeline .step .caption { font-size: .68rem; }
  .header-actions .btn .label { display: none; }
}
