/* =============================================================================
   SECURE ACCOUNTING & BUSINESS SOLUTIONS — MAIN STYLESHEET
   -----------------------------------------------------------------------------
   Structure of this file (search for these headings to jump around):
     1. Design tokens (CSS custom properties)
     2. Base / reset
     3. Accessibility helpers
     4. Top bar + navigation
     5. Buttons
     6. Ledger-rule divider (site-wide motif)
     7. Hero sections
     8. Cards / feature blocks
     9. Steps (numbered sequence — used only where content IS a sequence)
     10. FAQ accordion
     11. Contact form
     12. Footer
     13. Back-to-top button
     14. Utility / animation classes
     15. Responsive tweaks
   ========================================================================== */


/* -----------------------------------------------------------------------
   1. DESIGN TOKENS
   All colors and key sizes live here as CSS variables, so the whole site's
   look can be updated in one place in the future.
   ----------------------------------------------------------------------- */
:root {
  /* Core palette */
  --color-navy:        #0F2A44; /* primary brand colour: trust, security   */
  --color-navy-dark:   #0A1D30; /* darker navy for hovers / deep sections  */
  --color-emerald:     #1F4B3F; /* secondary: "ledger green", accounting  */
  --color-brass:       #A9793B; /* accent: used sparingly, premium detail  */
  --color-brass-light: #C99B57; /* lighter brass for hovers on dark bg     */
  --color-paper:       #F7F5F0; /* warm off-white page background          */
  --color-paper-deep:  #EFEBE1; /* slightly deeper paper for alt sections  */
  --color-ink:         #1B1F23; /* primary text colour                     */
  --color-ink-soft:    #4B5257; /* secondary / muted text colour           */
  --color-border:      #E4E0D6; /* hairline border colour (ledger lines)   */
  --color-white:       #FFFFFF;

  /* Typography */
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --container-max: 1200px;
  --radius-sm: 4px;   /* deliberately small/near-square radius: this is a
                          ledger/certificate feel, not a rounded SaaS-card kit */
  --transition-fast: 150ms ease;
  --transition-med:  280ms ease;
}


/* -----------------------------------------------------------------------
   2. BASE / RESET
   ----------------------------------------------------------------------- */
* {
  box-sizing: border-box; /* padding/border included in element width */
}

html {
  scroll-behavior: smooth; /* smooth in-page anchor jumps (e.g. FAQ links) */
}

body {
  font-family: var(--font-body);
  color: var(--color-ink);
  background-color: var(--color-paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased; /* crisper text rendering on WebKit */
}

/* Headline font applied to all headings by default */
h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  color: var(--color-navy);
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); } /* fluid sizing across devices */
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }

p { color: var(--color-ink-soft); }

/* Body copy line length kept under ~80 characters for readability */
.prose { max-width: 68ch; }

a { color: var(--color-emerald); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-brass); }

section { padding: 5rem 0; }
.section-alt { background-color: var(--color-paper-deep); }
.section-navy { background-color: var(--color-navy); color: var(--color-white); }
.section-navy h2, .section-navy h3 { color: var(--color-white); }
.section-navy p { color: rgba(255,255,255,0.78); }


/* -----------------------------------------------------------------------
   3. ACCESSIBILITY HELPERS
   ----------------------------------------------------------------------- */
/* Hidden until focused: lets keyboard users skip straight to content */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-navy);
  color: var(--color-white);
  padding: 0.75rem 1.25rem;
  z-index: 2000;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Visible focus ring everywhere, for keyboard navigation */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--color-brass);
  outline-offset: 2px;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* -----------------------------------------------------------------------
   4. TOP BAR + NAVIGATION
   ----------------------------------------------------------------------- */
.topbar {
  background: var(--color-navy-dark);
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
}
.topbar-inner {
  display: flex;
  justify-content: flex-end;
  gap: 1.75rem;
  padding: 0.5rem 1rem;
}
.topbar-item { color: rgba(255,255,255,0.85); }
.topbar-item i { margin-right: 0.35rem; color: var(--color-brass-light); }
.topbar-link:hover { color: var(--color-brass-light); }

