/* Baosla brand tokens (Brand Guide v1.0): paper 60%, ink 30%, red 10%.
   Red is the compass needle: it marks the one place the eye should go. */
@import url("./fonts.css");

:root {
  --red: #CB2026;
  --red-50: #FBEAEA;
  --red-100: #F5CCCD;
  --red-300: #DF686B;
  --red-600: #A91A1F;
  --red-700: #861519;
  --red-on-night: #E5545A;
  --ink: #333333;
  --ink-2: #6E6E6B;
  --ink-3: #A3A3A0;
  --paper: #FAFAF8;
  --surface: #FFFFFF;
  --gray-50: #F5F5F4;
  --line: #E7E7E5;
  --line-2: #CFCFCC;
  --night: #1F1F1F;
  --night-2: #2A2A29;
  --night-3: #353533;
  --night-line: #3A3A38;
  --on-night: #FAFAF8;
  --on-night-2: #A3A3A0;
  --font-display: "thmanyah serif display", "Thmanyah Serif Display", "Noto Naskh Arabic", serif;
  --font-text: "thmanyah sans", "Thmanyah Sans", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(31, 31, 31, .04), 0 8px 24px rgba(31, 31, 31, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  overflow: hidden;
  font-variant-numeric: lining-nums;
}
input, textarea, select { font-family: inherit; user-select: text; }
button { font-family: inherit; }
[hidden] { display: none !important; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.drag { -webkit-app-region: drag; }
.no-drag, .drag button, .drag input, .drag a { -webkit-app-region: no-drag; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.ic { flex: none; display: block; }
.muted { color: var(--ink-2); }
.eyebrow { color: var(--red); font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.rule { width: 40px; height: 3px; border-radius: 2px; background: var(--red); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--gray-50); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
.btn.primary:hover { background: var(--red-600); border-color: var(--red-600); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--line); color: var(--ink); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--line); color: var(--ink); }

/* form */
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.input {
  height: 44px; width: 100%; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(51, 51, 51, .08); }

/* switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: background .15s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + span { background: var(--ink); }
:root[dir="rtl"] .switch input:checked + span::after { transform: translateX(-18px); }
:root[dir="ltr"] .switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }

/* needle bullet, cut from the logo (never rotated) */
.needle { width: 12px; height: 11px; flex: none; display: inline-block; }

/* toasts */
.toasts { position: fixed; inset-inline: 0; bottom: 56px; display: grid; justify-items: center; gap: 8px; pointer-events: none; z-index: 100; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px; border-radius: 10px; background: var(--night); color: var(--on-night);
  font-size: 13px; box-shadow: var(--shadow); animation: toast-in .2s ease-out;
}
.toast.warn .ic { color: var(--red-on-night); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* progress */
.bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .2s; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
