/*
  CAREER PACKAGES — SHARED BLADE COMPONENT STYLES
  Batch 36 — Section 54 (Design System).

  Loaded after theme.css. Consumes ONLY the semantic tokens defined
  there (--color-brand, --text-primary, --bg-dark, etc.), never the
  raw color scales directly, per Section 66's "Implementation" note —
  so the palette can move later without touching this file.

  This is one hand-written stylesheet, not a build pipeline (no
  Sass/PostCSS/Vite step exists in this sandbox — see the project
  README's standing note that nothing here has been run against a
  real install). It is organized top-to-bottom to match Section 54's
  own list: base/typography, buttons, forms, cards, navigation,
  status indicators, progress indicators, empty/error/loading states.
*/

/* ---------------------------------------------------------------- */
/* Base / reset / typography                                        */
/* ---------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-page);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text-primary);
}

h1 { font-size: clamp(1.9rem, 1.6rem + 1.2vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2.1rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }

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

/* Focus visibility — Section 55 accessibility requirement, not optional. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--color-info);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section { padding: 3.5rem 0; }
.section--alt { background: var(--bg-section-alt); }
.section--dark { background: var(--bg-dark); color: var(--text-on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--text-on-dark); }
.section--dark p { color: var(--text-on-dark-muted); }

.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;
}
.sr-only:focus {
  position: fixed;
  top: 0.5rem; left: 0.5rem;
  width: auto; height: auto;
  padding: 0.6rem 1rem;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  z-index: 100;
  border-radius: var(--radius-default);
  clip: auto;
}

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 0.5rem;
}

/* ---------------------------------------------------------------- */
/* Buttons                                                          */
/* ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-default);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  /* Touch-friendly per Section 55 — minimum comfortable tap target. */
  min-height: 44px;
}

.btn-primary {
  background: var(--color-action);
  color: var(--color-action-text-on-fill);
}
.btn-primary:hover { background: var(--color-action-hover); color: var(--color-action-text-on-fill); text-decoration: none; }

.btn-brand {
  background: var(--color-brand);
  color: var(--neutral-0);
}
.btn-brand:hover { background: var(--color-brand-hover); color: var(--neutral-0); text-decoration: none; }

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--color-brand); color: var(--color-brand); text-decoration: none; }

.btn-outline-on-dark {
  background: transparent;
  border-color: var(--text-on-dark-muted);
  color: var(--text-on-dark);
}
.btn-outline-on-dark:hover { border-color: var(--text-on-dark); text-decoration: none; }

.btn-block { width: 100%; }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; min-height: 36px; }

/* ---------------------------------------------------------------- */
/* Forms — full form-control set arrives with the first real form   */
/* (auth batch); this is the baseline every later batch builds on.  */
/* ---------------------------------------------------------------- */

label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }

.form-control {
  display: block;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-default);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-card);
}
.form-control:focus { border-color: var(--color-info); outline: none; box-shadow: 0 0 0 3px rgba(46, 117, 214, 0.15); }
.form-control.is-invalid { border-color: var(--color-error); }

.form-group { margin-bottom: 1.1rem; }
.form-help { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; }
.form-error { font-size: 0.82rem; color: var(--color-error); margin-top: 0.3rem; }

/* ---------------------------------------------------------------- */
/* Cards                                                            */
/* ---------------------------------------------------------------- */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-default);
  padding: 1.5rem;
}
.card-hover { transition: box-shadow 0.15s ease, border-color 0.15s ease; }
.card-hover:hover { border-color: var(--border-strong); box-shadow: 0 6px 20px rgba(29, 28, 26, 0.08); }

