/* ============================================================
   Cosmic Link — Design System
   Palette: night-sky indigo, palm-leaf parchment, marigold gold,
   sindoor maroon. Layout signature: the North-Indian kundli
   diamond grid, used sparingly as a structural/background motif.
   ============================================================ */

:root {
  /* Color tokens */
  --indigo-950: #0d1330;
  --indigo-900: #1b2a4a;
  --indigo-800: #263a63;
  --indigo-700: #34507f;
  --nebula-purple: #4a2e7a;
  --nebula-pink: #b3447c;
  --cosmic-teal: #1f8a8c;
  --parchment-100: #f7f3e9;
  --parchment-200: #efe8d6;
  --parchment-300: #e3d8bd;
  --gold-500: #d4a853;
  --gold-400: #e7b46b;
  --gold-600: #c8862d;
  --gold-700: #a96c1f;
  --gold-200: #f5d5c8;
  --maroon-700: #7a2e2e;
  --ink-900: #221c14;
  --ink-600: #534a3c;
  --ink-400: #8b7d6b;
  --silver-400: #e2e8f0;
  --line: rgba(34, 28, 20, 0.12);
  --surface-color: var(--parchment-100);

  /* Decorative-only accent tokens (non-interactive labels, dividers, bullets,
     icon tint, glow). Gold is reserved for buttons/links/active state —
     these are the muted secondary accent used everywhere else. */
  --decor-text-light: var(--maroon-700);       /* decorative text on cream/parchment backgrounds */
  --decor-text-dark: rgba(247, 243, 233, 0.65); /* decorative text on navy/indigo backgrounds */
  --decor-shape-light: rgba(122, 46, 46, 0.38); /* decorative shapes/fills on cream/parchment backgrounds */
  --decor-shape-dark: rgba(247, 243, 233, 0.38); /* decorative shapes/fills on navy/indigo backgrounds */

  /* Theme-aware surface tokens. The site's dark bands (header, footer, hero,
     .section-dark, dropdown panels, badges) stay the fixed indigo/gold raw
     colors above in both themes — only the "light content" surfaces below
     need a dark-mode alternative, so they get their own tokens instead of
     redefining --parchment-100 / --indigo-900 directly (those are also used
     as fixed light-on-dark text/backgrounds and must not flip). */
  --surface-color: var(--parchment-100);     /* page background, cards, inputs */
  --surface-alt-color: var(--parchment-200); /* secondary surface (alt sections, tile glyphs, meters) */
  --heading-color: var(--indigo-900);        /* headings/titles on a light surface */

  /* Type */
  --font-display: 'Lora', 'Georgia', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --radius: 3px;
}

/* ---------------- Dark theme ----------------
   Only the light-content system flips: surface/heading tokens plus the
   ink/line/decor tokens that are exclusively used on those surfaces. The
   raw indigo/parchment/gold palette and every "dark band" rule built
   directly on it (header, footer, hero, section-dark, badges, dropdowns)
   is intentionally left untouched — those already read as dark in both
   themes, so nothing about them needs to change. */