.main-nav {
  background-color: var(--color-paper);
  border-bottom: 1px solid var(--color-border);
  padding: 0.85rem 0;
  transition: box-shadow var(--transition-med), padding var(--transition-med);
}
/* Added by script.js once the page is scrolled, for a subtle "lifted" feel */
.main-nav.nav-scrolled {
  box-shadow: 0 4px 18px rgba(15, 42, 68, 0.08);
  padding: 0.5rem 0;
}

.navbar-brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--color-navy);
  border: 1px solid var(--color-navy);
  padding: 0.15rem 0.55rem;
}
.brand-mark-accent { color: var(--color-brass); }
.brand-text { font-family: var(--font-display); font-size: 1.05rem; color: var(--color-navy); line-height: 1.25; }
.brand-subtext { font-size: 0.75rem; color: var(--color-ink-soft); font-weight: 400; }

.navbar-nav .nav-item a.nav-link,
.navbar-nav .nav-item > a {
  color: var(--color-ink);
  font-weight: 500;
  padding: 0.5rem 0.9rem !important;
  position: relative;
}
.navbar-nav .nav-item > a.active,
.navbar-nav .nav-item > a:hover {
  color: var(--color-emerald);
}
/* Small underline that grows in on hover/active, instead of a background pill */
.navbar-nav .nav-item > a::after {
  content: "";
  position: absolute;
  left: 0.9rem; right: 0.9rem; bottom: 0.15rem;
  height: 2px;
  background: var(--color-brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-fast);
}
.navbar-nav .nav-item > a.active::after,
.navbar-nav .nav-item > a:hover::after { transform: scaleX(1); }

.btn-nav-cta {
  background: var(--color-navy);
  color: var(--color-white) !important;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.btn-nav-cta:hover { background: var(--color-emerald); }
.btn-nav-cta::after { display: none; } /* no underline on the button */


/* -----------------------------------------------------------------------
   5. BUTTONS (site-wide button variants)
   ----------------------------------------------------------------------- */
.btn-primary-brand {
  background-color: var(--color-navy);
  border: 1px solid var(--color-navy);
  color: var(--color-white);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}
.btn-primary-brand:hover { background-color: var(--color-emerald); border-color: var(--color-emerald); color: var(--color-white); transform: translateY(-1px); }

.btn-outline-brand {
  background-color: transparent;
  border: 1px solid var(--color-white);
  color: var(--color-white);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
.btn-outline-brand:hover { background-color: var(--color-white); color: var(--color-navy); }

.btn-brass {
  background-color: var(--color-brass);
  border: 1px solid var(--color-brass);
  color: var(--color-white);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.btn-brass:hover { background-color: var(--color-navy-dark); border-color: var(--color-navy-dark); color: var(--color-white); }


/* -----------------------------------------------------------------------
   6. LEDGER-RULE DIVIDER
   A thin double-line motif referencing ledger paper; used instead of
   generic card shadows to add visual structure between sections.
   ----------------------------------------------------------------------- */
.ledger-rule {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}
.ledger-rule.on-dark { border-top-color: rgba(255,255,255,0.18); }

.ledger-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 2.5rem;
}
.ledger-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-border);
}
.ledger-divider span {
  font-family: var(--font-display);
  color: var(--color-brass);
  font-size: 0.95rem;
  font-style: italic;
}


/* -----------------------------------------------------------------------
   7. HERO SECTIONS
   Asymmetric hero: headline block on the left, a bordered "ledger panel"
   of trust indicators on the right (used on the homepage).
   ----------------------------------------------------------------------- */
.hero {
  background: linear-gradient(180deg, var(--color-paper) 0%, var(--color-paper-deep) 100%);
  padding: 4.5rem 0 5rem;
  border-bottom: 1px solid var(--color-border);
}
.hero-eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-brass);
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}
.hero h1 { margin-bottom: 1.25rem; }
.hero-lead { font-size: 1.15rem; max-width: 52ch; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }

/* The bordered panel on the right of the homepage hero */
.hero-panel {
  border: 1px solid var(--color-navy);
  background: var(--color-white);
  padding: 2rem;
}
.hero-panel-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--color-border);
}
.hero-panel-row:last-child { border-bottom: none; }
.hero-panel-row .label { color: var(--color-ink-soft); font-size: 0.95rem; }
.hero-panel-row .value { font-family: var(--font-display); color: var(--color-navy); font-weight: 600; }

