/* =============================================================
   HUB POLISH — 2026
   Shared visual refinements for the 10 hub surfaces.
   Loaded AFTER the extracted base sheets so it can override
   without touching legacy rules. No new components; only
   tightening, rhythm, hierarchy and premium cues.
   ============================================================= */

:root {
  --hp-hairline: rgba(198,163,84,0.45);
  --hp-card-border: rgba(39,62,87,0.09);
  --hp-card-border-strong: rgba(39,62,87,0.18);
  --hp-card-shadow: 0 1px 2px rgba(20,38,63,0.04), 0 8px 24px rgba(20,38,63,0.05);
  --hp-card-shadow-hover: 0 2px 4px rgba(20,38,63,0.05), 0 20px 40px rgba(20,38,63,0.09);
  --hp-surface-soft: #f6f9fd;
}

/* ---------- 1. Nav rhythm ---------- */
.nav {
  border-bottom: 1px solid rgba(39,62,87,0.07);
  backdrop-filter: saturate(1.1) blur(8px);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  background: rgba(255,255,255,0.86);
}
.nav-inner { min-height: 64px; }
.nav-links { gap: 2px; }
.nav-link {
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 150ms ease, color 150ms ease;
}
.nav-link:hover { background: rgba(39,62,87,0.04); }
.nav-link.is-active {
  background: rgba(39,62,87,0.06);
  color: var(--clr-primary, #273e57);
}
.nav-actions .btn.btn-sm { height: 34px; padding-inline: 14px; }
.nav-sep {
  width: 1px; height: 22px; background: rgba(39,62,87,0.12);
  display: inline-block; margin: 0 2px;
}

/* ---------- 2. Page heads ---------- */
.page-head,
.page-head-compact { position: relative; }
.page-head .eyebrow,
.page-head-compact .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 650;
  color: var(--clr-primary-400, #3d5a7a);
}
.page-head h1 { letter-spacing: -0.025em; line-height: 1.08; }
.page-head .lead { line-height: 1.55; color: var(--clr-text-muted, #4a5a73); }
.page-head.center h1 { text-wrap: balance; max-width: 22ch; margin-inline: auto; }

/* Gold hairline accent below page heads — premium cue, one pixel tall */
.page-head::after,
.page-head-compact::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(880px, 82%);
  height: 2px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: var(--hp-hairline);
  opacity: 0.9;
}

/* ---------- 3. Sections & rhythm ---------- */
.section { padding-block: clamp(48px, 6vw, 88px); }
.section-tight { padding-block: clamp(28px, 4vw, 48px); }
.section-head { margin-bottom: clamp(24px, 3vw, 40px); }
.section-head .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 650;
  color: var(--clr-primary-400, #3d5a7a);
}
.section-head h2 { letter-spacing: -0.02em; line-height: 1.12; }

/* ---------- 4. Cards (mod-card baseline) ---------- */
.mod-card {
  border-color: var(--hp-card-border);
  border-radius: 14px;
  padding: 22px 22px 20px;
  gap: 8px;
  box-shadow: var(--hp-card-shadow);
}
.mod-card:hover {
  border-color: var(--hp-card-border-strong);
  box-shadow: var(--hp-card-shadow-hover);
  transform: translateY(-1px);
}
.mod-card h3 {
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 0;
}
.mod-card p { font-size: 0.8875rem; margin: 0; }
.mod-card .mod-meta,
.mod-card .mod-foot {
  border-top: 1px solid var(--hp-card-border);
  margin-top: 14px;
  padding-top: 12px;
}
.mod-card .mod-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* Accent rail for "internal" single-column contexts (dashboard/study/training-area)
   Only applies when the grid contains at most 3 simple cards. */
.catalog-grid > .mod-card,
.builder-grid > .builder-card-wrap > .builder {
  position: relative;
  overflow: hidden;
}
.catalog-grid > .mod-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, rgba(198,163,84,0.0) 0%, rgba(198,163,84,0.9) 50%, rgba(198,163,84,0.0) 100%);
  opacity: 0;
  transition: opacity 200ms ease;
}
.catalog-grid > .mod-card:hover::before { opacity: 1; }

