/*
 * IT34 Bootstrap 5.3 theme
 * ------------------------
 * Load AFTER bootstrap.min.css:
 *   <link rel="stylesheet" href=".../bootstrap.min.css">
 *   <link rel="stylesheet" href=".../it34-theme.css">
 *
 * Maps the IT34 design tokens (handbook/design.md) onto Bootstrap.
 * Values are the canonical implementation tokens extracted from the Figma
 * library (IT34_Assets-WEB) and the shipped component libraries.
 * Font: Montserrat (SIL OFL 1.1) - host it yourself with OFL.txt alongside,
 * or load from Google Fonts / @fontsource. Never use Gotham in products.
 */

:root {
  /* -- IT34 Blue scale (custom primary scale, 50-950) ------------------- */
  --it34-blue-50: #f0faff;
  --it34-blue-100: #dff3ff;
  --it34-blue-200: #b9e8fe;
  --it34-blue-300: #7bd9fe;
  --it34-blue-400: #34c5fc;
  --it34-blue-500: #0aafed;
  --it34-blue-600: #008ccb;
  --it34-blue-700: #0073a9; /* primary / brand */
  --it34-blue-800: #055f87;
  --it34-blue-900: #0a4e70;
  --it34-blue-950: #07314a;

  /* -- Semantic tokens (canonical implementation values) ---------------- */
  --it34-primary: var(--it34-blue-700);
  --it34-primary-hover: #00567f;
  --it34-primary-disabled-bg: #80b9d4;
  --it34-primary-disabled-text: #bfdbe9;
  --it34-danger: #b30000;
  --it34-danger-hover: #860000;
  --it34-success: #429946;
  --it34-warning: #e6942e;
  --it34-text: #222222;
  --it34-text-secondary: #666666;
  --it34-text-muted: #9f9f9f;
  --it34-border: #e6e6e6;
  --it34-surface: #f9fafb;
  --it34-focus-ring: rgba(0, 115, 169, 0.75);

  /* -- Bootstrap global variables --------------------------------------- */
  --bs-blue: var(--it34-primary);
  --bs-primary: var(--it34-primary);
  --bs-primary-rgb: 0, 115, 169;
  --bs-secondary: var(--it34-text-secondary);
  --bs-secondary-rgb: 102, 102, 102;
  --bs-success: var(--it34-success);
  --bs-success-rgb: 66, 153, 70;
  --bs-danger: var(--it34-danger);
  --bs-danger-rgb: 179, 0, 0;
  --bs-warning: var(--it34-warning);
  --bs-warning-rgb: 230, 148, 46;

  --bs-body-font-family: "Montserrat", "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-font-size: 0.875rem;      /* 14px - Paragraph Regular */
  --bs-body-line-height: 1.4;
  --bs-body-color: var(--it34-text);
  --bs-body-color-rgb: 34, 34, 34;
  --bs-secondary-color: var(--it34-text-secondary);
  --bs-tertiary-color: var(--it34-text-muted);
  --bs-border-color: var(--it34-border);

  --bs-link-color: var(--it34-primary);
  --bs-link-color-rgb: 0, 115, 169;
  --bs-link-hover-color: var(--it34-primary-hover);
  --bs-link-hover-color-rgb: 0, 86, 127;

  /* Radius scale: 4px default, larger surfaces step up */
  --bs-border-radius: 0.25rem;        /* 4px */
  --bs-border-radius-sm: 0.125rem;    /* 2px */
  --bs-border-radius-lg: 0.5rem;      /* 8px */
  --bs-border-radius-xl: 0.75rem;     /* 12px */
  --bs-border-radius-xxl: 1.5rem;     /* 24px */
  --bs-border-radius-pill: 50rem;

  /* Elevation (Drop Shadow Small / Medium / Large) */
  --bs-box-shadow-sm: 0 4px 8px rgba(0, 0, 0, 0.08);
  --bs-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  --bs-box-shadow-lg: 0 16px 32px rgba(0, 0, 0, 0.08);

  /* Focus ring (2px primary @ 75%) */
  --bs-focus-ring-width: 2px;
  --bs-focus-ring-opacity: 0.75;
  --bs-focus-ring-color: var(--it34-focus-ring);
}

