/* Penny — dizayn tokenlari va umumiy komponentlar (kabinet + to'lov oynasi).
   Brend: shisha "P" logosi — to'q zumrad (#2D5A43), yorqin nur (#00c0a3), obsidian fon.
   Uslub: glassmorphism — yarim shaffof panellar, nozik 1px chegaralar, yumshoq yashil nur. */

/* ───────── 1. Tokenlar ───────── */
:root {
  color-scheme: light dark;

  /* Yorug' tema */
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #e8eeeb;
  --glass: rgba(255, 255, 255, .66);
  --ink: #0f1512;
  --ink-2: #53615a;
  --line: rgba(15, 35, 25, .11);
  --line-strong: #7a8881;

  --accent: #2d5a43;
  --accent-hover: #366d52;
  --on-accent: #ffffff;
  --accent-text: #2d5a43;      /* matn/ikonka uchun (AA) */
  --accent-soft: #dcebe4;
  --glow: #00c0a3;             /* faqat bezak: nur, fokus halosi, kichik detallar */
  --glow-soft: rgba(0, 192, 163, .24);
  --glow-faint: rgba(0, 192, 163, .10);

  --danger: #b3261e;
  --danger-soft: #f9dedc;
  --on-danger: #ffffff;
  --focus: #2d5a43;

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 20px;
  --r-xl: 28px;
  --r-pill: 980px;

  --blur: blur(20px) saturate(1.25);
  --shadow-1: 0 1px 2px rgba(15, 35, 25, .05), 0 8px 24px -10px rgba(15, 35, 25, .12);
  --shadow-2: 0 2px 6px rgba(15, 35, 25, .08), 0 22px 48px -18px rgba(15, 35, 25, .28);
  --shadow-glow: 0 10px 28px -12px rgba(0, 192, 163, .55);

  /* Plus Jakarta Sans'ga yaqin geometrik tizim shriftlari (tashqi shrift yo'q) */
  --font: "Plus Jakarta Sans", "Segoe UI Variable Display", "SF Pro Display", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f0d;
    --surface: #141a17;
    --surface-2: #1c2520;
    --glass: rgba(20, 26, 23, .62);
    --ink: #efefe8;
    --ink-2: #a4b0aa;
    --line: rgba(255, 255, 255, .1);
    --line-strong: #6d7a74;

    --accent: #2d5a43;
    --accent-hover: #37705a;
    --on-accent: #ffffff;
    --accent-text: #00c0a3;
    --accent-soft: #16271f;
    --glow-soft: rgba(0, 192, 163, .28);
    --glow-faint: rgba(0, 192, 163, .12);

    --danger: #ffb4ab;
    --danger-soft: #3d1512;
    --on-danger: #3b0d09;
    --focus: #00c0a3;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -10px rgba(0, 0, 0, .5);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .5), 0 22px 48px -18px rgba(0, 0, 0, .7);
  }
}

/* ───────── 2. Asos ───────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  color: var(--ink);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  /* logodan ilhomlangan xira yashil nur dog'lari */
  background:
    radial-gradient(70vmax 55vmax at 105% -10%, var(--glow-faint), transparent 62%),
    radial-gradient(60vmax 50vmax at -15% 105%, rgba(45, 90, 67, .13), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); }
svg, img { display: block; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--glow-soft); }
/* sarlavhaga dastur orqali o'tkazilgan fokus (ekran o'quvchilari uchun) halqasiz */
[tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }

.sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Logo fayli atrofida shaffof hoshiya bor — belgini kvadratga zich joylash uchun kattalashtirib kesamiz */
/* Logo fayli (uploads/penny-logo-*.png) chetlari toza kesilgan — kattalashtirmasdan, to'liq sig'dirib ko'rsatamiz */
.mark { display: inline-block; flex: none; width: 36px; height: 36px; }
.mark img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Shisha panel */
.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
}

