/* ==========================================================================
   Nurses League — Base + reusable components
   All selectors are scoped under .nl-app so the WordPress theme / Elementor
   styles can't leak in and ours can't leak out.
   ========================================================================== */

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

.nl-app {
  font-family: var(--nl-font-body);
  font-size: var(--nl-fs-md);
  line-height: 1.55;
  color: var(--nl-text);
  background: var(--nl-bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  position: relative;
  isolation: isolate;
}

/* Ambient light behind the glass: two soft, static washes. No animation. */
.nl-app::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 85% -10%, var(--nl-bg-tint-a), transparent 70%),
    radial-gradient(50vw 45vh at -5% 105%, var(--nl-bg-tint-b), transparent 70%),
    var(--nl-bg);
}

/* Base element rules use :where() so they carry no specificity and never
   override component classes (e.g. white text on .nl-btn--primary links). */
:where(.nl-app) :where(h1, h2, h3, h4) {
  font-family: var(--nl-font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
  text-wrap: balance;
  color: var(--nl-text);
}
:where(.nl-app) p { margin: 0; }
:where(.nl-app) a { color: var(--nl-blue-600); text-decoration: none; }
:where(.nl-app) a:where(:not([class])):hover { text-decoration: underline; }
:where(.nl-app) button { font: inherit; color: inherit; }
.nl-app :focus-visible { outline: none; box-shadow: var(--nl-focus); border-radius: var(--nl-r-xs); }
.nl-app .nl-num { font-variant-numeric: tabular-nums; }
.nl-app .nl-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Glass surface ---------- */
.nl-glass {
  background: var(--nl-glass-solid);
  border: 1px solid var(--nl-glass-edge);
  border-radius: var(--nl-r-lg);
  box-shadow: var(--nl-shadow-md);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .nl-glass {
    background: var(--nl-glass);
    -webkit-backdrop-filter: blur(var(--nl-blur)) saturate(140%);
    backdrop-filter: blur(var(--nl-blur)) saturate(140%);
    border-color: var(--nl-glass-border);
    box-shadow: var(--nl-shadow-md), inset 0 0 0 1px var(--nl-glass-edge);
  }
}

/* ---------- Card ---------- */
.nl-card { padding: var(--nl-s5); display: flex; flex-direction: column; gap: var(--nl-s4); min-width: 0; }
.nl-card--flush { padding: 0; gap: 0; overflow: hidden; }
.nl-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--nl-s3); }
.nl-card__title { font-size: var(--nl-fs-lg); }
.nl-card__sub { color: var(--nl-text-2); font-size: var(--nl-fs-sm); }
.nl-card__link {
  font-size: var(--nl-fs-sm); font-weight: 600; color: var(--nl-blue-600);
  background: none; border: 0; padding: 4px 2px; cursor: pointer; white-space: nowrap;
}
.nl-card__link:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.nl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--nl-s2);
  min-height: 44px; padding: 0 var(--nl-s5);
  border-radius: var(--nl-r-pill); border: 1px solid transparent;
  font-weight: 600; font-size: var(--nl-fs-md); cursor: pointer; white-space: nowrap;
  transition: background var(--nl-dur) var(--nl-ease), transform var(--nl-dur) var(--nl-ease), box-shadow var(--nl-dur) var(--nl-ease);
  text-decoration: none !important;
}
.nl-btn svg { width: 18px; height: 18px; flex: none; }
.nl-btn:active { transform: translateY(1px); }
.nl-btn--primary { background: var(--nl-blue-600); color: #fff; box-shadow: 0 6px 16px -8px rgba(23, 102, 212, 0.7); }
.nl-btn--primary:hover { background: var(--nl-blue-700); }
.nl-btn--secondary { background: var(--nl-glass-strong); color: var(--nl-text); border-color: var(--nl-hairline-2); }
.nl-btn--secondary:hover { background: #fff; }
.nl-btn--ghost { background: transparent; color: var(--nl-blue-600); }
.nl-btn--ghost:hover { background: var(--nl-blue-50); }
.nl-btn--sm { min-height: 36px; padding: 0 var(--nl-s4); font-size: var(--nl-fs-sm); }
.nl-btn--block { width: 100%; }

.nl-icon-btn {
  position: relative; display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--nl-r-pill);
  background: transparent; border: 0; cursor: pointer; color: var(--nl-text-2);
  transition: background var(--nl-dur) var(--nl-ease), color var(--nl-dur) var(--nl-ease);
}
.nl-icon-btn:hover { background: var(--nl-blue-50); color: var(--nl-text); }
.nl-icon-btn svg { width: 22px; height: 22px; }
.nl-dot-count {
  position: absolute; top: 6px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--nl-r-pill); background: var(--nl-danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--nl-glass-strong);
}

