/*!
 * Bimtrazer design tokens — v1
 * Served at https://control.bimtrazer.com/tokens/v1/tokens.css
 *
 * Contract of this version: no property is renamed or removed while the URL
 * says v1. Values may be corrected; a breaking change ships as /tokens/v2/.
 *
 * Every property is declared in both themes under the same name. A consumer
 * switches theme by putting `dark-theme` on <body> (or any ancestor) and
 * changes nothing else.
 *
 * Values were taken from the compiled stylesheet of Control, not transcribed
 * by hand: CoreUI Pro 4.6.4 resolved output for the inherited ones, and
 * src/scss/_variables.scss for the project's own. The --cui-* names are an
 * implementation detail of Control and are deliberately not exposed here.
 */

/* ── Poppins ──────────────────────────────────────────────────────────────
 * Self-hosted on purpose: a consumer's CSP allows styles and fonts from this
 * domain only, so Google Fonts is not reachable. Four upright weights, which
 * is what the interface uses; italics are not served.
 *
 * Poppins is licensed under the SIL Open Font License 1.1. The license file
 * travels beside the .woff2 files and must stay served with them.
 */
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/poppins-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/poppins-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/poppins-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/poppins-700.woff2') format('woff2');
}

:root {
  /* ── Typography ── */
  --btz-font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --btz-font-family-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --btz-font-size-base: 1rem;
  --btz-font-size-sm: 0.875rem;
  --btz-font-size-lg: 1.25rem;
  --btz-line-height-base: 1.5;
  --btz-font-weight-normal: 400;
  --btz-font-weight-medium: 500;
  --btz-font-weight-semibold: 600;
  --btz-font-weight-bold: 700;

  /* ── Surfaces ──
   * bg is the page, surface is a card on it, surface-raised is a layer above
   * a card (a popover, a sticky header inside a panel).
   */
  --btz-bg: #ffffff;
  --btz-surface: #ffffff;
  --btz-surface-raised: #ffffff;
  --btz-surface-sunken: #ebedef;
  --btz-surface-hover: rgba(0, 0, 21, 0.03);
  --btz-surface-selected: rgba(50, 31, 219, 0.08);

  /* ── Text ── */
  --btz-text: rgba(44, 56, 74, 0.95);
  --btz-text-muted: rgba(44, 56, 74, 0.681);
  --btz-text-emphasis: #000015;
  --btz-text-on-accent: #ffffff;

  /* ── Borders ── */
  --btz-border: #d8dbe0;
  --btz-border-strong: #b1b7c1;
  --btz-border-width: 1px;

  /* ── Accent and states ──
   * primary is the accent of the product; the four state colours carry the
   * same meaning as everywhere else in the platform.
   */
  --btz-color-primary: #321fdb;
  --btz-color-primary-hover: #2a1ab9;
  --btz-color-secondary: #9da5b1;
  --btz-color-success: #2eb85c;
  --btz-color-info: #3399ff;
  --btz-color-warning: #f9b115;
  --btz-color-danger: #e55353;

  /* Subtle fills of the same states, for banners and badges. */
  --btz-color-success-subtle: rgba(46, 184, 92, 0.12);
  --btz-color-info-subtle: rgba(51, 153, 255, 0.12);
  --btz-color-warning-subtle: rgba(249, 177, 21, 0.14);
  --btz-color-danger-subtle: rgba(229, 83, 83, 0.12);

  /* ── Brand ──
   * The three corporate colours. They are not state colours: use them for
   * identity, never to signal success or failure.
   */
  --btz-brand-electric-violet: #570cdd;
  --btz-brand-egg-blue: #01e3c3;
  --btz-brand-rose: #ff068b;

  /* ── Disciplines ──
   * The colour each construction discipline is drawn with across the
   * platform. A chart or a legend must use these so a block keeps its colour
   * between Control and an app.
   */
  --btz-discipline-estructuras: #727272;
  --btz-discipline-fundaciones: #4b1f6f;
  --btz-discipline-albanilearia: #b5b5b5;
  --btz-discipline-cerramientos: #0d5b64;
  --btz-discipline-terminaciones: #37d5ff;
  --btz-discipline-sanitarias: #4e45e7;
  --btz-discipline-electricas: #01e4c3;

  /* ── Spacing ──
   * Bootstrap's scale, which Control does not override. space-3 between
   * fields, space-4 between sections, space-2 between buttons.
   */
  --btz-space-0: 0;
  --btz-space-1: 0.25rem;
  --btz-space-2: 0.5rem;
  --btz-space-3: 1rem;
  --btz-space-4: 1.5rem;
  --btz-space-5: 3rem;

  /* ── Radii ── */
  --btz-radius-sm: 0.25rem;
  --btz-radius: 0.375rem;
  --btz-radius-lg: 0.5rem;
  --btz-radius-pill: 50rem;

  /* ── Shadows ── */
  --btz-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 21, 0.075);
  --btz-shadow: 0 0.5rem 1rem rgba(0, 0, 21, 0.15);
  --btz-shadow-lg: 0 1rem 3rem rgba(0, 0, 21, 0.175);

  /* ── Focus ──
   * Never remove the ring without replacing it; it is the only affordance a
   * keyboard user has.
   */
  --btz-focus-ring: 0 0 0 0.25rem rgba(50, 31, 219, 0.25);

  /* ── Scrollbar ──
   * Control styles its own; an app that styles one should match.
   */
  --btz-scrollbar-thumb: rgba(0, 0, 21, 0.2);
  --btz-scrollbar-size: 8px;
}