:root[data-theme="dark"] {
  --surface-color: #171c27;
  --surface-alt-color: #1f2532;
  --heading-color: #f2ede1;
  --ink-900: #ece6d8;
  --ink-600: #b3aa99;
  --line: rgba(247, 243, 233, 0.14);
  --decor-text-light: #d99a72;
  --decor-shape-light: rgba(200, 134, 45, 0.32);
  --ink-400: #c4b8a8;
}
:root[data-theme="dark"] body { color-scheme: dark; }
:root[data-theme="dark"] .alert-success { background: rgba(31,92,51,0.18); color: #8fd6a0; border-color: rgba(95,214,122,0.35); }
:root[data-theme="dark"] .alert-error { background: rgba(122,46,46,0.22); color: #e6a3a3; border-color: rgba(224,110,110,0.4); }
:root[data-theme="dark"] .forum-meta-sep { color: rgba(247, 243, 233, 0.25); }

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Gently ties the whole rem-based scale to the viewport so the site keeps
     consistent proportions across laptops, monitors and phones instead of
     looking noticeably different from one device (or OS scaling) to the next. */
    font-size: clamp(13px, 12.5px + 0.18vw, 15px);
    
  /* Stop mobile browsers from auto-inflating text — a common source of
     Chrome vs Safari vs Firefox inconsistency on phones. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--surface-color);
  color: var(--ink-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* Forms, chat and the forum composer stay fully selectable/copyable —
   only the site's own content is protected, never what the user types. */
input, textarea, select, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

img { max-width: 100%; display: block; -webkit-user-drag: none; user-drag: none; }
svg { -webkit-user-drag: none; user-drag: none; }

/* ---------------- Responsive foundation ----------------
   Cross-browser, cross-device safety net so the layout renders the same
   way everywhere and never spills outside the viewport. */

/* Media and embeds always fit their container, whatever the screen. */
svg, video, canvas, iframe, table { max-width: 100%; }

/* Kill accidental horizontal scrolling on any device. `clip` is used
   instead of `hidden` because it does NOT break the sticky header. */
html, body { overflow-x: clip; }

/* Flex/grid children can shrink below their content width instead of
   forcing the page wider (fixes long words / wide charts overflowing). */
.container, .main-content { min-width: 0; }

/* Wrap any fixed-width block (wide tables, timelines) in this to give it
   its own horizontal scroll rather than stretching the whole page. */
.scroll-x { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.18;
  margin: 0 0 0.5em;
  color: var(--heading-color);
}

h1 { font-size: clamp(1.55rem, 2.9vw, 2.2rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; color: var(--ink-600); }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 420px) {
  .container { padding: 0 16px; }
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--decor-text-light);
  font-weight: 600;
  margin-bottom: 0.6em;
  display: inline-block;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: var(--gold-600);
  color: var(--indigo-950);
}
.btn-primary:hover { background: var(--gold-700); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border-color: rgba(247, 243, 233, 0.5);
  color: var(--parchment-100);
}
.btn-outline:hover { background: rgba(247, 243, 233, 0.1); }
/* Outline button for use on light/parchment backgrounds (dark text, visible border) */
.btn-outline-ink {
  background: var(--surface-color);
  border-color: var(--line);
  color: var(--heading-color);
}
.btn-outline-ink:hover { background: var(--surface-alt-color); }
.btn-dark {
  background: var(--indigo-900);
  color: var(--parchment-100);
}
.btn-dark:hover { background: var(--indigo-800); }
.btn-gold-outline {
  background: var(--indigo-950);
  color: var(--gold-600);
  border-color: var(--gold-600);
}
.btn-gold-outline:hover { background: var(--indigo-900); color: var(--gold-700); }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ---------------- Site header ---------------- */
.site-header-wrap {
  position: relative;
  z-index: 100;
}
.site-header {
  background: var(--indigo-950);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(247, 243, 233, 0.08);
  overflow: visible;
}
.site-header .container {
  display: grid;
  grid-template-columns: minmax(200px, 1.15fr) auto minmax(180px, 0.95fr);
  align-items: center;
  column-gap: 40px;
  min-height: 76px;
  max-width: 1440px;
  padding: 12px 36px;
  overflow: visible;
}
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--parchment-100);
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  min-width: 0;
  justify-self: start;
}
.brand .glyph {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2.5px solid rgba(247, 243, 233, 0.55);
  box-shadow: 0 0 14px 3px rgba(247, 243, 233, 0.35), 0 0 30px 6px rgba(247, 243, 233, 0.18);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  animation: brand-halo-pulse 3.6s ease-in-out infinite;
}
@keyframes brand-halo-pulse {
  0%, 100% { box-shadow: 0 0 14px 3px rgba(247, 243, 233, 0.32), 0 0 26px 5px rgba(247, 243, 233, 0.16); }
  50% { box-shadow: 0 0 20px 5px rgba(247, 243, 233, 0.45), 0 0 40px 9px rgba(247, 243, 233, 0.26); }
}
.brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.15;
  min-width: 0;
}
.brand-text > span:first-child {
  background: linear-gradient(90deg, var(--parchment-100) 0%, rgba(247, 243, 233, 0.55) 50%, var(--parchment-100) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(247, 243, 233, 0.25);
}
.brand-tagline {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--decor-text-dark);
  max-width: 240px;
  text-align: left;
  white-space: normal;
  line-height: 1.35;
}
.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  overflow: visible;
  flex-shrink: 0;
  padding: 0 8px;
}
.nav-links a {
  color: rgba(247, 243, 233, 0.92);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s ease;
  white-space: nowrap;
  padding: 6px 2px;
}
.nav-links a:hover { color: var(--parchment-100); }