/* ---------- Badges / chips ---------- */
.nl-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--nl-r-pill);
  font-size: var(--nl-fs-xs); font-weight: 600; letter-spacing: 0.02em; white-space: nowrap;
  background: var(--nl-blue-100); color: var(--nl-blue-700);
}
.nl-badge--nursing { background: var(--nl-nursing-bg); color: var(--nl-nursing); }
.nl-badge--midwifery { background: var(--nl-midwifery-bg); color: var(--nl-midwifery); }
.nl-badge--success { background: var(--nl-success-bg); color: var(--nl-success); }
.nl-badge--warning { background: var(--nl-warning-bg); color: var(--nl-warning); }
.nl-badge--danger { background: var(--nl-danger-bg); color: var(--nl-danger); }
.nl-badge--neutral { background: rgba(14, 33, 64, 0.06); color: var(--nl-text-2); }
.nl-badge svg { width: 13px; height: 13px; }


.nl-eyebrow {
  font-size: var(--nl-fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--nl-text-3);
}

/* ---------- Avatar ---------- */
.nl-avatar {
  --size: 40px;
  width: var(--size); height: var(--size); flex: none;
  border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--nl-blue-500), var(--nl-navy-700));
  color: #fff; font-family: var(--nl-font-display); font-weight: 600;
  font-size: calc(var(--size) * 0.38);
  box-shadow: 0 0 0 2px #fff, var(--nl-shadow-sm);
}
.nl-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nl-avatar--lg { --size: 56px; }
.nl-avatar--sm { --size: 32px; }

/* ---------- Progress ---------- */
.nl-progress { display: flex; flex-direction: column; gap: 6px; }
.nl-progress__meta { display: flex; justify-content: space-between; font-size: var(--nl-fs-sm); color: var(--nl-text-2); }
.nl-progress__meta strong { color: var(--nl-text); }
.nl-progress__track { height: 8px; border-radius: var(--nl-r-pill); background: rgba(14, 33, 64, 0.08); overflow: hidden; }
.nl-progress__bar {
  height: 100%; border-radius: inherit; background: var(--nl-blue-600);
  transition: width 600ms var(--nl-ease);
}
.nl-progress--success .nl-progress__bar { background: var(--nl-success); }

.nl-ring { position: relative; width: 64px; height: 64px; flex: none; }
.nl-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.nl-ring__track { fill: none; stroke: rgba(14, 33, 64, 0.08); }
.nl-ring__value { fill: none; stroke: var(--nl-blue-600); stroke-linecap: round; transition: stroke-dashoffset 700ms var(--nl-ease); }
.nl-ring__label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--nl-font-display); font-weight: 600; font-size: var(--nl-fs-md);
}

