/* ================================================================
   MoneyMythri — Theme CSS
   Generated by WebMantra | Preset: dark-pro
   All values from CSS variables — change theme from admin panel.
   ================================================================ */

:root {
  /* Color Palette */
  --color-primary:        #6c63ff;
  --color-secondary:      #f6ad55;
  --color-accent:         #48bb78;

  /*
    Brand-coloured TEXT - headings, prices, the active filter link. Deliberately separate from
    --color-primary, which is also the BACKGROUND of the header, the footer, .btn-primary and
    .bg-primary, all of which put white text on top. One variable cannot be both readable as text
    on a dark page and usable as a bar behind white text, so in dark mode only this one lightens.
    var() resolves at use time, so this still follows --color-primary when the admin changes it.
  */
  --color-heading:        var(--color-primary);

  /*
    The same split for --color-secondary, which is likewise both a background (the homepage hero
    gradient, the active dropdown item, .btn-secondary - all with white text on them) and link text.
    Only the text half lightens in dark mode.
  */
  --color-link:           var(--color-secondary);

  /*
    A faintly tinted panel sitting ON a surface - the locked-fields note, the copyable link box, a
    timeline comment. These were literal #F7F9FB, which is fine until dark mode: the background
    stayed white while the text followed --color-text-primary and turned near-white, so the panel
    read as blank. Not the same as --color-surface, which these are meant to sit slightly apart
    from. Defined here rather than in dynamic-theme.css because it is not an admin-editable colour.
  */
  --color-subtle:         #F7F9FB;
  --color-bg:             #0d0d1a;
  --color-surface:        #13131f;
  --color-text-primary:   #f0f0ff;
  --color-text-secondary: #c4cade;

  /* Typography */
  --font-heading:   'Poppins', system-ui, sans-serif;
  --font-body:      'Open Sans', system-ui, sans-serif;
  --font-size-base: 16px;

  /* Layout */
  --layout-width:   1200px;
  --border-radius:  8px;

  /* Card */
  --card-shadow: 0 2px 8px rgba(0,0,0,.08);
  --card-border: none;
}

/* ── Reset & Base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-primary);
  line-height: 1.25;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-secondary); }

/* ── Keyboard focus ────────────────────────────────────────────────
   :focus-visible only shows the ring for keyboard/assistive-tech navigation,
   not on mouse clicks, so it never adds visual noise to normal browsing. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ── Layout Container ──────────────────────────────────────────── */
.container { max-width: var(--layout-width); margin: 0 auto; padding: 0 1rem; }

/* ── Content + sidebar placement (wizard sidebarPosition = left) ──
   Pages put main content first, sidebar second in the markup. When the wizard
   chooses a left sidebar we reverse the flex row on large screens; mobile keeps
   content-first (sidebar stacks below). */
@media (min-width: 992px) {
  .content-with-sidebar { flex-direction: row-reverse; }
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  border: none;
  padding: .6rem 1.4rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-family: var(--font-body);
  transition: opacity .2s;
}
.btn-primary:hover { opacity: .85; }

.btn-secondary {
  background-color: var(--color-secondary);
  color: #ffffff;
  border: none;
  padding: .6rem 1.4rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: opacity .2s;
}
.btn-secondary:hover { opacity: .85; }

/* ── Cards ─────────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  border: var(--card-border);
  overflow: hidden;
}

.card-body { padding: 1.25rem; }
.card-title { font-family: var(--font-heading); font-weight: 600; margin-bottom: .5rem; }

/* ── Dark Mode ─────────────────────────────────────────────────── */
/* Public site only: the admin (every page has the sidebar's #sidebarOverlay) is built light — its fields, editor and
   white panels keep dark text — so a phone in dark mode turned its cards near-black with unreadable text. */