/* Nav hover dropdowns (Services, Free Astro Tools) */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-trigger {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(247, 243, 233, 0.92);
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.18s ease;
}
.nav-dropdown-trigger:hover,
.nav-dropdown-trigger.is-active {
  color: var(--gold-600);
  font-weight: 600;
}
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 260px;
  padding: 8px;
  background: var(--indigo-900);
  border: 1px solid rgba(247, 243, 233, 0.14);
  border-radius: 14px;
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(200, 134, 45, 0.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  z-index: 200;
}
.nav-dropdown-panel::before {
  content: '';
  position: absolute;
  top: -12px;
  left: -24px;
  right: -24px;
  height: 14px;
}
.nav-dropdown-panel--wide {
  min-width: 420px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.nav-dropdown-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  color: rgba(247, 243, 233, 0.88);
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.nav-dropdown-link:hover {
  background: rgba(247, 243, 233, 0.1);
  color: var(--parchment-100);
  transform: translateX(3px);
}
.nav-dropdown-glyph {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  background: radial-gradient(circle at 32% 28%, var(--gold-700), var(--gold-600) 70%);
  color: var(--indigo-950);
  box-shadow: 0 0 0 1px rgba(247, 243, 233, 0.12), 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: box-shadow 0.16s ease, transform 0.16s ease;
}
.nav-dropdown-link:hover .nav-dropdown-glyph {
  box-shadow: 0 0 10px 2px rgba(200, 134, 45, 0.55), 0 0 0 1px rgba(247, 243, 233, 0.18);
  transform: scale(1.06);
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  justify-self: end;
  flex-shrink: 0;
}
.nav-toggle { display: none; }

@media (max-width: 1280px) {
  .site-header .container {
    column-gap: 28px;
    padding-left: 28px;
    padding-right: 28px;
  }
  .nav-links { gap: 22px; }
  .brand-tagline { max-width: 180px; }
}

@media (max-width: 1100px) {
  .brand-tagline { display: none; }
  .site-header .container {
    column-gap: 24px;
  }
  .nav-links { gap: 18px; }
}

@media (max-width: 860px) {
  .site-header .container {
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
  }
  .nav-links { display: none; }
  .nav-actions { display: none; }
  .nav-toggle {
    display: inline-flex;
    background: none; border: none; color: var(--parchment-100);
    font-size: 1.6rem; cursor: pointer;
    align-items: center; justify-content: center;
    padding: 4px 8px; line-height: 1;
  }
}

/* Below ~480px the tagline sentence next to the logo has no room and
   pushes the header taller than its sticky min-height. */
@media (max-width: 480px) {
  .brand-tagline { display: none; }
  .brand .glyph { width: 44px; height: 44px; }
  .site-header .container { min-height: 64px; }
}

/* ---------------- Hero with kundli-grid motif ---------------- */
.hero {
  position: relative;
  background: var(--indigo-950);
  color: var(--parchment-100);
  overflow: hidden;
  padding: clamp(40px, 4vw, 68px) 0 clamp(48px, 4.5vw, 76px);
}
.hero-grid-art {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
}
.hero .container {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
}
.hero-eyebrow {
  color: var(--decor-text-dark);
}
.hero h1 { color: var(--parchment-100); }
.hero h1 em {
  font-style: italic;
  color: var(--decor-text-dark);
}
.hero-sub {
  color: rgba(247, 243, 233, 0.92);
  font-size: 1.08rem;
  max-width: 480px;
}
.hero-ctas { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-meta {
  display: flex; gap: 28px; margin-top: 44px; flex-wrap: wrap;
}
.hero-meta div { font-size: 0.85rem; color: rgba(247, 243, 233, 0.78); }
.hero-meta strong {
  display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--parchment-100);
}

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; gap: 28px; }
  .hero-grid-art { display: none; }
  .hero { padding: 40px 0 48px; text-align: left; }
  .hero-meta { margin-top: 28px; gap: 22px; }
}