/* ---------- 5. Builder grid (training-area) ---------- */
.builder-grid { gap: 16px; }
.builder {
  border-color: var(--hp-card-border);
  border-radius: 14px !important;
  padding: 20px 22px;
  box-shadow: var(--hp-card-shadow);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.builder:hover {
  border-color: var(--hp-card-border-strong);
  box-shadow: var(--hp-card-shadow-hover);
  transform: translateY(-1px);
}
.builder-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: inline-grid; place-items: center;
  background: linear-gradient(135deg, #f3f6fb 0%, #e7edf4 100%);
  color: var(--clr-primary, #273e57);
  font-weight: 700;
  font-size: 18px;
  border: 1px solid var(--hp-card-border);
}

/* ---------- 6. Panels (progress / profile) ---------- */
.panel {
  border-color: var(--hp-card-border);
  border-radius: 16px;
  box-shadow: var(--hp-card-shadow);
}
.panel-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hp-card-border);
  margin-bottom: 18px !important;
}
.panel-head h3 { letter-spacing: -0.01em; }

/* ---------- 7. KPI cards ---------- */
.kpi-card {
  border-color: var(--hp-card-border);
  border-radius: 14px;
  box-shadow: var(--hp-card-shadow);
  transition: box-shadow 200ms ease, border-color 200ms ease;
}
.kpi-card:hover { box-shadow: var(--hp-card-shadow-hover); border-color: var(--hp-card-border-strong); }
.kpi-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  font-weight: 650;
  color: var(--clr-text-muted, #4a5a73);
}
.kpi-value { letter-spacing: -0.03em; font-weight: 700; }

/* ---------- 8. Pricing cards ---------- */
.price-card {
  border-color: var(--hp-card-border);
  border-radius: 18px;
  padding: 28px 26px;
  box-shadow: var(--hp-card-shadow);
  transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}
.price-card:hover {
  box-shadow: var(--hp-card-shadow-hover);
  transform: translateY(-2px);
}
.price-card.is-featured {
  border-color: rgba(198,163,84,0.5);
  box-shadow: 0 2px 4px rgba(20,38,63,0.05), 0 24px 48px rgba(168,133,60,0.12);
}
.price-card .price-num { letter-spacing: -0.035em; font-weight: 700; }
.price-ribbon { letter-spacing: 0.08em; }

/* Compare table — readability + mobile */
.compare th, .compare td {
  padding: 14px 16px;
  font-size: 0.9375rem;
}
.compare thead th {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--clr-text-muted, #4a5a73);
  border-bottom: 1px solid var(--hp-card-border-strong);
}
.compare tbody tr + tr td { border-top: 1px solid var(--hp-card-border); }
.compare .is-featured { background: rgba(198,163,84,0.04); }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hp-card-border);
  border-radius: 14px;
  background: #fff;
}