@media (prefers-color-scheme: dark) {
  :root:not(:has(#sidebarOverlay)) {
    --color-bg:             #0f0f0f;
    --color-surface:        #1a1a1a;
    --color-text-primary:   #f0f0f0;
    --color-text-secondary: #a0a0a0;
  }
}
/*
  :root[data-theme="dark"], NOT a bare [data-theme="dark"].

  dynamic-theme.css is written from the admin theme settings and is linked AFTER this file on every
  page, declaring the light palette on :root. A bare [data-theme="dark"] has the SAME specificity as
  :root - both (0,1,0) - and a tie is broken by source order, so the later file won every time. The
  dark-mode button set the attribute correctly and not one colour changed.

  Adding :root makes this (0,2,0), which beats :root regardless of load order. Do not "simplify" it
  back: the bug is invisible in this file alone and only appears once both stylesheets are on a page.
*/
:root[data-theme="dark"] {
  --color-bg:             #0f0f0f;
  --color-surface:        #1a1a1a;
  --color-text-primary:   #f0f0f0;
  --color-text-secondary: #a0a0a0;
  /*
    --color-border was missing here while dynamic-theme.css sets it to #E3E7EC. Every card, panel
    and row on the services pages draws its outline with var(--color-border), so without this the
    dark page kept light-grey borders on a near-black background.
  */
  --color-border:         #2e2e2e;
  /*
    #0F2A44 navy on a #0f0f0f page is effectively invisible, which is what the owner saw: headings
    "turned blue" and could not be read. #8ab4e8 is the tint the blog templates already use for
    dark accents, so the two halves of the site agree.
  */
  --color-heading:        #8ab4e8;
  /* #1C3E5E links were as unreadable on #0f0f0f as the navy headings were. */
  --color-link:           #9cc4ea;
  /* Between --color-bg (#0f0f0f) and --color-surface (#1a1a1a), so the panel still reads as a
     panel without becoming a bright patch on a dark page. */
  --color-subtle:         #171717;
}

/*
  Links are brand-coloured site-wide (see the `a` rule above), so they had exactly the same problem
  as the headings. Specificity (0,2,1) beats that bare `a` (0,0,1); it cannot beat an inline
  style attribute, which is why the templates switch to var(--color-heading) rather than relying on
  a rule here.
*/
:root[data-theme="dark"] a       { color: var(--color-link); }
/*
  Needed explicitly: the rule above is (0,2,1) and would otherwise beat the plain `a:hover` (0,1,1),
  leaving a link with no hover feedback at all in dark mode.
*/
:root[data-theme="dark"] a:hover { color: var(--color-heading); }

/* ── Motion ────────────────────────────────────────────────────────
   Lives here because theme.css is linked by every public template, so the whole site is covered
   without editing sixty <head> blocks.

   HOW THE HIDING WORKS, AND WHY IT IS BY SELECTOR
   Everything below is scoped to .motion, a class the header fragment's script adds to <html>
   SYNCHRONOUSLY, near the top of <body>. Content further down the page is therefore already
   hidden by the time it parses. Tagging elements from JavaScript after DOMContentLoaded would
   show them, hide them, then reveal them - a visible flash on every page load.

   IF THE SCRIPT NEVER RUNS, .motion is never added and every rule here is inert: the site
   renders exactly as it did before. That is deliberate. A stylesheet that hides content and
   waits for JavaScript to bring it back is how a page ends up permanently blank.
   ─────────────────────────────────────────────────────────────── */

:root {
  --wm-ease: cubic-bezier(.22, 1, .36, 1);
}

/*
  Page load. Pure CSS, never JavaScript - see the note above.

  SCOPED TO .motion, which it was not before. V9000038 promises that switching motion off returns
  the site to exactly how it looked beforehand, and an ungated animation on <body> broke that on
  every page whatever the setting said. It also made "turn the switch off and see" useless as a
  diagnostic, because the fade survived it.

  This is also the leading suspect for a whole-page flicker: `both` applies the from-state BEFORE
  the animation starts, so the body can paint at opacity 0 and then fade up, and an animation on
  an ancestor of the position:sticky header can force that header to repaint while it runs. If a
  blink survives this change, delete these two rules - nothing else depends on them.
*/
@keyframes wmPageIn { from { opacity: 0; } to { opacity: 1; } }
.motion body { animation: wmPageIn .45s var(--wm-ease) both; }

/* The reveal set. Listed by selector rather than a data attribute so the hiding happens at parse
   time. --wm-delay is written per element by the script to stagger each group. */
/*
  Large containers MOVE but do not SCALE. Scaling a full-width section means compositing a layer
  the size of the viewport and repainting its entire subtree every frame, which was a large part
  of why this felt sticky rather than smooth.
*/
.motion section.band,
.motion .cta-band,
.motion .panel {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--wm-ease), transform .7s var(--wm-ease);
  transition-delay: var(--wm-delay, 0ms);
}

/* Small items can afford the push-in: their layers are cheap. */
.motion .cat-card,
.motion .svc-row,
.motion .svc-line,
.motion .quote-card,
.motion .stat,
.motion .step,
.motion .card-soft,
.motion .post-card {
  opacity: 0;
  transform: translateY(30px) scale(.975);
  transition: opacity .75s var(--wm-ease), transform .75s var(--wm-ease);
  transition-delay: var(--wm-delay, 0ms);
}

