/* ============================================================================
   NexaLume design system — fonts, theme tokens, and shared components.
   Loaded after tailwind.css so it can define the CSS variables that the
   remapped Tailwind palette (tailwind.config.js) resolves at use-time.
   Light is the default; [data-theme="dark"] on <html> flips every token.
   ========================================================================== */

/* ---- Fonts (self-hosted, variable; latin + latin-ext) -------------------- */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/plus-jakarta-sans-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;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/plus-jakarta-sans-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-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;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---- Theme tokens -------------------------------------------------------- */
:root,
[data-theme="light"]{
    --bg: #F5F8FC;
    --bg-soft: #EDF2F9;
    --surface: #FFFFFF;
    --surface-2: #FAFCFE;
    --border: #E5EBF3;
    --border-strong: #D6DFEC;
    --bar-none: #E2E8F1;
    --text: #0C2240;
    --text-2: #5A6B82;
    --text-3: #8A98AB;
    --brand: #1E6FE0;
    --brand-2: #3FA9F5;
    --brand-deep: #0B2A4A;
    --up: #15B981;
    --up-soft: #E4F7EF;
    --warn: #F4A52A;
    --warn-soft: #FDF1DD;
    --down: #F0483E;
    --down-soft: #FCE7E5;
    --c-gray-50: #F5F8FC;
    --c-gray-100: #EDF2F9;
    --c-gray-200: #E5EBF3;
    --c-gray-300: #D6DFEC;
    --c-gray-400: #8A98AB;
    --c-gray-500: #5A6B82;
    --c-gray-600: #475569;
    --c-gray-700: #33415A;
    --c-gray-800: #1E2A3D;
    --c-gray-900: #0C2240;
    --c-blue-50: #EAF2FE;
    --c-blue-100: #D9E8FC;
    --c-blue-300: #A8CDF7;
    --c-blue-500: #1E6FE0;
    --c-blue-600: #1E6FE0;
    --c-blue-700: #1A5FC0;
    --c-emerald-50: #E4F7EF;
    --c-emerald-100: #D1F0E3;
    --c-emerald-300: #8FE0C0;
    --c-emerald-400: #2FC793;
    --c-emerald-500: #15B981;
    --c-emerald-600: #0E9E6E;
    --c-emerald-700: #0A7D57;
    --c-red-50: #FCE7E5;
    --c-red-100: #FBD9D6;
    --c-red-200: #F7C3BE;
    --c-red-300: #F0A8A1;
    --c-red-400: #F26B63;
    --c-red-500: #F0483E;
    --c-red-600: #D83A30;
    --c-red-700: #B32A22;
    --c-amber-50: #FDF1DD;
    --c-amber-100: #FBE8C4;
    --c-amber-200: #F7D89A;
    --c-amber-400: #F4A52A;
    --c-amber-500: #E0921B;
    --c-amber-600: #C47D12;
    --c-amber-700: #9A6410;
    --shadow: 0 1px 2px rgba(12,34,64,.05), 0 10px 30px -16px rgba(12,34,64,.18);
    --shadow-lg: 0 24px 60px -24px rgba(12,34,64,.30);
}

[data-theme="dark"]{
    --bg: #070D18;
    --bg-soft: #0B1424;
    --surface: #0E1A2C;
    --surface-2: #101F35;
    --border: #1B2A42;
    --border-strong: #243653;
    --bar-none: #1B2A42;
    --text: #F2F6FD;
    --text-2: #B2C2D8;
    --text-3: #8597B0;
    --brand: #4DA3FF;
    --brand-2: #7BC2FF;
    --brand-deep: #0B2A4A;
    --up: #26CE96;
    --up-soft: #0F2A20;
    --warn: #F9BC4D;
    --warn-soft: #2A2113;
    --down: #FF6B61;
    --down-soft: #2C1614;
    --c-gray-50: #070D18;
    --c-gray-100: #14233A;
    --c-gray-200: #1B2A42;
    --c-gray-300: #2A3E5C;
    --c-gray-400: #7C90AB;
    --c-gray-500: #94A7BF;
    --c-gray-600: #AABBD2;
    --c-gray-700: #C5D3E6;
    --c-gray-800: #DEE7F3;
    --c-gray-900: #F2F6FD;
    --c-blue-50: #11263F;
    --c-blue-100: #163357;
    --c-blue-300: #2E5C8F;
    --c-blue-500: #4DA3FF;
    --c-blue-600: #2D7CE0;
    --c-blue-700: #246BCB;
    --c-emerald-50: #0F2A20;
    --c-emerald-100: #123528;
    --c-emerald-300: #1E5C45;
    --c-emerald-400: #26CE96;
    --c-emerald-500: #26CE96;
    --c-emerald-600: #34D9A0;
    --c-emerald-700: #5FE3B5;
    --c-red-50: #2C1614;
    --c-red-100: #3A1B18;
    --c-red-200: #4A211D;
    --c-red-300: #6B2C26;
    --c-red-400: #FF6B61;
    --c-red-500: #FF6B61;
    --c-red-600: #FF8079;
    --c-red-700: #FF9B95;
    --c-amber-50: #2A2113;
    --c-amber-100: #382B16;
    --c-amber-200: #4A3A1C;
    --c-amber-400: #F9BC4D;
    --c-amber-500: #F9BC4D;
    --c-amber-600: #FBC96B;
    --c-amber-700: #FBD488;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 14px 34px -18px rgba(0,0,0,.65);
    --shadow-lg: 0 30px 70px -28px rgba(0,0,0,.75);
}