/* ───────── 3. Matn ───────── */
.h-title {
  font-weight: 800;
  font-size: clamp(27px, 6vw, 36px);
  line-height: 1.12;
  letter-spacing: -.5px;
}
.h-sub { font-weight: 800; font-size: 21px; line-height: 1.2; letter-spacing: -.4px; }
.sub { color: var(--ink-2); margin-top: 10px; }
.sub strong { color: var(--ink); font-weight: 700; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ───────── 4. Tugmalar ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; width: 100%;
  border: 1px solid transparent; border-radius: var(--r-pill);
  background: var(--accent); color: var(--on-accent);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 55%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), var(--shadow-glow);
  font-weight: 700; font-size: 16px; letter-spacing: -.1px; text-decoration: none;
  transition: background-color .15s, transform .12s var(--ease), opacity .15s, box-shadow .2s;
}
.btn:hover { background-color: var(--accent-hover); }
.btn:active { transform: scale(.985); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }
.btn:focus-visible { box-shadow: 0 0 0 5px var(--glow-soft); }
.btn:disabled { opacity: .6; cursor: default; transform: none; box-shadow: none; }
.btn--ghost {
  background: var(--glass); background-image: none; color: var(--ink);
  border-color: var(--line-strong); box-shadow: none;
}
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger); background-image: none; color: var(--on-danger); box-shadow: none; }
.btn--danger:hover { background: var(--danger); opacity: .9; }
.btn--auto { width: auto; }
@media (prefers-color-scheme: dark) {
  .btn:not(.btn--ghost):not(.btn--danger) { border-color: rgba(0, 192, 163, .42); }
}

.btn.is-busy::before,
.spinner {
  content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: pn-spin .7s linear infinite;
}
.spinner { display: inline-block; width: 28px; height: 28px; color: var(--accent-text); }

.link {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 6px; border: 0; background: none;
  color: var(--accent-text); font-weight: 700; font-size: 15px;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
  border-radius: var(--r-s);
}
.link:hover { text-decoration-color: currentColor; }
.link:disabled { color: var(--ink-2); cursor: default; text-decoration: none; }
.link--muted { color: var(--ink-2); }
.link--danger { color: var(--danger); }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 50%; background: transparent; color: inherit;
}
.icon-btn:hover { background: var(--surface-2); }

/* ───────── 5. Maydonlar ───────── */
.form { display: grid; gap: 16px; margin-top: 24px; }
.field { display: grid; gap: 6px; }
.field > label { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.input, .affix {
  width: 100%; min-height: 54px; padding: 0 16px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-m);
  font-size: 18px; font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .affix input::placeholder { color: var(--ink-2); opacity: .65; }
.input:focus-visible, .affix:focus-within {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus) inset, 0 0 0 4px var(--glow-soft);
}
.affix { display: flex; align-items: center; gap: 10px; }
.affix-pre { color: var(--ink-2); font-weight: 700; padding-right: 10px; border-right: 1px solid var(--line); }
.affix input { flex: 1; min-width: 0; height: 52px; border: 0; background: transparent; padding: 0; font-size: 18px; font-variant-numeric: tabular-nums; }
.affix input:focus-visible { outline: none; box-shadow: none; }

/* SMS kod: 6 ta alohida katakcha. Haqiqiy input ko'rinmas holda kataklar ustida turadi (avto-to'ldirish va paste ishlashi uchun) */
.otp { position: relative; }
.otp-input {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0;
  background: transparent; color: transparent; caret-color: transparent; opacity: 0;
  font-size: 16px; /* iOS kattalashtirib yubormasin */ cursor: text; letter-spacing: 0;
}
.otp-input:focus, .otp-input:focus-visible { outline: none; box-shadow: none; }
.otp-cells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(6px, 2.2vw, 10px); }
.otp-cell {
  position: relative; display: grid; place-items: center; height: clamp(52px, 15vw, 62px);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-m); background: var(--surface); color: var(--ink);
  font-family: var(--font-mono); font-size: clamp(22px, 6.4vw, 28px); font-weight: 700; font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
}
.otp-cell.is-filled { border-color: var(--accent); }
.otp.is-focus .otp-cell.is-active { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus) inset, 0 0 0 4px var(--glow-soft); }
.otp.is-focus .otp-cell.is-active:empty::after {
  content: ""; width: 2px; height: 46%; border-radius: 2px; background: var(--accent-text); animation: otp-caret 1.1s steps(1) infinite;
}
@keyframes otp-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .otp.is-focus .otp-cell.is-active:empty::after { animation: none; } .otp-cell { transition: none; } }
.row-2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 400px) { .row-2 { grid-template-columns: 1fr 112px; } }
.row-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 8px; }
.row-links--center { justify-content: center; }