/*
  NO will-change here, deliberately.

  It used to be set on the hidden state and released with `will-change: auto` on .wm-in - but
  .wm-in is the class that STARTS the transition, so the compositor layer was dropped at exactly
  the moment it was needed. Promoting and demoting a layer mid-transition re-rasterises the
  element, and on dozens of text-bearing cards that reads as a blink.

  Nothing is lost by removing it: opacity and transform are composited anyway. will-change earns
  its keep on .hero-art, which moves continuously under scroll, and stays only there.
*/
.motion .wm-in {
  opacity: 1 !important;
  transform: none !important;
}

/* Pictures push in behind their frame. Only where the frame already clips, or a scaled image
   would paint outside its box: transform does not affect layout, so an unclipped parent spills. */
.motion .svc-row,
.motion .svc-line { overflow: hidden; }
.motion .cat-card .ico img,
.motion .svc-row img,
.motion .svc-line img {
  transform: scale(1.12);
  transition: transform 1.1s var(--wm-ease);
  transition-delay: var(--wm-delay, 0ms);
}
.motion .wm-in .ico img,
.motion .wm-in img { transform: none; }

/* One-time sheen across section headings as they arrive. Confined to these two selectors on
   purpose - a ::after on every heading would collide with headings that already use one. */
.motion .sec-head h2,
.motion .svc-head h1 { position: relative; overflow: hidden; }
.motion .sec-head h2::after,
.motion .svc-head h1::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%,
              rgba(200, 160, 74, .55) 45%, rgba(255, 255, 255, .35) 55%, transparent 80%);
  transform: translateX(-120%);
  pointer-events: none;
}
.motion .wm-in.sec-head h2::after,
.motion .wm-in .sec-head h2::after,
.motion .wm-in.svc-head h1::after { animation: wmSheen 1.5s var(--wm-ease) .35s both; }
@keyframes wmSheen { to { transform: translateX(120%); } }

/* ── The call-back card ────────────────────────────────────────────
   The one form on the homepage, so it earns a nudge - but a nudge that STOPS.

   The ring pulses twice and ends. It is not a loop: something blinking beside the text a visitor
   is trying to read stops being an invitation and becomes an irritation, and on a tax practice
   site that reads as cheap rather than confident.

   It also cancels on :focus-within. Once someone has started typing the prompt has done its job,
   and a pulse behind a form being filled in is a distraction; the card lifts instead, so the
   feedback turns into a response to them rather than a demand on them.
   ─────────────────────────────────────────────────────────────── */
.wm-cta-card {
  position: relative;
  transition: transform .35s var(--wm-ease), box-shadow .35s var(--wm-ease);
}
.wm-cta-card::after {
  content: "";
  position: absolute; inset: -2px;
  border-radius: inherit;
  pointer-events: none;
}
.motion .wm-cta-card.wm-in::after { animation: wmCtaRing 2.4s var(--wm-ease) .7s 2 both; }
/*
  Both ENDS are transparent on purpose. This ran twice while starting at .45 opacity and finishing
  at 0, so the jump back to the start between the two iterations was an instant transparent-to-gold
  snap - a visible blink rather than a pulse. Fading up inside the keyframes instead means the
  restart happens between two identical transparent frames and cannot be seen.
*/
@keyframes wmCtaRing {
  0%   { box-shadow: 0 0 0 0    rgba(200, 160, 74, 0); }
  18%  { box-shadow: 0 0 0 0    rgba(200, 160, 74, .45); }
  70%  { box-shadow: 0 0 0 16px rgba(200, 160, 74, 0); }
  100% { box-shadow: 0 0 0 0    rgba(200, 160, 74, 0); }
}
.wm-cta-card:focus-within::after { animation: none !important; }
.wm-cta-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 42, 68, .20);
}

/* One shine across the submit button, after the ring has finished. Scoped INSIDE the card so the
   hero's other .btn-gold link - "Explore services" - is left alone. */
.motion .wm-cta-card.wm-in .btn-gold { position: relative; overflow: hidden; }
.motion .wm-cta-card.wm-in .btn-gold::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 28%,
              rgba(255, 255, 255, .5) 50%, transparent 72%);
  transform: translateX(-120%);
  animation: wmSheen 1.3s var(--wm-ease) 1.4s 1 both;
}

/* Hover. Not gated on .motion - this is ordinary polish rather than an effect, so it applies
   even with the switch off. Still suppressed by prefers-reduced-motion below. */
.cat-card, .svc-row, .svc-line, .card-soft, .post-card {
  transition: transform .35s var(--wm-ease), box-shadow .35s var(--wm-ease);
}
.cat-card:hover, .svc-row:hover, .card-soft:hover, .post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(15, 42, 68, .13);
}