/* ---------- Stat card ---------- */
.nl-stat { padding: var(--nl-s5); display: flex; flex-direction: column; gap: var(--nl-s3); min-width: 0; }
.nl-stat__top { display: flex; align-items: center; justify-content: space-between; gap: var(--nl-s2); }
.nl-stat__icon {
  width: 36px; height: 36px; border-radius: var(--nl-r-sm); display: grid; place-items: center;
  background: var(--nl-blue-100); color: var(--nl-blue-600);
}
.nl-stat__icon svg { width: 20px; height: 20px; }
.nl-stat__icon--green { background: var(--nl-success-bg); color: var(--nl-success); }
.nl-stat__icon--amber { background: var(--nl-warning-bg); color: var(--nl-warning); }
.nl-stat__icon--navy { background: rgba(10, 27, 51, 0.08); color: var(--nl-navy-800); }
.nl-stat__label { color: var(--nl-text-2); font-size: var(--nl-fs-sm); font-weight: 500; }
.nl-stat__value {
  font-family: var(--nl-font-display); font-size: var(--nl-fs-2xl); font-weight: 600;
  line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.nl-stat__value small { font-size: var(--nl-fs-md); font-weight: 500; color: var(--nl-text-2); margin-left: 2px; }
.nl-stat__foot { font-size: var(--nl-fs-xs); color: var(--nl-text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nl-trend { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; }
.nl-trend--up { color: var(--nl-success); }
.nl-trend--down { color: var(--nl-danger); }
.nl-trend svg { width: 14px; height: 14px; }

/* Streak week strip */
.nl-week { display: flex; gap: 6px; }
.nl-week__day {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; color: var(--nl-text-3);
}
.nl-week__dot { width: 100%; max-width: 22px; height: 6px; border-radius: var(--nl-r-pill); background: rgba(14, 33, 64, 0.08); }
.nl-week__day--on .nl-week__dot { background: var(--nl-warning-dot); }
.nl-week__day--today { color: var(--nl-text); }

/* ---------- List rows ---------- */
.nl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.nl-row {
  display: flex; align-items: center; gap: var(--nl-s3); padding: var(--nl-s3) 0;
  border-top: 1px solid var(--nl-hairline); min-width: 0;
}
.nl-row:first-child { border-top: 0; padding-top: 0; }
.nl-row:last-child { padding-bottom: 0; }
.nl-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nl-row__title { font-weight: 600; font-size: var(--nl-fs-md); overflow-wrap: anywhere; }
.nl-row__meta { font-size: var(--nl-fs-xs); color: var(--nl-text-2); }
.nl-row__end { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

/* Score pill (exam results) */
.nl-score {
  min-width: 56px; padding: 4px 10px; border-radius: var(--nl-r-sm); text-align: center;
  font-family: var(--nl-font-display); font-weight: 600; font-variant-numeric: tabular-nums;
}
.nl-score--pass { background: var(--nl-success-bg); color: var(--nl-success); }
.nl-score--borderline { background: var(--nl-warning-bg); color: var(--nl-warning); }
.nl-score--fail { background: var(--nl-danger-bg); color: var(--nl-danger); }

/* ---------- Empty state ---------- */
.nl-empty { padding: var(--nl-s8) var(--nl-s5); display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--nl-s3); }
.nl-empty__icon {
  width: 56px; height: 56px; border-radius: var(--nl-r-md); display: grid; place-items: center;
  background: var(--nl-blue-100); color: var(--nl-blue-600);
}
.nl-empty__icon svg { width: 28px; height: 28px; }
.nl-empty p { color: var(--nl-text-2); max-width: 46ch; }

/* ---------- Skeleton (loading) ---------- */
.nl-skel {
  border-radius: var(--nl-r-sm);
  background: linear-gradient(90deg, rgba(14,33,64,0.06), rgba(14,33,64,0.11), rgba(14,33,64,0.06));
  background-size: 200% 100%;
  animation: nl-shimmer 1.2s linear infinite;
}
@keyframes nl-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .nl-skel { animation: none; } }

/* ---------- Toast ---------- */
.nl-toasts {
  position: fixed; z-index: 80; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nl-bottomnav-h) + 16px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: var(--nl-s2); align-items: center;
  width: min(92vw, 420px); pointer-events: none;
}
@media (min-width: 1024px) { .nl-toasts { bottom: 24px; } }
.nl-toast {
  pointer-events: auto; width: 100%;
  display: flex; align-items: flex-start; gap: var(--nl-s3);
  padding: var(--nl-s3) var(--nl-s4); border-radius: var(--nl-r-md);
  background: var(--nl-navy-900); color: #fff; box-shadow: var(--nl-shadow-lg);
  font-size: var(--nl-fs-sm);
  animation: nl-toast-in 220ms var(--nl-ease);
}
.nl-toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--nl-blue-200); }
@keyframes nl-toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Page header ---------- */
.nl-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--nl-s4); flex-wrap: wrap; }
.nl-page-head__text { display: flex; flex-direction: column; gap: var(--nl-s1); min-width: 0; }
.nl-page-head h1 { font-size: var(--nl-fs-2xl); }
.nl-page-head p { color: var(--nl-text-2); max-width: 60ch; }
@media (min-width: 768px) { .nl-page-head h1 { font-size: var(--nl-fs-3xl); } }
