/* ============================================
   Pages.css - Unified modern design language
   Applied across all non-landing pages
============================================ */

body { background: #fafbff; }

/* ---- Subtle background grid pattern utility ---- */
.dotted-bg {
  background-image: radial-gradient(circle, rgba(99,102,241,0.12) 1px, transparent 1px);
  background-size: 18px 18px;
}
.dotted-bg-light {
  background-image: radial-gradient(circle, rgba(255,255,255,0.18) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* ---- Refined primary color shift to a fresher indigo with subtle gradient ---- */
:root {
  --grad-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #a855f7 100%);
  --grad-warm: linear-gradient(135deg, #fb923c 0%, #ec4899 100%);
  --grad-cool: linear-gradient(135deg, #0ea5e9 0%, #4f46e5 100%);
  --section-bg: #fafbff;
}

/* ---------- Wider container shared across pages ---------- */
.container-x { max-width: 1360px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 700px) { .container-x { padding: 0 20px; } }

/* ---------- PAGE HERO (rounded split panel) ---------- */
.page-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 28px;
  overflow: hidden;
  margin: 24px 0 40px;
  align-items: stretch;
  min-height: 400px;
  position: relative;
}
.page-hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, #4f46e5, #ec4899, #f59e0b);
  z-index: 1;
}
.page-hero-left {
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  min-width: 0;
}
.page-hero-left > .eyebrow { margin-bottom: 16px; align-self: flex-start; }
.page-hero-left > h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
  max-width: 520px;
}
.page-hero-left > .lead {
  font-size: 16px;
  color: var(--gray-600);
  margin: 0 0 24px;
  max-width: 480px;
  line-height: 1.55;
}
.page-hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.page-hero-actions .btn { height: 46px; }
.page-hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-100);
  align-items: flex-end;
}
.page-hero-stats .stat { line-height: 1.2; }
.page-hero-stats .num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  display: block;
  letter-spacing: -0.02em;
}
.page-hero-stats .lbl {
  font-size: 12.5px;
  color: var(--gray-500);
  margin-top: 2px;
  display: block;
}