/* ---------------- Section helpers ---------------- */
.section { padding: clamp(28px, 3.5vw, 40px) 0; }
.section-tight { padding: clamp(16px, 2vw, 24px) 0; }
.section-alt { background: var(--surface-alt-color); }
.section-dark { background: var(--indigo-900); color: var(--parchment-100); }
.section-dark h2, .section-dark h3 { color: var(--parchment-100); }
.section-dark p { color: rgba(247, 243, 233, 0.9); }
/* The closing CTA section sitting directly above the footer (on every page
   that has one, some nested inside a wrapper div so it isn't always the
   footer's literal DOM sibling) should match the footer's darker tone
   instead of showing a visible seam between indigo-900 and indigo-950. */
.section-dark.section-tight:last-of-type { background: var(--indigo-950); }
.section-head { max-width: 640px; margin-bottom: clamp(28px, 3.4vw, 40px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------------- Systems grid (cards) ---------------- */
.systems-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 860px) { .systems-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .systems-grid { grid-template-columns: 1fr; } }

.system-card {
  background: var(--surface-color);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.system-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -18px rgba(27, 42, 74, 0.35);
  border-color: var(--gold-600);
}
.system-card .tag {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--maroon-700);
  font-weight: 600;
}
.system-card h3 { margin-top: 10px; margin-bottom: 8px; }
.system-card p { font-size: 0.92rem; margin-bottom: 0; }

/* ---------------- Two-forum split ---------------- */
.forum-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
@media (max-width: 760px) { .forum-split { grid-template-columns: 1fr; } }

.forum-panel {
  border-radius: var(--radius);
  padding: 36px 32px;
  border: 1px solid var(--line);
}
.forum-panel.private {
  background: var(--indigo-900);
  color: var(--parchment-100);
}
.forum-panel.private h3, .forum-panel.private .panel-eyebrow { color: var(--parchment-100); }
.forum-panel.private p { color: rgba(247, 243, 233, 0.9); }
.forum-panel.public {
  background: var(--surface-color);
}
.panel-eyebrow {
  font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--decor-text-light); font-weight: 700; display: block; margin-bottom: 10px;
}
.forum-panel ul { padding-left: 0; list-style: none; margin: 18px 0 26px; }
.forum-panel li {
  padding-left: 22px;
  position: relative;
  margin-bottom: 10px;
  font-size: 0.93rem;
}
.forum-panel.private li { color: rgba(247, 243, 233, 0.94); }
.forum-panel.public li { color: var(--ink-600); }
.forum-panel li::before {
  content: '';
  position: absolute; left: 0; top: 7px;
  width: 8px; height: 8px;
  background: var(--decor-shape-light);
  transform: rotate(45deg);
}
.forum-panel.private li::before { background: var(--decor-shape-dark); }

/* ---------------- Steps (numbered process — used because
   booking really is a sequence) ---------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}
@media (max-width: 860px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 8px; }
.step::before {
  counter-increment: step;
  content: counter(step);
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--decor-text-light);
  display: block;
  margin-bottom: 10px;
}
.step h4 { margin: 0 0 6px; font-size: 1.02rem; color: var(--heading-color); font-family: var(--font-body); font-weight: 700; }
.step p { font-size: 0.88rem; margin: 0; }
/* Variant for steps that render their own numbered badge (e.g. a circle)
   instead of the default ::before counter number. */
.step--badge::before { content: none; }

