/* FL CDL Training — reset and shared primitives
 * ─────────────────────────────────────────────────────────────────────────────
 * Everything both the marketing page and the course app need. Page-specific
 * layout lives in site.css / app.css.
 */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Controls do not inherit font by default; naming them explicitly is what keeps
   a <select> from rendering in the browser's default serif next to a heading
   that isn't. */
button,
input,
select,
textarea,
optgroup,
option {
  font-family: inherit;
  font-size: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--text-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Keyboard focus must stay visible everywhere. :focus-visible rather than
   :focus so a mouse click does not leave a ring behind. */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respect a reduced-motion preference: the hover lifts and the rainbow shimmer
   are decoration, and vestibular disorders are not hypothetical. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Desktop scrollbars, matching the sibling app's web reset. */
@media (min-width: 1024px) {
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 5px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
}

/* ── Layout helpers ───────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 32px);
}

.wrap-narrow {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 32px);
}

/* The sticky nav would otherwise park every jumped-to heading behind itself. */
.anchor {
  scroll-margin-top: calc(var(--nav-height) + 20px);
}

.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;
}

/* Skip link — the course app's nav is long, and a keyboard user should not have
   to tab through it on every route change. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 20px;
  background: var(--primary);
  color: var(--on-accent);
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 700;
}
.skip-link:focus {
  left: 0;
}

/* ── Brand primitives ─────────────────────────────────────────────────────── */

/* The rainbow headline. background-clip:text has no React Native equivalent,
   which is why the sibling product's landing page is raw DOM too. */
.rainbow-text {
  background-image: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.gradient-rule {
  width: 56px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--gradient-brand-h);
}

.eyebrow {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.eyebrow-center {
  align-items: center;
}
.eyebrow > span {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-eyebrow);
  /* --ink-indigo, not --brand-indigo: this is text. */
  color: var(--ink-indigo);
}

.section-head {
  max-width: 680px;
  margin: 0 0 56px;
}
.section-head-center {
  margin: 0 auto 56px;
  text-align: center;
}
.section-head h2 {
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
  font-weight: 800;
}
.section-head p {
  margin-top: 18px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  border-radius: var(--radius-full);
  padding: 13px 26px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease,
    border-color 0.15s ease;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  text-decoration: none;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  background: var(--border);
  color: var(--text-tertiary);
  box-shadow: none;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-accent);
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-light {
  background: var(--white);
  color: var(--slate-900);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  font-weight: 800;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 14px;
}
.btn-lg {
  padding: 15px 30px;
  font-size: 17px;
}
.btn-block {
  width: 100%;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.card-hover {
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease;
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* ── Pills / chips ────────────────────────────────────────────────────────── */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
/* Status pills take --on-status-fill, never --on-accent. White on --success is
   2.54:1; reaching for the blue-fill token here is worse than no token. */
.pill-success {
  background: var(--success);
  color: var(--on-status-fill);
}
.pill-warning {
  background: var(--warning);
  color: var(--on-status-fill);
}
.pill-error {
  background: var(--error);
  color: var(--on-status-fill);
}
.pill-primary {
  background: var(--primary);
  color: var(--on-accent);
}
.pill-quiet {
  background: var(--background-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ── Callouts ─────────────────────────────────────────────────────────────── */
/* Left-bordered panels used throughout the lessons. Icon + coloured rail rather
   than a coloured background wash, so body text keeps its normal contrast. */

.callout {
  display: flex;
  gap: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  border-left-width: 4px;
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.callout strong {
  color: var(--text-primary);
}
.callout .callout-icon {
  flex: none;
  font-size: 18px;
  line-height: 1.4;
}
.callout-tip {
  background: var(--info-bg);
  border-left-color: var(--info);
}
.callout-warning {
  background: var(--warning-bg);
  border-left-color: var(--warning);
}
.callout-important,
.callout-danger {
  background: var(--error-bg);
  border-left-color: var(--error);
}
.callout-note,
.callout-info {
  background: var(--background-secondary);
  border-left-color: var(--slate-400);
}
.callout-success {
  background: var(--success-bg);
  border-left-color: var(--success);
}

/* ── Progress bar ─────────────────────────────────────────────────────────── */

.progress {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--border);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--primary);
  transition: width 0.4s ease;
}
.progress-success > span {
  background: var(--success);
}
.progress-rainbow > span {
  background: var(--gradient-brand-h);
}
.progress-thin {
  height: 6px;
}

/* ── Tables ───────────────────────────────────────────────────────────────── */
/* Wide content scrolls inside its own container; the page body must never
   scroll horizontally. */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data th,
table.data td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
table.data th {
  background: var(--background-secondary);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}
table.data td {
  color: var(--text-secondary);
}
table.data tr:last-child td {
  border-bottom: 0;
}

/* ── Grids ────────────────────────────────────────────────────────────────── */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

@media (max-width: 980px) {
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

/* ── Empty / loading states ───────────────────────────────────────────────── */

.empty {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-secondary);
}
.empty .empty-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 14px;
}
.empty h3 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