.msg { min-height: 22px; margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.msg--err { color: var(--danger); font-weight: 700; }
.msg--ok { color: var(--accent-text); font-weight: 700; }
.msg:empty { margin-top: 0; min-height: 0; }

.note {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 4px;
  font-size: 13.5px; line-height: 1.45; color: var(--ink-2);
}
.note .ico { width: 18px; height: 18px; margin-top: 1px; color: var(--accent-text); }

/* ───────── 6. PIN: kataklar + klaviatura ───────── */
.pin { display: grid; justify-items: center; gap: 22px; margin-top: 22px; }
.pin-cap { font-weight: 700; text-align: center; min-height: 24px; }

/* Kataklar — SMS kod kataklari bilan bir xil uslubda: navbatdagisi halqa bilan ajralib turadi, to'lgani nuqta bilan */
.pin-dots { display: flex; gap: 12px; padding: 4px; }
.pin-dot {
  position: relative; width: 56px; height: 62px; border-radius: var(--r-m);
  display: grid; place-items: center;
  background: var(--surface); border: 1.5px solid var(--line-strong);
  transition: border-color .15s, box-shadow .2s, background-color .15s, transform .15s;
}
.pin-dot::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent-text); transform: scale(0);
  transition: transform .22s var(--ease);
}
.pin-dot.is-on { border-color: var(--accent); background: var(--accent-soft); }
.pin-dot.is-on::after { transform: scale(1); }
.pin-dot.is-active { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus) inset, 0 0 0 4px var(--glow-soft); }
.pin-dot.is-active::before {
  content: ""; position: absolute; width: 2px; height: 40%; border-radius: 2px;
  background: var(--accent-text); animation: otp-caret 1.1s steps(1) infinite;
}
.pin-dots.is-error { animation: pn-shake .42s var(--ease); }
.pin-dots.is-error .pin-dot { border-color: var(--danger); background: var(--danger-soft); box-shadow: none; }
.pin-dots.is-error .pin-dot::before { display: none; }

/* Klaviatura — yirik, "bosiladigan" tugmalar */
.pin-keys {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  width: 100%; max-width: 312px;
}
.pin-key {
  height: clamp(54px, 8.6vh, 66px); border-radius: 18px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: 0 3px 0 var(--line), var(--shadow-1);
  font-size: 26px; font-weight: 800; font-variant-numeric: lining-nums tabular-nums;
  display: grid; place-items: center; cursor: pointer;
  transition: background-color .1s, color .1s, transform .08s, border-color .1s, box-shadow .08s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; user-select: none;
}
.pin-key:hover { border-color: var(--accent); }
.pin-key:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus) inset, 0 0 0 4px var(--glow-soft); }
.pin-key:active {
  transform: translateY(3px); box-shadow: none;
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
}
.pin-key--del { background: var(--surface-2); border-color: transparent; box-shadow: none; color: var(--ink-2); }
.pin-key--del .ico { width: 26px; height: 26px; }
.pin-key--del:active { background: var(--danger-soft); color: var(--danger); border-color: transparent; transform: scale(.96); }
.pin.is-busy .pin-keys { opacity: .5; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .pin-dot.is-active::before { animation: none; } .pin-key, .pin-dot { transition: none; } }