/* ---------------- Cards / generic ---------------- */
.card {
  background: var(--surface-color);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

/* A .card that represents one row in a list (booking, order, etc.) — gets a
   hover highlight since it holds an actionable item, unlike a plain content card. */
.card-row {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(27, 42, 74, 0.35);
  border-color: var(--gold-600);
}

/* ---------------- Forms ---------------- */
.form-grid { display: grid; gap: 18px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 600px) { .form-row-2 { grid-template-columns: 1fr; } }

/* Generic 2-column content layout (side-by-side panels, comparisons, etc.) */
.grid-2-col { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .grid-2-col { grid-template-columns: 1fr; } }

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--heading-color);
}
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--surface-color);
  color: var(--ink-900);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--gold-600);
  outline-offset: 1px;
  border-color: var(--gold-600);
}
textarea { resize: vertical; min-height: 110px; }
.field-hint { font-size: 0.78rem; color: var(--ink-600); margin-top: 4px; }

/* Native selects on dark backgrounds — closed field stays light-on-dark;
   dropdown options use dark-on-light so Windows/Chrome popups stay readable. */
.select-on-dark {
  width: 100%;
  padding: 11px 36px 11px 14px;
  border-radius: 8px;
  border: 1px solid rgba(200, 134, 45, 0.35);
  background: rgba(247, 243, 233, 0.06);
  color: var(--parchment-100);
  font-family: var(--font-body);
  font-size: 0.92rem;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.select-on-dark:focus {
  outline: 2px solid var(--gold-600);
  outline-offset: 1px;
  border-color: var(--gold-600);
}
.select-on-dark option {
  background-color: var(--parchment-100);
  color: var(--ink-900);
}

.alert {
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.alert-success { background: #e6f2e8; color: #1f5c33; border: 1px solid #bfe0c6; }
.alert-error { background: #fbeaea; color: var(--maroon-700); border: 1px solid #f1c9c9; }

.pending-approval-notice {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: rgba(13, 19, 48, 0.55);
  border: 1px solid rgba(200, 134, 45, 0.4);
  color: var(--parchment-100);
  font-size: 0.9rem;
  line-height: 1.55;
}
.pending-approval-notice strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold-600);
  font-size: 0.95rem;
}
.pending-approval-notice p {
  margin: 0;
  color: rgba(247, 243, 233, 0.82);
  font-size: 0.88rem;
}

/* ---------------- Generic data table ---------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th {
  font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-600); font-weight: 700;
}
td { color: var(--ink-600); font-size: 0.9rem; }

/* ---------------- Forum listing ---------------- */
.forum-category-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-color);
  margin-bottom: 14px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.forum-category-row:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(27, 42, 74, 0.35);
  border-color: var(--gold-600);
}
.forum-category-row.locked {
  opacity: 0.6;
  cursor: not-allowed;
}
.forum-category-row.locked:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--line);
}
.forum-category-row .meta { font-size: 0.82rem; color: var(--ink-600); }
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--gold-600);
  color: var(--indigo-950);
}
.badge-private { background: var(--maroon-700); color: var(--parchment-100); }

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: capitalize;
  padding: 5px 12px;
  border-radius: 99px;
}
.badge-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge-status-pending   { background: rgba(200, 134, 45, 0.12); color: var(--gold-700); }
.badge-status-confirmed { background: rgba(52, 80, 127, 0.12); color: var(--indigo-700); }
.badge-status-completed { background: rgba(31, 92, 51, 0.12); color: #1f5c33; }
.badge-status-cancelled { background: rgba(122, 46, 46, 0.12); color: var(--maroon-700); }

.topic-row {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 16px 12px;
  margin: 0 -12px;
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius);
  transition: background 0.15s ease;
}
.topic-row:hover { background: rgba(200, 134, 45, 0.06); }
.topic-row .title { font-weight: 600; color: var(--heading-color); transition: color 0.15s ease; }
.topic-row:hover .title { color: var(--gold-700); }
.topic-row .by { font-size: 0.8rem; color: var(--ink-600); margin-top: 4px; }