/* ── Dark theme ───────────────────────────────────────────────────────────
 * Values are CoreUI's compiled dark theme, so a panel of an app sits beside a
 * panel of Control without a seam. The page background #181924 is the one
 * Control paints; the two raised surfaces are the values its components use
 * today, written by hand in several of them.
 */
.dark-theme {
  /* Typography does not change between themes; the properties are repeated so
   * that a consumer can read any token from either block. */
  --btz-font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --btz-font-family-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --btz-font-size-base: 1rem;
  --btz-font-size-sm: 0.875rem;
  --btz-font-size-lg: 1.25rem;
  --btz-line-height-base: 1.5;
  --btz-font-weight-normal: 400;
  --btz-font-weight-medium: 500;
  --btz-font-weight-semibold: 600;
  --btz-font-weight-bold: 700;

  --btz-bg: #181924;
  --btz-surface: #2a2b36;
  --btz-surface-raised: #1e1f2a;
  --btz-surface-sunken: #141520;
  --btz-surface-hover: rgba(255, 255, 255, 0.05);
  --btz-surface-selected: rgba(255, 255, 255, 0.1);

  --btz-text: rgba(255, 255, 255, 0.87);
  --btz-text-muted: rgba(255, 255, 255, 0.6);
  --btz-text-emphasis: #ffffff;
  --btz-text-on-accent: #ffffff;

  --btz-border: rgba(255, 255, 255, 0.075);
  --btz-border-strong: rgba(255, 255, 255, 0.2);
  --btz-border-width: 1px;

  --btz-color-primary: #847ccc;
  --btz-color-primary-hover: #9a93d6;
  --btz-color-secondary: #a7a7a7;
  --btz-color-success: #519667;
  --btz-color-info: #5299e0;
  --btz-color-warning: #d5a439;
  --btz-color-danger: #c77171;

  --btz-color-success-subtle: rgba(81, 150, 104, 0.18);
  --btz-color-info-subtle: rgba(82, 153, 224, 0.18);
  --btz-color-warning-subtle: rgba(213, 164, 57, 0.2);
  --btz-color-danger-subtle: rgba(199, 113, 113, 0.18);

  /* Brand and discipline colours are identity, so they do not re-tint with
   * the theme. They are repeated unchanged on purpose. */
  --btz-brand-electric-violet: #570cdd;
  --btz-brand-egg-blue: #01e3c3;
  --btz-brand-rose: #ff068b;

  --btz-discipline-estructuras: #727272;
  --btz-discipline-fundaciones: #4b1f6f;
  --btz-discipline-albanilearia: #b5b5b5;
  --btz-discipline-cerramientos: #0d5b64;
  --btz-discipline-terminaciones: #37d5ff;
  --btz-discipline-sanitarias: #4e45e7;
  --btz-discipline-electricas: #01e4c3;

  --btz-space-0: 0;
  --btz-space-1: 0.25rem;
  --btz-space-2: 0.5rem;
  --btz-space-3: 1rem;
  --btz-space-4: 1.5rem;
  --btz-space-5: 3rem;

  --btz-radius-sm: 0.25rem;
  --btz-radius: 0.375rem;
  --btz-radius-lg: 0.5rem;
  --btz-radius-pill: 50rem;

  --btz-shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
  --btz-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.45);
  --btz-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.6);

  --btz-focus-ring: 0 0 0 0.25rem rgba(132, 124, 204, 0.4);

  --btz-scrollbar-thumb: rgba(255, 255, 255, 0.2);
  --btz-scrollbar-size: 8px;
}

/* ── Breakpoints ──────────────────────────────────────────────────────────
 * Custom properties cannot be used in a media query, so these are the values
 * to write literally. They are Control's, unmodified from Bootstrap 5.
 *
 *   sm   576px    container  540px
 *   md   768px    container  720px     <- Control's mobile boundary
 *   lg   992px    container  960px
 *   xl  1200px    container 1140px
 *   xxl 1400px    container 1320px
 */