/* ---- Base ---------------------------------------------------------------- */
html { background: var(--bg); }
body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .25s ease, color .25s ease;
}
::selection { background: rgba(63,169,245,.25); }

/* Smooth the theme flip for surfaces/borders without animating layout. */
.nx-anim,
.nx-card { transition: background-color .25s ease, border-color .25s ease, color .25s ease; }

/* ---- Shared components --------------------------------------------------- */
.nx-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* Icon/ghost button used in headers (theme toggle, etc.) */
.nx-icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none; box-shadow: var(--shadow);
  transition: all .18s ease;
}
.nx-icon-btn:hover { color: var(--brand); border-color: var(--brand); }

/* Brand mark gradient tile */
.nx-brand-mark {
  background: linear-gradient(140deg, var(--brand-2), var(--brand-deep));
  display: flex; align-items: center; justify-content: center;
}

/* Status-page 90-day uptime bar */
.nx-bar {
  display: flex; gap: 2px; align-items: flex-end;
  height: 34px; width: 100%;
}
.nx-bar .day {
  flex: 1; min-width: 0; height: 100%; border-radius: 2px;
  transition: transform .1s ease;
}
.nx-bar .day:hover { transform: scaleY(1.18); }

/* ---- Keyframes ----------------------------------------------------------- */
@keyframes nx-fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes nx-modal-in { from { transform: translateY(14px) scale(.97); } to { transform: translateY(0) scale(1); } }
@keyframes nx-pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.nx-pulse-dot { animation: nx-pulse 2.4s ease infinite; }
.nx-fade-up { animation: nx-fade-up .4s ease both; }
.nx-modal-in { animation: nx-modal-in .26s cubic-bezier(.2,.8,.2,1); }

/* Theme-toggle icon swap: moon shows in light (switch→dark), sun in dark. */
.nx-show-light { display: flex; }
.nx-show-dark { display: none; }
[data-theme="dark"] .nx-show-light { display: none; }
[data-theme="dark"] .nx-show-dark { display: flex; }

/* Ghost button (status header "Inscrever-se") */
.nx-btn-ghost {
  display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px;
  border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  box-shadow: var(--shadow); transition: all .18s ease;
}
.nx-btn-ghost:hover { border-color: var(--brand); color: var(--brand); }

/* Inline text links (footer) */
.nx-link { cursor: pointer; transition: color .15s ease; }
.nx-link:hover { color: var(--brand); }

/* ---- Admin sidebar shell ------------------------------------------------- */
.nx-nav {
  display: flex; align-items: center; gap: 11px; width: 100%; height: 38px;
  padding: 0 11px; border: none; border-radius: 10px; font-family: inherit;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s ease;
  background: transparent; color: var(--text-2); text-align: left;
}
.nx-nav:hover { background: var(--bg-soft); color: var(--text); }
.nx-nav.active {
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand); font-weight: 600;
}
.nx-nav svg { width: 18px; height: 18px; flex: none; }
.nx-nav .label { flex: 1; }
.nx-nav-badge {
  font-size: 11px; font-weight: 700; color: var(--brand);
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  padding: 1px 7px; border-radius: 20px;
}

/* Topbar text links */
.nx-toplink {
  font-size: 13px; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: color .15s ease;
}
.nx-toplink:hover { color: var(--brand); }
.nx-toplink.danger:hover { color: var(--down); }

/* Mobile tab selector */
.nx-tab-select {
  height: 38px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); font-size: 13px; font-family: inherit; cursor: pointer;
}

/* ---- Theme-aware scrollbars --------------------------------------------- */
[data-theme="dark"] { color-scheme: dark; }
[data-theme="dark"] ::-webkit-scrollbar { width: 12px; height: 12px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: var(--bg-soft); }
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 8px;
  border: 3px solid var(--bg-soft);
}