.reply-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 14px;
  background: var(--surface-color);
}
.reply-block .author { font-weight: 700; font-size: 0.85rem; color: var(--heading-color); }
.reply-block .when { font-size: 0.75rem; color: var(--ink-600); margin-left: 8px; }

/* ---------------- Forum thread (topic detail) ---------------- */
.forum-thread {
  max-width: 780px;
}

.forum-breadcrumb {
  font-size: 0.8125rem;
  color: var(--ink-600);
  margin: 0 0 1.25rem;
}

.forum-breadcrumb a {
  color: var(--ink-600);
  text-decoration: none;
}

.forum-breadcrumb a:hover {
  color: var(--indigo-700);
}

.forum-post-header {
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.forum-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.forum-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 4px;
  background: rgba(200, 134, 45, 0.09);
  color: var(--gold-700);
  border: 1px solid rgba(200, 134, 45, 0.22);
}

.forum-post-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 12px;
  color: var(--heading-color);
  letter-spacing: -0.01em;
}

.forum-post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.8125rem;
  color: var(--ink-600);
}

.forum-post-meta strong {
  color: var(--heading-color);
  font-weight: 600;
}

.forum-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 700;
}

.forum-avatar--pro {
  background: var(--indigo-950);
  color: var(--gold-600);
}

.forum-avatar--member {
  background: rgba(107, 95, 212, 0.14);
  color: var(--indigo-700);
}

.forum-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--indigo-950);
  color: var(--parchment-100);
}

.forum-role-badge--verified {
  background: rgba(107, 95, 212, 0.1);
  color: var(--indigo-700);
  border: 1px solid rgba(107, 95, 212, 0.2);
}

.forum-post-body {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ink-900);
  margin-top: 14px;
}

.forum-answers-heading {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 1.25rem 0 0;
  color: var(--heading-color);
}

.forum-answers-heading span {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--ink-600);
  margin-left: 8px;
}

.forum-answer {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.forum-star-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 44px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-color);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.forum-star-btn:hover:not(:disabled) {
  border-color: var(--gold-600);
  background: rgba(200, 134, 45, 0.06);
  transform: translateY(-1px);
}

.forum-star-btn:active:not(:disabled) {
  transform: translateY(0);
}

.forum-star-btn:disabled {
  cursor: wait;
  opacity: 0.75;
}

.forum-star-btn--guest {
  opacity: 1;
  cursor: pointer;
}

.forum-star-btn--guest:hover {
  border-color: var(--indigo-700);
  background: rgba(107, 95, 212, 0.06);
}

.forum-star-btn--active {
  border-color: var(--gold-600);
  background: rgba(200, 134, 45, 0.1);
}

.forum-star-btn__icon {
  font-size: 1.25rem;
  line-height: 1;
  color: var(--ink-600);
  pointer-events: none;
}

.forum-star-btn:hover:not(:disabled) .forum-star-btn__icon,
.forum-star-btn--active .forum-star-btn__icon {
  color: var(--gold-600);
}

.forum-star-btn__count {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink-600);
  line-height: 1.2;
  pointer-events: none;
}

.forum-star-btn--active .forum-star-btn__count {
  color: var(--gold-700);
}

.forum-answer-content {
  min-width: 0;
}

.forum-answer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 0.8125rem;
  color: var(--ink-600);
}

.forum-answer-meta strong {
  color: var(--heading-color);
  font-weight: 600;
}

.forum-answer-text {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--ink-900);
}

.forum-answer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.forum-delete-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: #b43c3c;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 0;
}

.forum-reply-section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.forum-reply-section h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--heading-color);
}

.forum-reply-section textarea {
  font-size: 0.875rem;
}

.forum-login-prompt {
  background: var(--surface-color);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.forum-login-prompt p {
  margin-bottom: 14px;
  font-size: 0.875rem;
}

.forum-meta-sep {
  color: rgba(0, 0, 0, 0.25);
}

/* Forum list (community index) */
.forum-list {
  border-top: 1px solid var(--line);
}

.forum-list-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 6px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background 0.15s;
}

