/* Design tokens. Light is the default; dark follows the system unless the user chose a theme. */

@font-face {
  font-family: "Vazir";
  src: url("/fonts/vazir.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* surfaces and text */
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --surface-2: #EFF2F6;
  --surface-hover: #F6F8FB;
  --border: #E2E7EE;
  --border-strong: #CBD3DE;
  --text: #0F1B2D;
  --text-2: #4A5568;
  --text-3: #8A96A8;
  --on-primary: #FFFFFF;

  /* brand */
  --primary: #1F4E79;
  --primary-hover: #173C5E;
  --primary-soft: #EAF1F8;
  --primary-text: #1A4469;

  /* status (solid, soft background, readable text on soft) */
  --success: #12B76A;
  --success-soft: #ECFDF3;
  --success-text: #067647;
  --warning: #F79009;
  --warning-soft: #FFFAEB;
  --warning-text: #B54708;
  --danger: #F04438;
  --danger-soft: #FEF3F2;
  --danger-text: #B42318;
  --info: #2E90FA;
  --info-soft: #EFF8FF;
  --info-text: #175CD3;

  /* elevation and focus */
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .05);
  --shadow-md: 0 6px 16px rgba(15, 27, 45, .07);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
  --focus: 0 0 0 3px rgba(31, 78, 121, .22);
  --overlay: rgba(16, 24, 40, .45);
  --brand-gradient: linear-gradient(135deg, #0F2D4F 0%, #1F4E79 55%, #2B7BB9 100%);
  --auth-gradient: linear-gradient(160deg, #0B2340 0%, #173C5E 50%, #1F6FA8 100%);

  /* type */
  --font: "Vazir", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* spacing scale (4-based) */
  --sp-1: 2px;
  --sp-2: 4px;
  --sp-3: 8px;
  --sp-4: 12px;
  --sp-5: 16px;
  --sp-6: 20px;
  --sp-7: 24px;
  --sp-8: 32px;
  --sp-9: 40px;
  --sp-10: 48px;
  --sp-11: 64px;

  /* radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* motion */
  --ease: cubic-bezier(.2, .7, .3, 1);
  --dur-fast: 150ms;
  --dur: 200ms;

  /* layout */
  --sidebar-w: 264px;
  --rail-w: 72px;
  --topbar-h: 60px;
  --content-max: 1280px;
  --control-h: 40px;
  --row-h: 44px;
  --nav-h: 36px;
}

/* dark theme: system preference, unless the user explicitly chose light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B0F17;
    --surface: #111827;
    --surface-2: #182131;
    --surface-hover: #161F2E;
    --border: #1F2A3B;
    --border-strong: #2B3A52;
    --text: #F2F4F7;
    --text-2: #A9B4C6;
    --text-3: #8592A8;
    --on-primary: #FFFFFF;
    --primary: #6D6AF7;
    --primary-hover: #8583FA;
    --primary-soft: rgba(109, 106, 247, .14);
    --primary-text: #A5A3FB;
    --success: #12B76A;
    --success-soft: rgba(18, 183, 106, .14);
    --success-text: #32D583;
    --warning: #F79009;
    --warning-soft: rgba(247, 144, 9, .14);
    --warning-text: #FDB022;
    --danger: #F04438;
    --danger-soft: rgba(240, 68, 56, .14);
    --danger-text: #F97066;
    --info: #2E90FA;
    --info-soft: rgba(46, 144, 250, .14);
    --info-text: #53B1FD;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
    --focus: 0 0 0 3px rgba(109, 106, 247, .4);
    --overlay: rgba(0, 0, 0, .6);
    --auth-gradient: linear-gradient(160deg, #081A30 0%, #12304F 55%, #1B5C8C 100%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0F17;
  --surface: #111827;
  --surface-2: #182131;
  --surface-hover: #161F2E;
  --border: #1F2A3B;
  --border-strong: #2B3A52;
  --text: #F2F4F7;
  --text-2: #A9B4C6;
  --text-3: #8592A8;
  --primary: #6D6AF7;
  --primary-hover: #8583FA;
  --primary-soft: rgba(109, 106, 247, .14);
  --primary-text: #A5A3FB;
  --success-soft: rgba(18, 183, 106, .14);
  --success-text: #32D583;
  --warning-soft: rgba(247, 144, 9, .14);
  --warning-text: #FDB022;
  --danger-soft: rgba(240, 68, 56, .14);
  --danger-text: #F97066;
  --info-soft: rgba(46, 144, 250, .14);
  --info-text: #53B1FD;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  --focus: 0 0 0 3px rgba(109, 106, 247, .4);
  --overlay: rgba(0, 0, 0, .6);
  --auth-gradient: linear-gradient(160deg, #081A30 0%, #12304F 55%, #1B5C8C 100%);
}