/* Simple inner-page header (used on all non-home pages) */
.page-header {
  background: var(--color-navy);
  color: var(--color-white);
  padding: 3.5rem 0;
}
.page-header h1 { color: var(--color-white); margin-bottom: 0.5rem; }
.page-header p { color: rgba(255,255,255,0.8); max-width: 62ch; margin-bottom: 0; }
.page-header .breadcrumb-trail { color: var(--color-brass-light); font-size: 0.9rem; margin-bottom: 0.75rem; }
.page-header .breadcrumb-trail a { color: var(--color-brass-light); }
.page-header .breadcrumb-trail a:hover { color: var(--color-white); }


/* -----------------------------------------------------------------------
   8. CARDS / FEATURE BLOCKS
   Deliberately NOT the generic rounded-shadow-card kit: flat panels with
   a hairline border and a brass top rule, left-aligned content.
   ----------------------------------------------------------------------- */
.feature-block {
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-emerald);
  background: var(--color-white);
  padding: 2rem;
  height: 100%;
}
.feature-block .feature-icon {
  font-size: 1.6rem;
  color: var(--color-brass);
  margin-bottom: 1rem;
}
.feature-block h3 { margin-bottom: 0.6rem; }
.feature-block p { margin-bottom: 0; font-size: 0.97rem; }

/* Service list rows (used on Accounting & Tax / Business Solutions pages) */
.service-row {
  display: flex;
  gap: 1.25rem;
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--color-border);
}
.service-row:first-child { border-top: 1px solid var(--color-border); }
.service-row .service-icon {
  flex: 0 0 auto;
  width: 3rem; height: 3rem;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-navy);
  color: var(--color-navy);
  font-size: 1.25rem;
}
.service-row h3 { margin-bottom: 0.35rem; font-size: 1.15rem; }
.service-row p { margin-bottom: 0; }


/* -----------------------------------------------------------------------
   9. STEPS (numbered sequence)
   Used ONLY for genuinely sequential content: "how to get started".
   ----------------------------------------------------------------------- */
.steps-list { counter-reset: step-counter; list-style: none; padding: 0; margin: 0; }
.steps-list li {
  counter-increment: step-counter;
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px dashed var(--color-border);
}
.steps-list li:last-child { border-bottom: none; }
.steps-list li::before {
  content: counter(step-counter);
  flex: 0 0 auto;
  width: 2.75rem; height: 2.75rem;
  border: 1px solid var(--color-brass);
  color: var(--color-brass);
  font-family: var(--font-display);
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}


/* -----------------------------------------------------------------------
   10. FAQ ACCORDION
   Restyled Bootstrap accordion to match the ledger aesthetic.
   ----------------------------------------------------------------------- */
.faq-accordion .accordion-item {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
}
.faq-accordion .accordion-button {
  background: transparent;
  color: var(--color-navy);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 1.5rem 0.25rem;
  box-shadow: none;
}
.faq-accordion .accordion-button:not(.collapsed) { color: var(--color-emerald); background: transparent; }
.faq-accordion .accordion-button:focus { box-shadow: none; outline: 2px solid var(--color-brass); }
.faq-accordion .accordion-button::after { filter: sepia(1) saturate(2) hue-rotate(-20deg); } /* tints default chevron toward brass */
.faq-accordion .accordion-body { padding: 0 0.25rem 1.75rem; color: var(--color-ink-soft); }


/* -----------------------------------------------------------------------
   11. CONTACT FORM
   ----------------------------------------------------------------------- */
.contact-form label {
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: 0.35rem;
}
.contact-form .form-control,
.contact-form .form-select {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  background-color: var(--color-white);
}
.contact-form .form-control:focus,
.contact-form .form-select:focus {
  border-color: var(--color-emerald);
  box-shadow: 0 0 0 3px rgba(31, 75, 63, 0.12);
}
.contact-info-panel {
  background: var(--color-navy);
  color: var(--color-white);
  padding: 2.5rem;
  height: 100%;
}
.contact-info-panel h3 { color: var(--color-white); }
.contact-info-panel .info-row { display: flex; gap: 0.9rem; margin-bottom: 1.4rem; align-items: flex-start; }
.contact-info-panel .info-row i { color: var(--color-brass-light); font-size: 1.2rem; margin-top: 0.15rem; }
.contact-info-panel a { color: rgba(255,255,255,0.9); }
.contact-info-panel a:hover { color: var(--color-brass-light); }

