/* ============================================================
   Novavaran Gostar Hami — Base design tokens, fonts, resets.
   Minimal, premium, mobile-first, RTL.
   ============================================================ */

@font-face {
  font-family: 'Mikhak';
  src: url('/assets/fonts/Mikhak-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style:  normal;
  font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-var.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style:  normal;
  font-display: swap;
}

:root {
  /* Brand palette — warm trust + royal depth */
  --brand-900:  #0b1733;
  --brand-800:  #11204a;
  --brand-700:  #1a2e65;
  --brand-500:  #2b55d6;
  --brand-400:  #4a7bff;
  --brand-300:  #86a9ff;
  --accent:     #ffb547;     /* warm gold — financial trust */
  --accent-2:   #ff7a59;
  --success:    #16a34a;
  --warning:    #f59e0b;
  --danger:     #dc2626;

  --bg:         #f6f8fd;
  --surface:    #ffffff;
  --surface-2:  #f1f5fb;
  --ink:        #0f172a;
  --ink-2:      #334155;
  --muted:      #64748b;
  --line:       #e5ecf6;

  --radius-sm: 10px;
  --radius:    16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 2px 6px rgba(15,23,42,.05);
  --shadow:    0 10px 30px -8px rgba(15,23,42,.12);
  --shadow-lg: 0 30px 60px -20px rgba(15,23,42,.25);

  --t-fast: 180ms cubic-bezier(.4,0,.2,1);
  --t:      320ms cubic-bezier(.4,0,.2,1);
  --t-slow: 600ms cubic-bezier(.22,1,.36,1);

  --container: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-family: 'Mikhak', 'Vazirmatn', system-ui, Tahoma, sans-serif; direction: rtl; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 100% -5%, rgba(74,123,255,.10), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(255,181,71,.08), transparent 60%);
  min-height: 100vh;
  line-height: 1.7;
  font-feature-settings: "ss01", "ss02", "cv11";
}
::selection { background: var(--brand-500); color: #fff; }
a { color: var(--brand-500); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--brand-700); }
img, svg, video { max-width: 100%; height: auto; display: block; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

h1,h2,h3,h4 { font-family: 'Mikhak', 'Vazirmatn', sans-serif; font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; margin: 0 0 .4em; color: var(--brand-900); }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 900; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p  { margin: 0 0 1em; color: var(--ink-2); }

.wrap { width: min(100%, var(--container)); margin: 0 auto; padding: 0 20px; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border: 1px solid transparent;
  border-radius: 999px; font-weight: 700; font-size: .98rem;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff; box-shadow: 0 10px 30px -10px rgba(43,85,214,.6);
  transition: transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 20px 40px -15px rgba(43,85,214,.65); color: #fff; }
.btn:active { transform: translateY(0); }
.btn.ghost { background: transparent; color: var(--brand-700); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--surface); border-color: var(--brand-300); }
.btn.gold { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 30px -10px rgba(255,122,89,.5); color: #231000; }
.btn.block { width: 100%; justify-content: center; }
.btn.sm { padding: 8px 14px; font-size: .9rem; }

/* ----- Cards ----- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px;
  box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow); }
.card.lift { transition: transform var(--t), box-shadow var(--t); }
.card.lift:hover { transform: translateY(-4px); }

/* ----- Forms ----- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .92rem; color: var(--ink); }
.input, .select, textarea.input {
  padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius-sm); background: #fff; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  font-size: 1rem; color: var(--ink);
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(43,85,214,.14); }
.hint  { font-size: .8rem; color: var(--muted); }
.error { color: var(--danger); font-size: .85rem; margin-top: 4px; }

/* ----- Badges / pills ----- */
.badge { display:inline-flex; align-items:center; gap:6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge.ok   { background: #e8f6ee; color: #166534; border-color: #c8ebd4; }
.badge.warn { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge.bad  { background: #fde2e2; color: #991b1b; border-color: #fcc5c5; }
.badge.info { background: #e0ebff; color: #1e3a8a; border-color: #c8d9ff; }

/* ----- Section headings ----- */
.eyebrow { display:inline-block; font-size: .82rem; font-weight: 700; color: var(--brand-500); text-transform: none; letter-spacing: 0; margin-bottom: 10px; padding: 4px 12px; background: rgba(43,85,214,.08); border-radius: 999px; }

/* ----- Scroll reveal (anchors use .reveal) ----- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 700ms cubic-bezier(.22,1,.36,1), transform 700ms cubic-bezier(.22,1,.36,1); }
.reveal.in { opacity: 1; transform: none; }

/* ----- Utility ----- */
.grid { display: grid; gap: 18px; }
.row  { display: flex; gap: 12px; flex-wrap: wrap; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:40px}.mt-5{margin-top:64px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}.mb-4{margin-bottom:40px}
.text-center{text-align:center}
.text-muted{color:var(--muted)}
.hide { display: none !important; }
.price { font-weight: 900; color: var(--brand-900); font-variant-numeric: tabular-nums; }

/* Smooth number counter */
.count { font-variant-numeric: tabular-nums; }

/* RTL numeric fix in inputs */
input[inputmode="numeric"], input[type="number"] { text-align: center; letter-spacing: .5px; font-variant-numeric: tabular-nums; }

/* Toast */
.toast-root { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--brand-900); color: #fff; padding: 12px 20px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; animation: toast-in .3s cubic-bezier(.22,1,.36,1); max-width: 90vw; }
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }
.toast.warn { background: var(--warning); color: #231000; }
@keyframes toast-in { from { transform: translateY(-10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================================================================
   Agent A — accessibility & motion layer (2026-10-28). Appended only.
   ========================================================================== */

/* ------------------------------------------------------------ focus rings
   Nothing in the app had a visible keyboard focus indicator. `:focus-visible`
   shows it for keyboard users without putting a ring on every mouse click. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--brand-400);
  outline-offset: 2px;
  border-radius: 8px;
}
.sidebar :where(a, button):focus-visible { outline-color: var(--accent); outline-offset: -2px; }
.btn:focus-visible { outline-offset: 3px; }

/* Keyboard-only skip link. */
.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 10px; z-index: 9999;
  background: var(--brand-900); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 700;
}
.skip-link:focus { inset-inline-start: 16px; color: #fff; }

/* ------------------------------------------------------- reduced motion
   The dashboard runs an infinite radar sweep, pulsing dots and rotating
   gradients. Respect users who ask the OS to limit motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* Screen-reader-only text. */
.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;
}

/* Disabled controls should look disabled. */
:where(button, .btn)[disabled], :where(button, .btn):disabled {
  opacity: .55; cursor: not-allowed; transform: none !important; box-shadow: none !important;
}

/* Persian/Arabic digits + Latin identifiers must not reorder in RTL flow. */
[dir="ltr"] { unicode-bidi: isolate; }

/* The toast region is announced politely by screen readers (set in app.js). */
.toast-root:empty { display: none; }

/* Consistent selection + caret colour inside dark panels. */
.sidebar ::selection { background: var(--accent); color: #231000; }