/* -- Typography ---------------------------------------------------------- */
/* Headings: Montserrat Bold; sizes from the Figma text styles */
h1, .h1 { font-size: 3rem; }        /* 48px */
h2, .h2 { font-size: 2rem; }        /* 32px */
h3, .h3 { font-size: 1.5rem; }      /* 24px */
h4, .h4 { font-size: 1.25rem; }     /* 20px */
h5, .h5 { font-size: 1rem; }        /* 16px */
h6, .h6 { font-size: 0.875rem; }    /* 14px */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-weight: 700;
  color: var(--it34-text);
}

/* Labels: Montserrat Medium */
.form-label, label, .it34-label { font-weight: 500; }

/* -- Buttons ------------------------------------------------------------- */
/* Base: 6px/24px padding, 8px icon gap, weight 500, radius 4px.
   Sizes: sm 24px/12px, default(md) 32px/14px, lg 40px/16px. */
.btn {
  --bs-btn-padding-x: 1.5rem;
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-font-size: 0.875rem;
  --bs-btn-font-weight: 500;
  --bs-btn-border-radius: 0.25rem;
  --bs-btn-disabled-opacity: 1;
  --bs-btn-focus-box-shadow: 0 0 0 2px var(--it34-focus-ring);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2rem;                 /* 32px */
}
.btn-sm {
  --bs-btn-padding-x: 1.5rem;
  --bs-btn-padding-y: 0.125rem;
  --bs-btn-font-size: 0.75rem;
  --bs-btn-border-radius: 0.25rem;
  min-height: 1.5rem;               /* 24px */
}
.btn-lg {
  --bs-btn-padding-x: 1.5rem;
  --bs-btn-padding-y: 0.375rem;
  --bs-btn-font-size: 1rem;
  --bs-btn-border-radius: 0.25rem;
  min-height: 2.5rem;               /* 40px */
}

/* primary */
.btn-primary {
  --bs-btn-bg: var(--it34-primary);
  --bs-btn-border-color: var(--it34-primary);
  --bs-btn-color: #ffffff;
  --bs-btn-hover-bg: var(--it34-primary-hover);
  --bs-btn-hover-border-color: var(--it34-primary-hover);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-active-bg: var(--it34-primary-hover);
  --bs-btn-active-border-color: var(--it34-primary-hover);
  --bs-btn-active-color: #ffffff;
  --bs-btn-disabled-bg: var(--it34-primary-disabled-bg);
  --bs-btn-disabled-border-color: var(--it34-primary-disabled-bg);
  --bs-btn-disabled-color: var(--it34-primary-disabled-text);
}

/* secondary (grey) */
.btn-secondary {
  --bs-btn-bg: #e6e6e6;
  --bs-btn-border-color: #e6e6e6;
  --bs-btn-color: #222222;
  --bs-btn-hover-bg: #acacac;
  --bs-btn-hover-border-color: #acacac;
  --bs-btn-hover-color: #222222;
  --bs-btn-active-bg: #acacac;
  --bs-btn-active-border-color: #acacac;
  --bs-btn-active-color: #222222;
  --bs-btn-disabled-bg: #e6e6e6;
  --bs-btn-disabled-border-color: #e6e6e6;
  --bs-btn-disabled-color: #9f9f9f;
}

/* tertiary (outlined) */
.btn-outline-primary {
  --bs-btn-color: var(--it34-primary);
  --bs-btn-bg: #ffffff;
  --bs-btn-border-color: var(--it34-primary);
  --bs-btn-hover-color: var(--it34-primary-hover);
  --bs-btn-hover-bg: #ffffff;
  --bs-btn-hover-border-color: var(--it34-primary-hover);
  --bs-btn-active-color: var(--it34-primary-hover);
  --bs-btn-active-bg: #ffffff;
  --bs-btn-active-border-color: var(--it34-primary-hover);
  --bs-btn-disabled-color: var(--it34-primary-disabled-bg);
  --bs-btn-disabled-bg: #ffffff;
  --bs-btn-disabled-border-color: var(--it34-primary-disabled-bg);
  border-width: 2px;
}