/* ---------- 9. Footer CTA block ---------- */
.footer-cta {
  padding-block: clamp(48px, 7vw, 96px);
  text-align: center;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(198,163,84,0.08), transparent 65%),
    linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
  border-top: 1px solid var(--hp-card-border);
  border-bottom: 1px solid var(--hp-card-border);
}
.footer-cta .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 650;
  color: var(--clr-primary-400, #3d5a7a);
  justify-content: center;
}
.footer-cta h2 {
  font-size: clamp(1.75rem, 3.2vw, 2.375rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 12px auto 24px;
  max-width: 22ch;
  text-wrap: balance;
}
.footer-cta-actions {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.footer-lang {
  margin-top: 28px;
  display: flex; gap: 6px;
  justify-content: center; flex-wrap: wrap;
}
.footer-lang .chip {
  font-size: 10px; letter-spacing: 0.1em;
  font-weight: 650;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--hp-card-border);
  color: var(--clr-text-muted, #4a5a73);
}

/* Unified footer cols — only pad when actually has grid */
.footer-cols { background: #fff; }
.footer-cols:has(.footer-grid) { padding-block: 56px 28px; }
.footer-cols:not(:has(.footer-grid)) { padding-block: 20px 24px; }
.footer-cols:not(:has(.footer-grid)) .footer-bottom {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  justify-content: center;
  gap: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, 1fr);
  gap: 32px;
}
.footer-grid h5 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--clr-text-muted, #4a5a73);
  margin-bottom: 12px;
  font-weight: 650;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a, .footer-grid span { font-size: 13.5px; color: var(--clr-text, #1a2c42); text-decoration: none; }
.footer-grid a:hover { color: var(--clr-primary, #273e57); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--hp-card-border);
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 12px; color: var(--clr-text-subtle, #8fa0b5);
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-bottom { flex-direction: column; gap: 4px; }
}

/* ---------- 10. Hero stats (index) ---------- */
.hero-stats-row {
  gap: 20px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--hp-card-border);
  border-radius: 14px;
  box-shadow: var(--hp-card-shadow);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.hero-stat-item strong {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  color: var(--clr-primary, #273e57);
}
.hero-stat-item span {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--clr-text-muted, #4a5a73);
}
.hero-stat-sep { background: rgba(39,62,87,0.1); }
@media (max-width: 640px) {
  .hero-stats-row { flex-wrap: wrap; row-gap: 14px; }
  .hero-stat-sep { display: none; }
}

/* ---------- 11. Progress hero balance ---------- */
.progress-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
}
.progress-hero-actions { display: inline-flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .progress-hero { grid-template-columns: 1fr; }
  .progress-hero-actions { justify-content: flex-start; }
}

/* ---------- 12. Eyebrow unification ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 650;
  color: var(--clr-primary-400, #3d5a7a);
}
.eyebrow::before {
  content: "";
  width: 18px; height: 1px;
  background: currentColor;
  opacity: 0.55;
}

/* ---------- 13. Buttons: subtle consistency ---------- */
.btn {
  letter-spacing: -0.005em;
  font-weight: 600;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, border-color 150ms ease;
}
.btn-lg { height: 46px; padding-inline: 22px; font-size: 15px; }
.btn-sm { height: 34px; padding-inline: 14px; font-size: 13.5px; }
.btn-primary { box-shadow: 0 1px 2px rgba(20,38,63,0.12), 0 8px 24px rgba(20,38,63,0.12); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(20,38,63,0.15), 0 14px 30px rgba(20,38,63,0.18); }
.btn-gold { box-shadow: 0 1px 2px rgba(168,133,60,0.2), 0 10px 24px rgba(168,133,60,0.22); }
.btn-gold:hover { transform: translateY(-1px); }
.btn-ghost:hover { background: rgba(39,62,87,0.04); }
.btn-secondary { background: #fff; border: 1px solid var(--hp-card-border-strong); color: var(--clr-primary, #273e57); }
.btn-secondary:hover { border-color: var(--clr-primary, #273e57); background: var(--hp-surface-soft); }

/* ---------- 14. Billing toggle & chips ---------- */
.billing-toggle {
  display: inline-flex;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--hp-card-border);
  border-radius: 999px;
  box-shadow: var(--hp-card-shadow);
  margin-top: 22px;
}
.billing-toggle button {
  border: 0; background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--clr-text-muted, #4a5a73);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.billing-toggle button.is-on {
  background: var(--clr-primary, #273e57);
  color: #fff;
}

/* ---------- 15. Seg tabs refinement ---------- */
.seg-tabs {
  background: var(--hp-surface-soft);
  border-color: var(--hp-card-border);
  padding: 3px;
  border-radius: 10px;
}
.seg-tabs button { height: 32px; padding: 0 14px; }
.seg-tabs button.is-on { box-shadow: 0 1px 2px rgba(20,38,63,0.08); }

/* ---------- 16. Mobile nav polish ---------- */
.mobile-menu { backdrop-filter: blur(10px); }
.mobile-menu-links a {
  padding: 12px 4px;
  border-bottom: 1px solid var(--hp-card-border);
  font-weight: 550;
  letter-spacing: -0.005em;
}
.mobile-menu-links a.is-active { color: var(--clr-primary, #273e57); font-weight: 650; }

/* ---------- 17. Responsive breathing on section-tight ---------- */
@media (max-width: 720px) {
  .section-tight { padding-block: 28px; }
  .page-head { padding-block: 48px 28px; }
  .page-head h1 { font-size: clamp(1.75rem, 7vw, 2.25rem); }
}

/* ---------- 18. Login surface refinement ---------- */
.login-card {
  border-color: var(--hp-card-border) !important;
  border-radius: 16px !important;
  box-shadow: var(--hp-card-shadow-hover);
}
.login-status {
  background: var(--hp-surface-soft);
  border: 1px solid var(--hp-card-border);
  border-radius: 12px;
  padding: 14px 16px;
}
.login-plan-item {
  border: 1px solid var(--hp-card-border);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
}

/* ---------- 19. Profile surface tightening ---------- */
.profile-field label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 650;
  color: var(--clr-text-muted, #4a5a73);
  margin-bottom: 6px;
  display: block;
}
.profile-input, .profile-select {
  border-color: var(--hp-card-border);
  border-radius: 10px;
  height: 42px;
  padding-inline: 12px;
  font-size: 14px;
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.profile-input:focus, .profile-select:focus {
  border-color: var(--clr-primary-400, #3d5a7a);
  box-shadow: 0 0 0 3px rgba(39,62,87,0.1);
  outline: none;
}

/* ---------- 20. Reduce visual noise ---------- */
/* Drop double stat separators on small screens */
@media (max-width: 520px) {
  .hero-stat-sep { display: none; }
  .hero-stats-row { gap: 14px 20px; justify-content: flex-start; }
}
/* (removed) Do not hide nested footer-bottom — it's the copyright on internal pages */