.page-hero-right {
  position: relative;
  /* Was: min-height: 400px — that combined with images of arbitrary
     native aspect ratio could stretch the hero to 700-800px tall when
     the source image was portrait or square. Now we let the parent
     .page-hero decide the height and the image fills it with
     object-fit:cover. Far more predictable. */
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-hero-right img {
  width: 100%; height: 100%;
  /* max-height ensures the image never tries to push the parent taller
     than the hero's set height, no matter how the global img rule
     (max-width:100%; height:auto in style.css) tries to interact. */
  max-height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 2;
}
.page-hero-right.tint-purple { background: linear-gradient(135deg, #eef2ff 0%, #ddd6fe 60%, #fce7f3 100%); }
.page-hero-right.tint-amber { background: linear-gradient(135deg, #fef3c7 0%, #fde8d4 50%, #fdba74 100%); }
.page-hero-right.tint-green { background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 50%, #ccfbf1 100%); }
.page-hero-right.tint-blue { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 50%, #c7d2fe 100%); }
.page-hero-right.tint-pink { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 50%, #f5d0fe 100%); }
.page-hero-right.tint-mint { background: linear-gradient(135deg, #d1fae5 0%, #99f6e4 50%, #a5f3fc 100%); }

/* Decorative floating shape on right side - sits behind image */
.page-hero-right::after {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  z-index: 1;
  pointer-events: none;
}

@media (max-width: 900px) {
  .page-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .page-hero-left { padding: 36px 24px; }
  .page-hero-right { min-height: 240px; }
  .page-hero-stats { gap: 22px; margin-top: 24px; }
  .page-hero-stats .num { font-size: 20px; }
}

/* ---------- TOPIC BANNER (compact promo across page) ---------- */
.topic-banner {
  border-radius: 24px;
  padding: 40px;
  margin: 12px 0 36px;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 36px;
  align-items: center;
  position: relative;
  overflow: hidden;
  min-height: 240px;
}
.topic-banner > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.topic-banner.b-purple { background: linear-gradient(135deg, #c7b7ff, #b39dff); color: #fff; }
.topic-banner.b-navy { background: linear-gradient(135deg, #0a3c8c, #1e40af); color: #fff; }
.topic-banner.b-peach { background: linear-gradient(135deg, #fde8d4, #fbcfb0); color: var(--gray-900); }
.topic-banner.b-mint { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: var(--gray-900); }
.topic-banner.b-rose { background: linear-gradient(135deg, #fce7f3, #fbcfe8); color: var(--gray-900); }
.topic-banner.b-dark { background: linear-gradient(135deg, #0f172a, #1e293b); color: #fff; }

/* Decorative floating circle on banners */
.topic-banner::after {
  content: "";
  position: absolute;
  top: -80px; right: -80px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  pointer-events: none;
}
.topic-banner.b-peach::after, .topic-banner.b-mint::after, .topic-banner.b-rose::after { background: rgba(255,255,255,0.55); }

.topic-banner h3 {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  color: inherit;
  line-height: 1.2;
}
.topic-banner p {
  font-size: 15px;
  opacity: 0.92;
  margin: 0 0 20px;
  max-width: 460px;
  line-height: 1.55;
}
.topic-banner .visual {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  position: relative;
  z-index: 1;
}
.topic-banner .visual img {
  width: 100%;
  max-width: 280px;
  height: 200px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.18);
}
.topic-banner .pill-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  background: #fff;
  color: var(--gray-900);
  font-weight: 600;
  font-size: 14.5px;
  width: max-content;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}
.topic-banner.b-peach .pill-cta,
.topic-banner.b-mint .pill-cta,
.topic-banner.b-rose .pill-cta { background: var(--gray-900); color: #fff; }
.topic-banner .pill-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0,0,0,0.18); }

@media (max-width: 800px) {
  .topic-banner {
    grid-template-columns: 1fr;
    padding: 28px 24px;
    gap: 22px;
  }
  .topic-banner .visual img { max-width: 240px; height: 160px; }
}

/* ---------- SECTION ---------- */
.psec { padding: 44px 0; }
.psec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}
.psec-head > div:first-child { min-width: 0; flex: 1; }
.psec-head h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.2;
}
.psec-head p {
  color: var(--gray-600);
  font-size: 15px;
  margin: 6px 0 0;
}
.psec-head .link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--primary);
  font-size: 14.5px;
  white-space: nowrap;
  transition: gap 0.2s;
}
.psec-head .link:hover { gap: 10px; }

/* Accent bar before headings as design refresh */
.psec-head h2.with-bar { padding-left: 16px; position: relative; }
.psec-head h2.with-bar::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--primary), #ec4899);
}

/* ---------- MODERN CARD ---------- */
.m-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 18px;
  overflow: hidden;
  transition: var(--transition);
}
.m-card:hover { box-shadow: 0 14px 30px rgba(0,0,0,0.06); transform: translateY(-3px); border-color: transparent; }
.m-card-body { padding: 22px; }

/* ---------- PASTEL CONTAINER (group cards with theme) ---------- */
.pastel-group {
  border-radius: 22px;
  padding: 28px;
  margin-bottom: 22px;
}
.pastel-group.p-blue { background: #f0f4ff; }
.pastel-group.p-purple { background: #f3f0ff; }
.pastel-group.p-mint { background: #ecfdf5; }
.pastel-group.p-rose { background: #fdf2f8; }
.pastel-group.p-amber { background: #fffbeb; }
.pastel-group h3 {
  font-size: 1.1rem; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
}

/* ---------- THIN PAGE HEADER (for dashboard-style pages) ---------- */
.thin-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 14px;
}
.thin-header h1 {
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  letter-spacing: -0.02em;
}
.thin-header .sub { color: var(--gray-500); font-size: 14.5px; margin-top: 4px; }

/* ---------- ROUND ICON / FEATURE TILE ---------- */
.feat-tile {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 18px;
  padding: 26px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 180px;
}
.feat-tile::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: transparent;
  transition: var(--transition);
}
.feat-tile:hover {
  box-shadow: 0 14px 30px rgba(0,0,0,0.06);
  transform: translateY(-4px);
  border-color: transparent;
}
.feat-tile:hover::before { background: var(--primary); }
.feat-tile .ic {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 22px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.feat-tile h4 {
  font-size: 17px;
  margin: 0 0 8px;
  line-height: 1.3;
}
.feat-tile p {
  font-size: 14px;
  color: var(--gray-600);
  margin: 0;
  line-height: 1.5;
}

/* ---------- FOOTER ROUNDED CONTAINER ---------- */
.footer { border-radius: 24px 24px 0 0; }

/* ---------- ACCENT TINT for buttons in pastels ---------- */
.btn-pill { border-radius: 999px !important; padding: 10px 22px; }

/* ---------- Dashboard refresh ---------- */
.panel { border-radius: 18px; }
.card { border-radius: 16px; }
.stat-card { border-radius: 18px; }

/* ---------- HEADER OVERRIDE ---------- */
.navbar { background: #fff !important; backdrop-filter: none; }

/* ---------- WELCOME ROW (dashboard heros) ALIGNMENT ---------- */
.welcome-row {
  align-items: stretch !important;
  position: relative;
  overflow: hidden;
}
.welcome-row > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.welcome-row > div:last-child {
  align-items: flex-end;
  justify-content: center;
}
.welcome-row h1 { margin-top: 0; margin-bottom: 8px; line-height: 1.15; }
.welcome-row > div:first-child > .eyebrow { align-self: flex-start; }

/* Floating shape decoration on dashboard heros */
.welcome-row::after {
  content: "";
  position: absolute;
  top: -100px; right: -100px;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
  z-index: 0;
}
.welcome-row > * { position: relative; z-index: 1; }

/* ---------- BUTTON CONSISTENCY ---------- */
.btn.btn-lg { height: 46px; padding-top: 0; padding-bottom: 0; }
.btn { height: 40px; padding-top: 0; padding-bottom: 0; line-height: 1; }
.btn.btn-sm { height: 34px; }
.btn.btn-icon { width: 40px; padding: 0; }

/* ---------- ALIGNMENT FIXES FOR ICON CIRCLE ---------- */
.icon-circle { flex-shrink: 0; }

/* ---------- TIGHTER CARD SPACING ---------- */
.x-card .b { padding: 18px 20px 20px; gap: 0; }
.x-card h4 { margin: 0 0 10px; }
.x-card .badge-line { margin-top: 4px; }

/* ---------- CONSISTENT SPACING IN GRIDS ---------- */
.x-courses { gap: 22px; }

/* ---------- FORM ALIGNMENT FIX ---------- */
.form-row { align-items: start; }
.form-group { margin-bottom: 18px; }

/* ---------- ANIMATED ACCENT UNDERLINE FOR LINKS ---------- */
.psec-head .link i { transition: transform 0.2s ease; }
.psec-head .link:hover i { transform: translateX(4px); }

/* ---------- CHIP / BADGE REFINEMENT ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
.eyebrow i { font-size: 11px; }

/* ---------- IMPROVED FLOATING DECORATION ON CARDS ---------- */
.m-card {
  position: relative;
}

/* ---------- STAT CARDS RENDER ROW ALIGNMENT ---------- */
.stat-card {
  align-items: center;
  min-height: 92px;
}
.stat-card > div:last-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

/* ---------- DIVIDER REFRESH ---------- */
.section-divider {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 32px 0;
}
.section-divider::before, .section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}
.section-divider span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
}

/* ---------- FOOTER ALIGNMENT FIX ---------- */
.footer .footer-grid { align-items: start; }

/* ---------- HEADER NAVBAR ALIGNMENT ---------- */
.nav-inner > * { flex-shrink: 0; }
.nav-inner .nav-search { flex-shrink: 1; }
.nav-links { gap: 22px; }
.nav-actions .btn { white-space: nowrap; }