.grid {
  display: grid;
  gap: 1.5rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- */
/* Navigation                                                       */
/* ---------------------------------------------------------------- */

.site-nav {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.site-nav__brand {
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-on-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-nav__brand:hover { text-decoration: none; color: var(--color-brand-decorative); }
.site-nav__links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav__links a {
  color: var(--text-on-dark-muted);
  font-size: 0.92rem;
  font-weight: 600;
}
.site-nav__links a:hover, .site-nav__links a[aria-current="page"] { color: var(--text-on-dark); text-decoration: none; }
.site-nav__actions { display: flex; align-items: center; gap: 0.75rem; }
.site-nav__toggle { display: none; }

@media (max-width: 860px) {
  .site-nav__links { display: none; }
  .site-nav__toggle { display: inline-flex; }
}

/* ---------------------------------------------------------------- */
/* Footer                                                           */
/* ---------------------------------------------------------------- */

.site-footer {
  background: var(--bg-dark);
  color: var(--text-on-dark-muted);
  padding: 3rem 0 1.5rem;
}
.site-footer h4 { color: var(--text-on-dark); font-size: 0.95rem; margin-bottom: 0.85rem; }
.site-footer a { color: var(--text-on-dark-muted); }
.site-footer a:hover { color: var(--text-on-dark); text-decoration: none; }
.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #3A3934;
}
.site-footer__grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.site-footer__bottom {
  padding-top: 1.5rem;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
@media (max-width: 720px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- */
/* Status indicators / badges                                       */
/* ---------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
}
.badge-brand { background: var(--color-brand-subtle-bg); color: var(--color-brand); }
.badge-success { background: var(--color-action-subtle-bg); color: var(--green-800); }
.badge-info { background: #E8F1FC; color: var(--color-info); }
.badge-warning { background: #FBF0D9; color: #8A6608; }
.badge-error { background: #FBE7E4; color: var(--color-error); }
.badge-neutral { background: var(--neutral-100); color: var(--text-secondary); }

/* ---------------------------------------------------------------- */
/* Progress indicators (stage-aware) — full treatment arrives with   */
/* the learner-dashboard batch; base bar defined now so later        */
/* batches don't invent a second pattern.                            */
/* ---------------------------------------------------------------- */

.progress-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--neutral-100);
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: var(--color-action);
  border-radius: var(--radius-pill);
}

/* ---------------------------------------------------------------- */
/* Empty / error / loading states                                   */
/* ---------------------------------------------------------------- */

.state-block {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}
.state-block h3 { color: var(--text-primary); margin-bottom: 0.4rem; }

.skeleton {
  background: linear-gradient(90deg, var(--neutral-100) 25%, var(--neutral-50) 37%, var(--neutral-100) 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.4s ease infinite;
  border-radius: var(--radius-default);
}
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------------------------------------------------------------- */
/* Data tables — Batch 53 (admin Web UI). No table markup existed    */
/* anywhere in this stylesheet before the admin batch, since every   */
/* public page lists content as cards/grids, never rows.             */
/* ---------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--neutral-100);
  border-radius: var(--radius-default);
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th,
.table td {
  padding: 0.65rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--neutral-100);
  white-space: nowrap;
}
.table th {
  background: var(--neutral-50);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--neutral-50); }
.table td.table-actions { white-space: nowrap; text-align: right; }
.table td.table-actions form { display: inline-block; }

/* ---------------------------------------------------------------- */
/* Admin shell — Batch 53. A sidebar layout, deliberately not built   */
/* on the public .site-nav/.section families (see layouts/admin.     */
/* blade.php's own docblock on why this is a separate layout).       */
/* ---------------------------------------------------------------- */

.admin-shell {
  display: flex;
  min-height: 100vh;
  background: var(--neutral-50);
}
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--text-primary);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
}
.admin-sidebar__brand {
  display: block;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
  text-decoration: none;
}
.admin-sidebar__links {
  list-style: none;
  margin: 0 0 auto;
  padding: 0;
  flex-grow: 1;
}
.admin-sidebar__links li + li { margin-top: 0.1rem; }
.admin-sidebar__links a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-default);
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.92rem;
}
.admin-sidebar__links a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.admin-sidebar__footer {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1rem;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.admin-shell__body {
  flex-grow: 1;
  min-width: 0;
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: #fff;
  border-bottom: 1px solid var(--neutral-100);
}
.admin-topbar__title { margin: 0; font-size: 1.25rem; }
.admin-content { padding: 2rem; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.admin-stat-card {
  background: #fff;
  border: 1px solid var(--neutral-100);
  border-radius: var(--radius-default);
  padding: 1.25rem;
}
.admin-stat-card__value { font-size: 1.75rem; font-weight: 800; color: var(--text-primary); }
.admin-stat-card__label { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.25rem; }
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