.forum-list-item:hover {
  background: var(--surface-color);
}

.forum-list-count {
  text-align: center;
  padding-top: 2px;
}

.forum-list-count__n {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink-600);
}

.forum-list-count__n--answered {
  color: var(--indigo-700);
}

.forum-list-count__label {
  font-size: 0.6875rem;
  color: var(--ink-600);
  margin-top: 2px;
}

.forum-list-title {
  margin: 0 0 4px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--heading-color);
  line-height: 1.4;
}

.forum-list-item:hover .forum-list-title {
  color: var(--heading-color);
}

.forum-list-excerpt {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  color: var(--ink-600);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.forum-list-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--ink-600);
}

.forum-list-footer .forum-tag {
  font-size: 0.6875rem;
  padding: 1px 7px;
}

.forum-list-author {
  margin-left: auto;
  font-size: 0.75rem;
}

.forum-list-author strong {
  color: var(--heading-color);
  font-weight: 600;
}

.forum-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.forum-toolbar input,
.forum-toolbar select {
  font-size: 0.8125rem;
  padding: 7px 11px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-color);
}

.forum-toolbar input {
  flex: 1;
  min-width: 180px;
}

.forum-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.forum-filter-tab {
  padding: 8px 12px;
  border: none;
  background: none;
  font-size: 0.8125rem;
  cursor: pointer;
  font-weight: 400;
  color: var(--ink-600);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.forum-filter-tab--active {
  font-weight: 600;
  color: var(--heading-color);
  border-bottom-color: var(--indigo-700);
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--indigo-950);
  color: rgba(247, 243, 233, 0.82);
  padding: 12px 0 20px;
  font-size: 0.88rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.footer-brand .glyph {
  width: 38px; height: 38px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(247, 243, 233, 0.5);
  box-shadow: 0 0 10px 2px rgba(247, 243, 233, 0.28);
}
.footer-brand .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--parchment-100);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 24px;
  align-items: start;
}
@media (max-width: 700px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.footer-grid h5 {
  color: var(--parchment-100);
  font-family: var(--font-body);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.footer-grid a { display: block; margin-bottom: 8px; color: rgba(247, 243, 233, 0.82); }
.footer-grid a:hover { color: var(--gold-600); }
.footer-bottom {
  border-top: 1px solid rgba(247, 243, 233, 0.1);
  padding-top: 22px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 0.8rem;
}

/* ---------------- Scroll-reveal animations ----------------
   Elements fade + slide in the first time they enter the viewport.
   `.reveal` animates itself; `.reveal-group` staggers its children.
   Auto-applied to section heads, grids, and content blocks via scrollReveal.js. */
html.reveal-disabled .reveal,
html.reveal-disabled .reveal-group > * {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: opacity, transform;
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }

  .reveal-fade {
    opacity: 0;
    transform: none;
    transition: opacity 0.5s ease;
  }
  .reveal-fade.is-visible {
    opacity: 1;
  }

  .reveal-group > * {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: opacity, transform;
  }
  .reveal-group.is-visible > * {
    opacity: 1;
    transform: none;
  }
  .reveal-group.is-visible > *:nth-child(1) { transition-delay: 0.00s; }
  .reveal-group.is-visible > *:nth-child(2) { transition-delay: 0.06s; }
  .reveal-group.is-visible > *:nth-child(3) { transition-delay: 0.12s; }
  .reveal-group.is-visible > *:nth-child(4) { transition-delay: 0.18s; }
  .reveal-group.is-visible > *:nth-child(5) { transition-delay: 0.24s; }
  .reveal-group.is-visible > *:nth-child(6) { transition-delay: 0.30s; }
  .reveal-group.is-visible > *:nth-child(7) { transition-delay: 0.36s; }
  .reveal-group.is-visible > *:nth-child(8) { transition-delay: 0.42s; }
}

/* ---------------- Utility ---------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.muted { color: var(--ink-600); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Visible keyboard focus throughout */
a:focus-visible, button:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--gold-600);
  outline-offset: 2px;
}