/* ───────── 7. Bank kartasi (shisha) ───────── */
.bcard {
  position: relative; overflow: hidden; isolation: isolate;
  width: 100%; aspect-ratio: 1.586; min-height: 170px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px 20px; border-radius: var(--r-l);
  color: #f4f7f5;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), var(--shadow-2);
}
.bcard, .bcard--card { background: linear-gradient(135deg, #3b4843, #1b2420 70%); }
/* Uzcard — zumrad shisha */
.bcard--uzcard {
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(0, 192, 163, .38), transparent 55%),
    linear-gradient(135deg, #3a7557, #2d5a43 45%, #14302a);
}
/* Humo — grafit shisha, chetida yashil nur */
.bcard--humo {
  background:
    radial-gradient(80% 110% at 100% 100%, rgba(0, 192, 163, .30), transparent 58%),
    linear-gradient(135deg, #2a3530, #141a17 60%, #0b0f0d);
}
/* logodagi "P" halqasiga ishora — yirik shaffof halqa */
.bcard::before {
  content: ""; position: absolute; z-index: -1; right: -20%; top: -46%;
  width: 78%; aspect-ratio: 1; border-radius: 50%;
  border: 30px solid rgba(255, 255, 255, .055);
}
.bcard::after {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: linear-gradient(115deg, rgba(255, 255, 255, .14), transparent 36%);
}
.bcard-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bcard-brand { font-weight: 800; font-size: 15px; letter-spacing: .16em; text-transform: uppercase; }
.bcard-badge {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .94); color: #0f1512;
}
.bcard-chip {
  width: 40px; height: 29px; border-radius: 7px;
  background:
    linear-gradient(90deg, transparent 31%, rgba(15, 35, 25, .4) 31% 34%, transparent 34% 66%, rgba(15, 35, 25, .4) 66% 69%, transparent 69%),
    linear-gradient(0deg, transparent 46%, rgba(15, 35, 25, .4) 46% 54%, transparent 54%),
    linear-gradient(135deg, #eef5f1, #a9bab2);
}
.bcard-num {
  font-family: var(--font-mono); font-size: clamp(17px, 5.2vw, 21px); font-weight: 600;
  letter-spacing: .06em; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.bcard-bottom { display: flex; align-items: flex-end; justify-content: space-between; }
.bcard-exp small { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.bcard-exp span { font-family: var(--font-mono); font-size: 15px; font-weight: 600; }
.bcard-bal { text-align: right; }
.bcard-bal span { font-family: inherit; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ───────── 8. Dialog va toast ───────── */
.dlg {
  width: min(92vw, 380px); padding: 24px; border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2);
}
.dlg::backdrop { background: rgba(5, 9, 7, .55); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dlg[open] { animation: pn-rise .22s var(--ease); }
.dlg p { color: var(--ink-2); margin-top: 8px; }
.dlg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 420px); padding: 12px 18px; border-radius: var(--r-m);
  background: var(--ink); color: var(--bg); font-weight: 700; font-size: 15px; text-align: center;
  box-shadow: var(--shadow-2); transition: opacity .2s, transform .25s var(--ease);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ───────── 9. Harakat ───────── */
.step { animation: pn-rise .28s var(--ease); }

@keyframes pn-spin { to { transform: rotate(360deg); } }
@keyframes pn-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pn-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); } 40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(4px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .btn.is-busy::before, .spinner { animation-duration: 1.4s !important; animation-iteration-count: infinite !important; }
}

/* reCAPTCHA v3: suzuvchi nishon yashiriladi (o'rniga forma ostida matn ko'rsatiladi) */
.grecaptcha-badge { visibility: hidden !important; }
.captcha-host { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
.captcha-note { margin-top: 10px; font-size: 11.5px; line-height: 1.4; color: var(--ink-2); opacity: .8; text-align: center; }

/* «inPAY mahsuloti» yozuvi oldidagi inPAY belgisi */
.inpay-ico { display: inline-block; width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; object-fit: contain; }

/* ───────── «inPAY orqali kirish» ───────── */
.or { display: flex; align-items: center; gap: 12px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sso-btn { display: flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.sso-btn img { width: 22px; height: 22px; border-radius: 6px; object-fit: contain; }
.affix-post { color: var(--ink-2); font-weight: 700; padding-left: 10px; border-left: 1px solid var(--line); }

/* ───────── Sahifalar orasida qayta yuklamasdan o'tish (nav.js) ───────── */
.nav-progress {
  position: fixed; top: 0; left: 0; z-index: 9999; height: 3px; width: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--glow)); box-shadow: 0 0 10px var(--glow-soft);
}
.nav-progress.is-on { opacity: 1; width: 82%; transition: width 6s cubic-bezier(.1, .7, .1, 1), opacity .15s; }
.nav-progress.is-done { opacity: 0; width: 100%; transition: width .2s ease-out, opacity .3s .1s; }
body.nav-in { animation: nav-in .32s var(--ease) both; }
@keyframes nav-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { body.nav-in { animation: none; } .nav-progress { transition: none !important; } }