/* text button */
.btn-link {
  --bs-btn-color: var(--it34-primary);
  --bs-btn-hover-color: var(--it34-primary-hover);
  --bs-btn-active-color: var(--it34-primary-hover);
  --bs-btn-disabled-color: var(--it34-primary-disabled-bg);
  text-decoration: none;
}

/* destructive */
.btn-danger {
  --bs-btn-bg: var(--it34-danger);
  --bs-btn-border-color: var(--it34-danger);
  --bs-btn-color: #ffffff;
  --bs-btn-hover-bg: var(--it34-danger-hover);
  --bs-btn-hover-border-color: var(--it34-danger-hover);
  --bs-btn-hover-color: #ffffff;
  --bs-btn-active-bg: var(--it34-danger-hover);
  --bs-btn-active-border-color: var(--it34-danger-hover);
  --bs-btn-active-color: #ffffff;
  --bs-btn-disabled-bg: #d97f7f;
  --bs-btn-disabled-border-color: #d97f7f;
  --bs-btn-disabled-color: #e9bfc0;
}

/* -- Forms --------------------------------------------------------------- */
.form-control,
.form-select {
  font-size: 0.875rem;
  border-radius: 0.25rem;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--it34-primary);
  box-shadow: 0 0 0 2px rgba(0, 115, 169, 0.25);
}
.form-check-input:checked {
  background-color: var(--it34-primary);
  border-color: var(--it34-primary);
}
.form-check-input:focus {
  border-color: var(--it34-primary);
  box-shadow: 0 0 0 2px rgba(0, 115, 169, 0.25);
}

/* -- Alerts (tints of the IT34 semantic colors) --------------------------- */
.alert-success {
  --bs-alert-color: #285c2a;
  --bs-alert-bg: #ecf5ec;
  --bs-alert-border-color: #c6e0c7;
  --bs-alert-link-color: #285c2a;
}
.alert-warning {
  --bs-alert-color: #8a591c;
  --bs-alert-bg: #fdf4e9;
  --bs-alert-border-color: #f7ddbc;
  --bs-alert-link-color: #8a591c;
}
.alert-danger {
  --bs-alert-color: #860000;
  --bs-alert-bg: #f7e6e6;
  --bs-alert-border-color: #e9bfc0;
  --bs-alert-link-color: #860000;
}
.alert-primary {
  --bs-alert-color: #055f87;
  --bs-alert-bg: #f0faff;
  --bs-alert-border-color: #b9e8fe;
  --bs-alert-link-color: #055f87;
}

/* -- Misc components ----------------------------------------------------- */
.nav-link { color: var(--it34-primary); }
.nav-link:hover, .nav-link:focus { color: var(--it34-primary-hover); }
.nav-pills {
  --bs-nav-pills-link-active-bg: var(--it34-primary);
}
.pagination {
  --bs-pagination-color: var(--it34-primary);
  --bs-pagination-active-bg: var(--it34-primary);
  --bs-pagination-active-border-color: var(--it34-primary);
  --bs-pagination-hover-color: var(--it34-primary-hover);
  --bs-pagination-focus-color: var(--it34-primary-hover);
  --bs-pagination-focus-box-shadow: 0 0 0 2px rgba(0, 115, 169, 0.25);
}
.table {
  --bs-table-color: var(--it34-text);
  --bs-table-border-color: var(--it34-border);
}
.table > thead { font-weight: 500; }
.badge { border-radius: 0.25rem; font-weight: 500; }
.modal-content { border-radius: 0.5rem; box-shadow: var(--bs-box-shadow-lg); }
.card { border-color: var(--it34-border); }
.dropdown-menu { box-shadow: var(--bs-box-shadow-sm); }
.progress-bar { background-color: var(--it34-primary); }
