/* btw.bio — base design system (shared by landing, auth and dashboard) */
/* Inter (variable, SIL OFL) — the UI font; self-hosted latin + latin-ext (Turkish) subsets from @fontsource-variable/inter. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/inter-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/inter-latin-wght-normal.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: #07070a;
  --bg-2: #0b0b10;
  --panel: #0f0f15;
  --panel-2: #14141c;
  --panel-3: #1a1a24;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.12);
  --border-3: rgba(255, 255, 255, 0.2);
  --text: #f4f4f7;
  --muted: #a3a3b6;
  --faint: #6d6d82;
  --accent: #ff2e63;
  --accent-2: #ff7a3d;
  --accent-rgb: 255, 46, 99;
  --grad: linear-gradient(135deg, #ff2e63 0%, #ff7a3d 100%);
  --success: #22c55e;
  --warning: #f5a524;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  --ring: 0 0 0 3px rgba(var(--accent-rgb), 0.3);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
code, .mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid rgba(var(--accent-rgb), 0.9); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(var(--accent-rgb), 0.35); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
[hidden] { display: none !important; }

.icon { width: 18px; height: 18px; flex: none; }
.icon.flip { transform: scaleX(-1); }
.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.container.narrow { width: min(820px, 100% - 40px); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.center { justify-content: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 14px; }
.stack-sm { display: grid; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.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; }
.hp-field { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.link-sm { font-size: 13px; color: var(--muted); }
.link-sm:hover, .link:hover { color: var(--text); }
.link { color: #ff8fab; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--border-2); background: rgba(255, 255, 255, 0.04);
  color: var(--text); font-weight: 600; font-size: 14px; line-height: 1;
  white-space: nowrap; user-select: none; transition: background 0.15s, border-color 0.15s, transform 0.08s, filter 0.15s, opacity 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--border-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.is-disabled, .btn[aria-busy="true"] { opacity: 0.5; pointer-events: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 10px 30px -12px rgba(var(--accent-rgb), 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn-primary:hover { background: var(--grad); border-color: transparent; filter: brightness(1.08) saturate(1.05); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: transparent; }
.btn-danger { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.5); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 14px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn[aria-busy="true"]::after {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--border-2); background: rgba(255, 255, 255, 0.03);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.textarea { height: auto; min-height: 104px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-3); }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(var(--accent-rgb), 0.7); box-shadow: var(--ring); background: rgba(255, 255, 255, 0.05); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: rgba(239, 68, 68, 0.7); }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--border-2); border-radius: 12px; background: rgba(255, 255, 255, 0.03); overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s; }
.input-group:focus-within { border-color: rgba(var(--accent-rgb), 0.7); box-shadow: var(--ring); }
.input-group .addon { display: flex; align-items: center; flex: 0 1 auto; padding: 0 12px; color: var(--faint); font-size: 14px; background: rgba(255, 255, 255, 0.03); white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; }
.input-group .addon:first-child { border-inline-end: 1px solid var(--border); }
.input-group .addon:last-child { border-inline-start: 1px solid var(--border); }
.input-group .input { flex: 1 1 0; width: auto; border: 0; border-radius: 0; background: transparent; box-shadow: none; min-width: 80px; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; inset-inline-end: 15px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select { appearance: none; -webkit-appearance: none; padding-inline-end: 36px; cursor: pointer; }
.select option { background: #14141c; color: var(--text); }
.hint { font-size: 12.5px; color: var(--faint); }
.hint.ok { color: #86efac; }
.hint.bad { color: #fca5a5; }
.form-error { font-size: 13.5px; color: #fca5a5; background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.25); padding: 10px 12px; border-radius: 10px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3); }
.password-wrap { position: relative; }
.password-wrap .input { padding-inline-end: 46px; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--faint); }
.pw-toggle:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.strength i { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); transition: background 0.2s; }
.strength[data-score="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-score="2"] i:nth-child(-n+2) { background: var(--warning); }
.strength[data-score="3"] i:nth-child(-n+3) { background: #a3e635; }
.strength[data-score="4"] i { background: var(--success); }

/* Toggle switch */
.switch { position: relative; display: inline-flex; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.12); transition: background 0.2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); transition: transform 0.2s cubic-bezier(.3, .7, .4, 1.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
[dir="rtl"] .switch input:checked + span::after { transform: translateX(-18px); }
[dir="rtl"] .switch span::after { left: auto; right: 3px; }
.switch input:focus-visible + span { box-shadow: var(--ring); }

/* Range slider (fill set via --fill from JS). Kept left-to-right in RTL pages so the fill matches. */
.range { direction: ltr; -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; outline: none; cursor: pointer; background: linear-gradient(var(--accent), var(--accent)) 0 / var(--fill, 50%) 100% no-repeat, rgba(255, 255, 255, 0.12); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); }
.range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 4px solid var(--accent); }
.range:focus-visible { box-shadow: var(--ring); }