/*
  The hero artwork drifts as the page scrolls. The script now writes a transform straight onto
  .hero-art (defined in home-tax.html) - no transition here, because requestAnimationFrame already
  updates it every frame and a transition would fight it.

  This replaced `background-position: right calc(center + var(--wm-parallax))`, which was never
  valid CSS: `center` is a keyword, not a length, so calc() rejected it and the parser dropped the
  whole declaration. The hero therefore never moved - while the per-frame custom-property write
  still forced a style recalculation of the hero and everything inside it on every scroll event.
  No effect, all of the cost.
*/

/*
  Someone who has asked their system to reduce motion has usually done so because movement makes
  them unwell. Everything above is switched off here, and anything mid-reveal is forced visible so
  no content can be left hidden.
*/
@media (prefers-reduced-motion: reduce) {
  /* .motion body, not bare body: the fade is now scoped to .motion at (0,1,1), and a media query
     adds no specificity, so a bare `body` rule here at (0,0,1) would lose and silently do nothing.
     Moot while the script also refuses to add .motion under reduced-motion - but an accessibility
     guard should not depend on a second mechanism happening to hold. */
  .motion body { animation: none; }
  .motion section.band, .motion .cat-card, .motion .svc-row, .motion .svc-line,
  .motion .panel, .motion .quote-card, .motion .stat, .motion .step,
  .motion .cta-band, .motion .card-soft, .motion .post-card {
    opacity: 1; transform: none; transition: none;
  }
  .motion .cat-card .ico img, .motion .svc-row img, .motion .svc-line img {
    transform: none; transition: none;
  }
  .motion .sec-head h2::after, .motion .svc-head h1::after { display: none; }
  .motion .wm-cta-card.wm-in::after,
  .motion .wm-cta-card.wm-in .btn-gold::after { animation: none; display: none; }
  .wm-cta-card, .wm-cta-card:focus-within { transform: none; transition: none; box-shadow: none; }
  .cat-card, .svc-row, .svc-line, .card-soft, .post-card { transition: none; }
  .cat-card:hover, .svc-row:hover, .card-soft:hover, .post-card:hover { transform: none; }
  .hero-art { transform: none !important; }
}

/* ── Utility ───────────────────────────────────────────────────── */
.text-primary   { color: var(--color-primary)   !important; }
.text-secondary { color: var(--color-secondary) !important; }
.text-accent    { color: var(--color-accent)    !important; }
.bg-primary     { background-color: var(--color-primary)   !important; }
.bg-surface     { background-color: var(--color-surface)   !important; }

/* ── Admin tables (consistent across the whole admin panel) ──────────
   • headers CENTERED; text cells LEFT-aligned
   • cells holding only a checkbox / button / badge stay CENTERED
   • a thin vertical separator between every column
   • percentage-friendly widths with wrap so the layout never "breaks";
     min-width lets very wide tables scroll sideways on small screens
   Scoped to .main-content so only admin pages are affected.        */
.main-content table.table{
  width:100%;
  min-width:560px;            /* below this the .table-responsive/card scrolls */
  margin-bottom:1rem;
  background:#fff;
  border-collapse:separate;
  border-spacing:0;
}
.main-content table.table thead th{
  text-align:center !important;
  vertical-align:middle;
  font-family:var(--font-heading);
  font-weight:600;
  font-size:.78rem;
  letter-spacing:.02em;
  text-transform:uppercase;
  color:#5b6472;
  background:#f6f8fb;
  padding:.65rem .6rem;
  border-bottom:2px solid #e4e8ef;
}
.main-content table.table tbody td{
  text-align:left !important;
  vertical-align:middle;
  font-size:.875rem;
  color:#2b3340;
  padding:.6rem .7rem;
  border-top:1px solid #eef1f5;
  overflow-wrap:anywhere;     /* long words/URLs wrap instead of overflowing */
}
/* cells that hold only a control, badge or buttons stay centered (not "text") */
.main-content table.table td:has(> .form-check-input),
.main-content table.table td:has(> .btn),
.main-content table.table td:has(> form),
.main-content table.table td:has(> .badge),
.main-content table.table td:has(> .status-badge),
.main-content table.table td:has(> .d-flex){
  text-align:center !important;
}
/* vertical separator line between columns */
.main-content table.table th:not(:last-child),
.main-content table.table td:not(:last-child){
  border-right:1px solid #eef1f5;
}
/* subtle zebra striping + clear row hover */
.main-content table.table tbody tr:nth-child(even) > td{ background:#fbfcfe; }
.main-content table.table tbody tr:hover > td{ background:#eef4fc; }
/* keep action buttons, badges and small forms on one line */
.main-content table.table td .btn,
.main-content table.table td .badge,
.main-content table.table td .status-badge,
.main-content table.table td form{ white-space:nowrap; }
/* a table placed directly inside a card (no .table-responsive wrapper) scrolls too */
.main-content .card:has(> table.table){ overflow-x:auto; }