/* Alert boxes shown after AJAX submission (success / error) */
#formFeedback { display: none; margin-top: 1.25rem; }
#formFeedback.alert-success { border-left: 4px solid var(--color-emerald); }
#formFeedback.alert-danger  { border-left: 4px solid #a33636; }

/* Spinner shown on the submit button while the AJAX request is in flight */
.btn-spinner { display: none; }
.btn-submitting .btn-spinner { display: inline-block; }
.btn-submitting .btn-label { display: none; }


/* -----------------------------------------------------------------------
   12. FOOTER
   ----------------------------------------------------------------------- */
.site-footer {
  background: var(--color-navy-dark);
  color: rgba(255,255,255,0.75);
  padding: 4.5rem 0 2rem;
}
.footer-brand-mark { border-color: var(--color-brass-light); color: var(--color-white); }
.footer-tagline { font-family: var(--font-display); color: var(--color-white); margin: 1rem 0 0.5rem; font-size: 1.1rem; }
.footer-copy { color: rgba(255,255,255,0.65); font-size: 0.92rem; }
.footer-motto { color: var(--color-brass-light); font-style: italic; font-family: var(--font-display); }
.footer-heading { color: var(--color-white); font-size: 1rem; margin-bottom: 1.1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.65rem; }
.footer-links a { color: rgba(255,255,255,0.7); font-size: 0.94rem; }
.footer-links a:hover { color: var(--color-brass-light); }
.footer-contact li { display: flex; gap: 0.6rem; align-items: flex-start; }
.footer-contact i { color: var(--color-brass-light); margin-top: 0.15rem; }
.site-footer .ledger-rule { border-top-color: rgba(255,255,255,0.15); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; font-size: 0.85rem; color: rgba(255,255,255,0.55); }


/* -----------------------------------------------------------------------
   13. BACK-TO-TOP BUTTON
   Hidden by default; script.js reveals it after the user scrolls down.
   ----------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: 1.5rem; bottom: 1.5rem;
  width: 3rem; height: 3rem;
  background: var(--color-navy);
  color: var(--color-white);
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--transition-med), transform var(--transition-med), visibility var(--transition-med);
  z-index: 900;
  cursor: pointer;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--color-emerald); }


/* -----------------------------------------------------------------------
   14. UTILITY / ANIMATION CLASSES
   One deliberate, orchestrated reveal for hero content on load — not
   scattered fade-ins on every element on the page.
   ----------------------------------------------------------------------- */
@keyframes heroReveal {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-reveal { animation: heroReveal 0.6s ease both; }
.hero-reveal-delay-1 { animation-delay: 0.1s; }
.hero-reveal-delay-2 { animation-delay: 0.2s; }
.hero-reveal-delay-3 { animation-delay: 0.3s; }

.text-brass { color: var(--color-brass) !important; }
.text-emerald { color: var(--color-emerald) !important; }
.bg-paper-deep { background-color: var(--color-paper-deep); }


/* -----------------------------------------------------------------------
   15. RESPONSIVE TWEAKS
   Bootstrap's grid handles most of the heavy lifting; these are the
   custom-component adjustments needed at smaller breakpoints.
   ----------------------------------------------------------------------- */

/* Tablets and below */
@media (max-width: 991.98px) {
  .topbar-inner { justify-content: center; gap: 1rem; flex-wrap: wrap; text-align: center; }
  .navbar-collapse { margin-top: 1rem; border-top: 1px solid var(--color-border); padding-top: 1rem; }
  .navbar-nav .nav-item > a::after { display: none; } /* underline hover doesn't suit stacked mobile menu */
  .hero { padding: 3rem 0; text-align: center; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-panel { margin-top: 2.5rem; }
}

/* Phones */
@media (max-width: 575.98px) {
  section { padding: 3.25rem 0; }
  .brand-text { font-size: 0.92rem; }
  .brand-subtext { font-size: 0.68rem; }
  .service-row { flex-direction: column; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .back-to-top { right: 1rem; bottom: 1rem; width: 2.6rem; height: 2.6rem; }
}
