/* ============================================================
   Tek-Craft — tokens.css
   Design tokens, light/dark themes, base element styles and
   form controls. Palette: white / slate surfaces, 1px slate
   borders, a dark purple brand palette, amber for
   action and warnings. No gradients, no decorative blobs.
   Radius is capped at 10px; shadows are soft and neutral.
   Tailwind (CDN) mirrors these tokens — see index.html config.
   ============================================================ */

@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/rubik-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/rubik-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("../fonts/rubik-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --brand: #552782;
  --brand-dark: #421c68;
  --brand-text: #52237d;
  --brand-soft: #f4edfc;
  --brand-deep: #301644;
  --accent: #ea580c;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --ok: var(--brand-text);
  --ok-soft: var(--brand-soft);
  --radius: 10px;
  --sidebar: 252px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15101c;
    --surface: #201728;
    --surface-2: #2b2035;
    --ink: #f0ebf6;
    --muted: #b3a9c0;
    --line: #3a2c46;
    --brand-text: #d8b8fa;
    --brand-soft: #322046;
    --danger-soft: #2b1512;
    --warn-soft: #2b2110;
  }
}

[data-theme="dark"] {
  --bg: #15101c;
  --surface: #201728;
  --surface-2: #2b2035;
  --ink: #f0ebf6;
  --muted: #b3a9c0;
  --line: #3a2c46;
  --brand-text: #d8b8fa;
  --brand-soft: #322046;
  --danger-soft: #2b1512;
  --warn-soft: #2b2110;
}

[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e5e7eb;
  --brand-text: #52237d;
  --brand-soft: #f4edfc;
  --danger-soft: #fef2f2;
  --warn-soft: #fffbeb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Rubik, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* Form controls — `body` prefix keeps these ahead of the
   Tailwind preflight reset regardless of stylesheet order. */
body button,
body [role="button"],
body select,
body input:not([type="checkbox"]) {
  min-height: 36px;
  font: inherit;
}

body button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

body button:hover {
  background: var(--surface-2);
}

body button.primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

body button.primary:hover {
  background: var(--brand-dark);
}

body button.orange {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

body button.danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

body button.ghost {
  border-color: transparent;
  background: transparent;
}

body button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

body input,
body select,
body textarea {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 10px;
  width: 100%;
}

body input:focus,
body select:focus,
body textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 0;
  border-color: var(--brand);
}

body label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

body a {
  color: var(--brand-text);
}

/* Inline SVG icons (see components.js icon()) */
.ic {
  display: inline-block;
  vertical-align: -3px;
  flex: none;
}