/* ---------- Surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; letter-spacing: -0.01em; }
.card-title .icon { color: var(--accent); }
.card-sub { color: var(--faint); font-size: 13px; margin-top: 3px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.tag.ok { background: rgba(34, 197, 94, 0.12); color: #86efac; }
.tag.bad { background: rgba(239, 68, 68, 0.12); color: #fca5a5; }
.tag.accent { background: rgba(var(--accent-rgb), 0.14); color: #ffa3bb; }
.divider { height: 1px; background: var(--border); border: 0; margin: 16px 0; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; border: 1px solid var(--border-2); background: rgba(255, 255, 255, 0.03); color: var(--muted); }
.notice .icon { margin-top: 1px; }
.notice-warn { border-color: rgba(245, 165, 36, 0.35); background: rgba(245, 165, 36, 0.08); color: #fcd9a0; }
.notice-info { border-color: rgba(59, 130, 246, 0.35); background: rgba(59, 130, 246, 0.08); color: #bfdbfe; }
.notice-danger { border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.08); color: #fecaca; }
.kbd { font-family: var(--mono); font-size: 12px; padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border-2); }
.empty { display: grid; place-items: center; gap: 8px; text-align: center; padding: 32px 16px; color: var(--faint); font-size: 14px; }
.empty .icon { width: 28px; height: 28px; opacity: 0.6; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 1000; inset-inline-end: 16px; bottom: 16px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.toast-item { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #17171f; border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 14px; animation: toast-in 0.25s ease; }
.toast-item .icon { margin-top: 1px; }
.toast-item.success .icon { color: var(--success); }
.toast-item.error .icon { color: var(--danger); }
.toast-item.info .icon { color: var(--info); }
.toast-item.leaving { animation: toast-out 0.2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- Dialog ---------- */
dialog.modal { width: min(500px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--border-2); border-radius: 20px; background: #111118; color: var(--text); box-shadow: var(--shadow); }
dialog.modal.wide { width: min(720px, calc(100vw - 24px)); }
.modal-body .settings-list { margin: 0; }
dialog.modal[open] { animation: pop 0.18s ease; }
dialog.modal::backdrop { background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(6px); }
.modal-body { padding: 22px; display: grid; gap: 14px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h2 { font-size: 18px; }
.modal-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* ---------- Tooltips (CSS only, text comes from data-tip via attr()) ---------- */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  padding: 5px 9px; border-radius: 8px; background: #000; border: 1px solid var(--border-2); color: #fff;
  font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; z-index: 50; animation: fade 0.12s ease;
}
@keyframes fade { from { opacity: 0; } }

/* ---------- Skeleton ---------- */
.skeleton { border-radius: var(--radius-lg); background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03)); background-size: 200% 100%; animation: shimmer 1.4s infinite; min-height: 110px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand-logo { display: block; height: 26px; width: auto; filter: drop-shadow(0 4px 14px rgba(var(--accent-rgb), 0.3)); }
@media (max-width: 420px) { .brand-logo { height: 22px; } }

/* ---------- Language menu (<details>, works without JS) ---------- */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 10px; font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; border: 1px solid transparent; transition: background 0.15s, color 0.15s, border-color 0.15s; user-select: none; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary .icon { width: 16px; height: 16px; }
.lang-menu > summary:hover, .lang-menu[open] > summary { color: var(--text); background: rgba(255, 255, 255, 0.06); border-color: var(--border); }
.lang-list { position: absolute; z-index: 60; top: calc(100% + 6px); inset-inline-end: 0; min-width: 150px; padding: 6px; display: grid; gap: 2px; border-radius: 12px; background: #13131b; border: 1px solid var(--border-2); box-shadow: var(--shadow); animation: pop 0.14s ease; }
.lang-menu.up .lang-list { top: auto; bottom: calc(100% + 6px); inset-inline-end: auto; inset-inline-start: 0; }
.lang-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.lang-list a:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.lang-list a[aria-current="true"] { color: var(--text); background: rgba(var(--accent-rgb), 0.12); }
.lang-list a[aria-current="true"]::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---------- Bidirectional text ---------- */
/* URLs, e-mails, handles and codes always read left-to-right, also inside Arabic pages. */
.ltr { direction: ltr; unicode-bidi: isolate; }
.ltr-input { direction: ltr; }
[dir="rtl"] .ltr:not(span):not(b), [dir="rtl"] .ltr-input { text-align: right; }
[dir="rtl"] .dir-icon, [dir="rtl"] .icon.chev { transform: scaleX(-1); }
[dir="rtl"] .icon.flip.dir-icon { transform: none; }
[dir="rtl"] body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", "Arabic Typesetting", var(--font); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
