/* Pool3Sot design system — shared by the site/admin (Blazor WASM) and both MAUI apps. */

@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Regular.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Medium.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-Bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(../fonts/Vazirmatn-ExtraBold.woff2) format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --teal: #14B8A6;
  --sky: #0EA5E9;
  --violet: #6D28D9;
  --brand: #0EA5E9;
  --brand-strong: #0284C7;
  --grad: linear-gradient(135deg, #14B8A6 0%, #0EA5E9 55%, #6D28D9 100%);
  --grad-soft: linear-gradient(135deg, rgba(20,184,166,.12), rgba(109,40,217,.12));

  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --text: #0F172A;
  --muted: #64748B;
  --success: #16A34A;
  --warning: #D97706;
  --danger: #DC2626;
  --info: #0EA5E9;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .28);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1120; --surface: #111827; --surface-2: #1E293B; --border: #1F2A3D;
    --text: #E2E8F0; --muted: #94A3B8; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1120; --surface: #111827; --surface-2: #1E293B; --border: #1F2A3D;
  --text: #E2E8F0; --muted: #94A3B8; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Vazirmatn, Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-strong); }
img { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .5em; }
h1:focus, h1:focus-visible { outline: none; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.num { font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.spacer { flex: 1; }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card.hover { transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.card.hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 14px; padding: 12px 20px;
  font: inherit; font-weight: 700; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .25s var(--ease), background .25s, opacity .2s;
  user-select: none; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -10px rgba(14,165,233,.8); }
.btn-primary:hover { box-shadow: 0 14px 30px -10px rgba(109,40,217,.7); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--grad-soft); color: var(--brand-strong); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: 6px 12px; border-radius: 10px; font-size: .85rem; }
.btn-lg { padding: 16px 28px; font-size: 1.1rem; border-radius: 18px; }
.btn-block { width: 100%; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 500; font-size: .9rem; color: var(--muted); }
.input, select.input, textarea.input {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(14,165,233,.15); }
.input.big { font-size: 1.4rem; font-weight: 700; text-align: center; letter-spacing: 2px; }
.validation-message, .error-text { color: var(--danger); font-size: .85rem; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.otp-boxes { display: flex; gap: 10px; justify-content: center; direction: ltr; }
.otp-boxes input { width: 52px; height: 60px; text-align: center; font-size: 1.6rem; font-weight: 800; }

/* ---------- badges / alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-success { background: rgba(22,163,74,.12); color: var(--success); }
.badge-warning { background: rgba(217,119,6,.14); color: var(--warning); }
.badge-danger { background: rgba(220,38,38,.12); color: var(--danger); }
.badge-info { background: rgba(14,165,233,.12); color: var(--brand-strong); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.alert { border-radius: var(--radius-sm); padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert-warning { background: rgba(217,119,6,.1); color: #92400E; border: 1px solid rgba(217,119,6,.25); }
.alert-info { background: rgba(14,165,233,.08); color: var(--brand-strong); border: 1px solid rgba(14,165,233,.25); }
.alert-danger { background: rgba(220,38,38,.08); color: var(--danger); border: 1px solid rgba(220,38,38,.25); }
:root[data-theme="dark"] .alert-warning { color: #FBBF24; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
table.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .92rem; }
.table th { text-align: right; font-weight: 700; color: var(--muted); background: var(--surface-2); padding: 12px; white-space: nowrap; }
.table td { padding: 12px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tr { transition: background .2s; }
.table tbody tr:hover { background: var(--surface-2); }

/* ---------- wallet card ---------- */
.wallet-card {
  position: relative; overflow: hidden; color: #fff; background: var(--grad);
  border-radius: 24px; padding: 24px; box-shadow: var(--shadow-lg); min-height: 170px;
}
.wallet-card::before, .wallet-card::after {
  content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.12);
}
.wallet-card::before { width: 220px; height: 220px; top: -90px; left: -60px; animation: float 8s ease-in-out infinite; }
.wallet-card::after { width: 160px; height: 160px; bottom: -70px; right: -40px; animation: float 10s ease-in-out infinite reverse; }
.wallet-card .label { opacity: .85; font-size: .9rem; }
.wallet-card .amount { font-size: 2.2rem; font-weight: 800; letter-spacing: .5px; }
.wallet-card .unit { font-size: 1rem; font-weight: 500; opacity: .9; }

/* ---------- NFC tap animation ---------- */
.nfc-stage { position: relative; width: 220px; height: 220px; margin: 12px auto; display: grid; place-items: center; }
.nfc-stage .ring {
  position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--sky);
  opacity: 0; animation: ripple 2.4s var(--ease) infinite;
}
.nfc-stage .ring:nth-child(2) { animation-delay: .8s; }
.nfc-stage .ring:nth-child(3) { animation-delay: 1.6s; }
.nfc-stage .core {
  width: 110px; height: 110px; border-radius: 32px; background: var(--grad);
  display: grid; place-items: center; box-shadow: var(--shadow-lg); animation: breathe 2.4s ease-in-out infinite;
}
.nfc-stage .core img { width: 70px; height: 70px; }
.nfc-stage.success .core { background: linear-gradient(135deg, #22C55E, #14B8A6); animation: pop .5s var(--ease); }
.nfc-stage.success .ring { border-color: #22C55E; animation-iteration-count: 1; }

/* ---------- success check ---------- */
.check-anim { width: 96px; height: 96px; margin: 0 auto; }
.check-anim circle { stroke: var(--success); stroke-width: 4; fill: none; stroke-dasharray: 300; stroke-dashoffset: 300; animation: draw .7s var(--ease) forwards; }
.check-anim path { stroke: var(--success); stroke-width: 6; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw .45s .55s var(--ease) forwards; }

/* ---------- skeleton / spinner ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 10px; min-height: 16px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; display: inline-block; }
.spinner.dark { border-color: rgba(14,165,233,.2); border-top-color: var(--brand); }
.page-loader { display: grid; place-items: center; min-height: 40vh; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 1000; top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; background: var(--surface); color: var(--text); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-lg); border-inline-start: 5px solid var(--brand); animation: toastIn .4s var(--ease); display: flex; gap: 10px; align-items: center; }
.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(4px); z-index: 900; display: grid; place-items: center; padding: 16px; animation: fadeIn .25s; }
.modal { background: var(--surface); border-radius: 22px; width: min(560px, 100%); max-height: 90vh; overflow: auto; padding: 24px; box-shadow: var(--shadow-lg); animation: rise .35s var(--ease); }
.modal.wide { width: min(900px, 100%); }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty .icon { font-size: 2.6rem; opacity: .6; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .value { font-size: 1.6rem; font-weight: 800; }
.stat .label { color: var(--muted); font-size: .88rem; }
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 12px; }
.chip { padding: 6px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; font-size: .88rem; transition: all .2s; }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; }
.amount-pos { color: var(--success); font-weight: 700; }
.amount-neg { color: var(--danger); font-weight: 700; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.stars { color: #F59E0B; letter-spacing: 2px; }
.prose { line-height: 2.1; }
.prose img { border-radius: 14px; }

/* ---------- entrance animations ---------- */
.fade-up { animation: fadeUp .6s var(--ease) both; }
.fade-in { animation: fadeIn .5s ease both; }
.delay-1 { animation-delay: .08s; } .delay-2 { animation-delay: .16s; } .delay-3 { animation-delay: .24s; } .delay-4 { animation-delay: .32s; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.visible { opacity: 1; transform: none; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes ripple { 0% { transform: scale(.45); opacity: .9; } 100% { transform: scale(1.1); opacity: 0; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes float { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(14px, 18px); } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- mobile app shell (MAUI) ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: 76px; }
.app-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.app-header .title { font-weight: 800; font-size: 1.1rem; }
.app-content { flex: 1; padding: 8px 16px 16px; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--border); display: flex; justify-content: space-around; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .75rem; color: var(--muted); padding: 4px 10px; border-radius: 12px; transition: color .2s, background .2s; }
.tabbar a.active { color: var(--brand-strong); background: var(--grad-soft); }
.tabbar svg { width: 24px; height: 24px; }
.fab-pay { position: relative; top: -22px; width: 64px; height: 64px; border-radius: 22px; background: var(--grad); display: grid !important; place-items: center; box-shadow: var(--shadow-lg); color: #fff !important; }
