/* ==========================================================================
   QubitDocs — Redesign design system (shared foundation)
   Loaded by BOTH the standalone auth pages and the app shell.
   Keep this file limited to: tokens, base typography, .btn, .form-control,
   .alert, .badge and small utilities. It must NEVER style bare
   input/select/textarea elements (that lives in redesign-auth.css only),
   so nothing can leak into DataTables / select2 / topbar search in the app.
   ========================================================================== */

:root {
  /* ---- Brand: deep navy ink ---- */
  --navy-950: #070B14;
  --navy-900: #0B1220;
  --navy-850: #0E1526;
  --navy-800: #111B30;
  --navy-750: #16223E;
  --navy-700: #1C2A4A;
  --navy-600: #26365A;
  --navy-500: #33456B;

  /* ---- Brand: electric cyan ---- */
  --cyan-300: #67E8F9;
  --cyan-400: #22D3EE;
  --cyan-500: #06B6D4;
  --cyan-600: #0891B2;

  /* ---- Support ---- */
  --blue-500: #3B82F6;
  --blue-600: #2563EB;

  /* ---- Light surfaces ---- */
  --canvas:     #EDF1F8;
  --canvas-2:   #F5F8FC;
  --surface:    #FFFFFF;
  --surface-2:  #F4F7FB;
  --surface-3:  #EBF0F7;

  /* ---- Text ---- */
  --text:        #0B1220;
  --text-strong: #060A13;
  --text-muted:  #57647D;
  --text-subtle: #8593AC;
  --text-oncyan: #06232B;

  /* ---- Lines ---- */
  --border:    #E3E9F2;
  --border-2:  #D3DCEA;
  --border-3:  #C2CDDF;

  /* ---- Semantic ---- */
  --success: #0EA871;
  --success-bg: #E7F7F0;
  --warning: #E0910C;
  --warning-bg: #FCF2DE;
  --danger:  #E14b52;
  --danger-bg: #FCECEC;
  --info:    var(--cyan-500);

  /* ---- Shadows (navy-tinted) ---- */
  --shadow-xs: 0 1px 2px rgba(11,18,32,.06);
  --shadow-sm: 0 2px 6px rgba(11,18,32,.06), 0 1px 2px rgba(11,18,32,.05);
  --shadow:    0 8px 24px -8px rgba(11,18,32,.16), 0 2px 6px rgba(11,18,32,.06);
  --shadow-lg: 0 28px 64px -22px rgba(11,18,32,.34);
  --glow-cyan: 0 0 0 4px rgba(34,211,238,.16);
  --glow-cyan-strong: 0 0 0 1px rgba(34,211,238,.55), 0 10px 34px -10px rgba(34,211,238,.5);

  /* ---- Radii ---- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-pill: 999px;

  /* ---- Type ---- */
  --font-display: 'Sora', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-body:    'IBM Plex Sans', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease: cubic-bezier(.4, .1, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { margin: 0; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: .01em;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5 {
  font-family: var(--font-display);
  letter-spacing: -.02em;
  color: var(--text-strong);
}

a { color: var(--cyan-600); text-decoration: none; transition: color .18s var(--ease); }
a:hover { color: var(--cyan-500); }

::selection { background: rgba(34,211,238,.28); color: var(--navy-900); }

/* Eyebrow / mono label used across auth + dashboard */
.rd-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--cyan-600);
}
.rd-mono { font-family: var(--font-mono); }
.rd-tnum { font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Buttons — fully self-sufficient (work on auth pages w/o Bootstrap, and
   override the themesbrand .btn on app pages since this loads later).
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  letter-spacing: .01em;
  padding: 12px 20px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .16s var(--ease), box-shadow .2s var(--ease),
              background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
  white-space: nowrap;
  -webkit-appearance: none;
  appearance: none;
}
.btn:focus { outline: none; }
.btn:focus-visible { box-shadow: var(--glow-cyan); }
.btn:active { transform: translateY(1px); }

.btn-primary,
.btn-theme {
  background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
  color: #fff;
  border-color: var(--navy-700);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, var(--shadow-sm);
}
.btn-primary:hover,
.btn-theme:hover {
  color: #fff;
  transform: translateY(-1px);
  border-color: var(--cyan-500);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset,
              0 12px 26px -12px rgba(11,18,32,.5),
              0 0 0 1px rgba(34,211,238,.35),
              0 10px 30px -12px rgba(34,211,238,.4);
}

.btn-accent {
  background: linear-gradient(180deg, var(--cyan-400), var(--cyan-500));
  color: var(--text-oncyan);
  border-color: rgba(6,35,43,.12);
  box-shadow: 0 8px 22px -10px rgba(34,211,238,.7);
}
.btn-accent:hover {
  color: var(--text-oncyan);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -10px rgba(34,211,238,.85);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-2);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover { color: var(--text); border-color: var(--border-3); background: var(--surface-2); }

.btn-success { background: var(--success); color: #fff; border-color: transparent; }
.btn-success:hover { color:#fff; transform: translateY(-1px); box-shadow: 0 12px 26px -12px rgba(14,168,113,.6); }
.btn-info { background: var(--cyan-500); color:#fff; border-color: transparent; }
.btn-info:hover { color:#fff; }

.btn-ghost {
  background: transparent; color: var(--text-muted); border-color: transparent;
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }

.btn-block { display: flex; width: 100%; }
.btn-round { border-radius: var(--r-pill); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

/* ==========================================================================
   .form-control (class only — used in login + app forms). Bare-element
   styling for Django's unclassed inputs lives in redesign-auth.css.
   ========================================================================== */
.form-control {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  line-height: 1.4;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.form-control::placeholder { color: var(--text-subtle); }
.form-control:focus {
  outline: none;
  border-color: var(--cyan-400);
  box-shadow: var(--glow-cyan);
  background: var(--surface);
}
/* native selects don't render a reduced line-height well (text clips) */
select.form-control { line-height: normal; }

/* ==========================================================================
   Alerts (used in login errors + app messages)
   ========================================================================== */
.alert {
  font-size: 13.5px;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.alert-danger, .alert-error {
  background: var(--danger-bg); color: #A32A2F; border-color: rgba(225,75,82,.28);
}
.alert-success { background: var(--success-bg); color: #0A6B49; border-color: rgba(14,168,113,.28); }
.alert-warning { background: var(--warning-bg); color: #8A5A08; border-color: rgba(224,145,12,.3); }
.alert-info    { background: #E5F7FB; color: #0A6478; border-color: rgba(6,182,212,.28); }

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .02em;
  padding: 4px 8px;
  border-radius: var(--r-pill);
}
.badge-danger { background: var(--danger); color: #fff; }
.badge-success { background: var(--success); color: #fff; }

/* thin scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-3); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); background-clip: content-box; }
