/* ===============================================================
   JSR Spectrum Solutions — stylesheet
   Warm & approachable theme, with light + dark modes
   =============================================================== */

:root {
  color-scheme: light;

  /* ---- Semantic tokens (LIGHT theme) ---- */
  --bg:             #f6f8fb;  /* page background (cool off-white) */
  --bg-tint-teal:   #e9f1f3;  /* tinted section background (faint teal) */
  --bg-tint-purple: #f0ecf7;  /* tinted section background (faint purple) */
  --surface:        #ffffff;  /* cards, form, badges */
  --surface-input:  #f6f8fb;  /* form field background */
  --text:           #1b2b4e;  /* navy — headings & body */
  --text-soft:      #55617a;  /* slate — supporting text */
  --border:         #dfe6ee;  /* hairline borders */

  --accent:         #1c807b;  /* teal — filled buttons, dots */
  --accent-press:   #145f5b;  /* teal — button hover */
  --accent-text:    #1c807b;  /* teal — eyebrows, numbers, icons */
  --accent-2:       #6d4e9e;  /* purple — secondary accent */
  --link:           #145f5b;  /* readable teal for links */
  --on-accent:      #ffffff;  /* text on accent / always-dark surfaces */
  --error:          #b02a1f;

  --header-bg:      rgba(246, 248, 251, 0.9);

  /* Always-dark regions (identical in both themes) */
  --cta-from:       #1b2b4e;
  --cta-to:         #145f5b;
  --footer-bg:      #1b2b4e;
  --footer-text:    #f6f8fb;
  --footer-text-soft: #e9f1f3;

  --shadow-sm: 0 2px 8px rgba(27, 43, 78, 0.06);
  --shadow-md: 0 10px 30px rgba(27, 43, 78, 0.10);
  --radius:    16px;
  --radius-sm: 10px;

  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --maxw: 1120px;
}

/* ---- DARK theme: chosen explicitly via the toggle ---- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:             #0f1729;
  --bg-tint-teal:   #12212b;
  --bg-tint-purple: #191634;
  --surface:        #17213a;
  --surface-input:  #111b30;
  --text:           #e7ecf5;
  --text-soft:      #a6b1c7;
  --border:         #2a3757;

  --accent:         #1c807b;
  --accent-press:   #14615c;
  --accent-text:    #4fbcb4;
  --accent-2:       #a98fd6;
  --link:           #5cc4bc;
  --on-accent:      #ffffff;
  --error:          #ff8a7a;

  --header-bg:      rgba(15, 23, 41, 0.85);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.30);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);
}

/* ---- DARK theme: no explicit choice, follow the OS (also works without JS) ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;

    --bg:             #0f1729;
    --bg-tint-teal:   #12212b;
    --bg-tint-purple: #191634;
    --surface:        #17213a;
    --surface-input:  #111b30;
    --text:           #e7ecf5;
    --text-soft:      #a6b1c7;
    --border:         #2a3757;

    --accent:         #1c807b;
    --accent-press:   #14615c;
    --accent-text:    #4fbcb4;
    --accent-2:       #a98fd6;
    --link:           #5cc4bc;
    --on-accent:      #ffffff;
    --error:          #ff8a7a;

    --header-bg:      rgba(15, 23, 41, 0.85);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);
  }
}

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

img { max-width: 100%; display: block; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-head);
  color: var(--text);
  line-height: 1.12;
  margin: 0 0 0.5em;
  font-weight: 600;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "dlig" 0;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.8em 1.5em;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--accent-press); box-shadow: var(--shadow-md); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--link); }

.btn-block { width: 100%; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(150%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand { display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 56px; width: auto; display: block; }

/* Theme-aware logo swap: dark-lettered logo only on the dark theme.
   Uses img.<class> so it outranks the later .hero-logo / .brand-logo display rules. */
img.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) .logo-light { display: none; }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .logo-dark { display: block; }
}
.brand-mark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent-text);
  letter-spacing: 0.5px;
}
.brand-text {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text);
}

.primary-nav { display: flex; align-items: center; gap: 28px; }
.primary-nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.98rem;
}
.primary-nav a:hover { color: var(--link); text-decoration: none; }
.btn-nav {
  padding: 0.55em 1.2em;
  background: var(--accent);
  color: var(--on-accent) !important;
  border-radius: 999px;
  font-weight: 600;
}
.btn-nav:hover { background: var(--accent-press); }

.lang-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; }
.lang-switch a { color: var(--text-soft); font-weight: 600; padding: 2px 3px; }
.lang-switch a:hover { color: var(--link); text-decoration: none; }
.lang-switch a.active { color: var(--link); }
.lang-switch .sep { color: var(--border); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-2px); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle-icon { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(109, 78, 158, 0.16), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(28, 128, 123, 0.14), transparent 55%),
    var(--bg);
  padding: clamp(56px, 9vw, 110px) 0;
}
.hero-inner {
  display: flex;
  align-items: center;
  gap: clamp(24px, 4vw, 56px);
}

.hero-logo-col { flex: 0 0 auto; }
.hero-text-col { flex: 1 1 auto; min-width: 0; }

.hero-logo {
  width: clamp(260px, 34vw, 420px);
  height: auto;
  display: block;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-text);
  margin: 0 0 18px;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  font-weight: 600;
  letter-spacing: -0.5px;
  margin-bottom: 0.3em;
}
.hero h1 .accent { color: var(--accent-text); }

.lede {
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 0 32px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 34px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 0.92rem;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  max-width: 560px;
  line-height: 1.4;
}
.badge-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent-text);
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(47, 111, 107, 0.15);
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-tint { background: var(--bg-tint-teal); }
.section-tint-alt { background: var(--bg-tint-purple); }

.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-text);
  margin: 0 0 12px;
}
.section h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }

.section-head { max-width: 620px; margin: 0 auto 48px; text-align: center; }
.section-sub { color: var(--text-soft); font-size: 1.1rem; margin: 0; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
}
.about-copy p { color: var(--text-soft); font-size: 1.05rem; }
.about-copy strong { color: var(--text); }
.about-copy .note {
  background: var(--surface);
  border-left: 4px solid var(--accent-2);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 0.98rem;
  margin-top: 24px;
}

.about-stats {
  display: grid;
  gap: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.stat-num {
  display: block;
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent-text);
  line-height: 1;
}
.stat-label { color: var(--text-soft); font-size: 0.98rem; }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.service-icon {
  font-size: 1.9rem;
  width: 58px; height: 58px;
  display: grid; place-items: center;
  background: var(--bg-tint-teal);
  border-radius: 14px;
  margin-bottom: 18px;
}
.service-card h3 { font-size: 1.25rem; margin-bottom: 0.35em; }
.service-card p { color: var(--text-soft); margin: 0; font-size: 1rem; }

/* ---------- Payments ---------- */
.pay-action { text-align: center; }
.btn-pay {
  min-width: 260px;
  font-size: 1.05rem;
  padding: 0.95em 2.2em;
}
.pay-secure {
  color: var(--text-soft);
  font-size: 0.88rem;
  margin: 14px 0 0;
}

.pay-note {
  max-width: 620px;
  margin: 40px auto 0;
  text-align: center;
  background: var(--surface);
  border-left: 4px solid var(--accent-2);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: var(--text-soft);
  font-size: 0.98rem;
}
.pay-note strong { color: var(--text); }

/* Payment page: service picker card (pay.html) */
.pay-picker {
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.pay-picker .field { margin-bottom: 0; }

/* "Continue" stays inert until a service is chosen. */
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Dropdown sits above the button, divided from it. */
.pay-picker .pay-action {
  text-align: center;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

@media (max-width: 520px) {
  .btn-pay { width: 100%; min-width: 0; }
  .pay-picker { padding: 24px 20px; }
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.contact-copy p { color: var(--text-soft); font-size: 1.05rem; }

.contact-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 18px; }
.contact-list li { display: flex; flex-direction: column; }
.contact-label {
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-text);
  margin-bottom: 2px;
}
.contact-list a { font-size: 1.15rem; font-weight: 600; color: var(--text); }
.contact-list a:hover { color: var(--link); text-decoration: none; }

/* Purchase-order terms for districts — informational, deliberately quiet. */
.contact-terms {
  margin: 28px 0 0;
  padding: 14px 18px;
  background: var(--surface);
  border-left: 4px solid var(--accent-2);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.contact-copy .contact-terms strong { color: var(--text); }

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: var(--text);
}
.optional { color: var(--text-soft); font-weight: 400; }
.field input, .field textarea, .field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-input);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field select { cursor: pointer; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(28, 128, 123, 0.18);
  background: var(--surface);
}
.field textarea { resize: vertical; }
.form-note { text-align: center; color: var(--text-soft); font-size: 0.85rem; margin: 14px 0 0; }
.form-note-error { color: var(--error); font-weight: 600; }

/* Inline thank-you shown after a successful contact submission */
.form-success { text-align: center; padding: 12px 0; }
.form-success-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 1.9rem;
  line-height: 1;
}
.form-success h3 {
  font-family: var(--font-head);
  color: var(--text);
  font-size: 1.5rem;
  margin: 0 0 8px;
}
.form-success p { color: var(--text-soft); margin: 0; }

/* ---------- Booking CTA (always dark) ---------- */
.book-cta {
  background: linear-gradient(135deg, var(--cta-from) 0%, var(--cta-to) 100%);
}
.book-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(28px, 5vw, 64px);
  flex-wrap: wrap;
}
.book-copy { flex: 1 1 360px; }
.book-cta h2 { color: var(--on-accent); margin: 0 0 12px; }
.book-cta .section-eyebrow { color: rgba(255, 255, 255, 0.82); }
.book-lede { color: rgba(255, 255, 255, 0.9); margin: 0; max-width: 520px; }
.book-points {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 9px;
}
.book-points li {
  position: relative;
  padding-left: 28px;
  color: rgba(255, 255, 255, 0.92);
}
.book-points li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--on-accent);
  font-weight: 700;
}
.book-action { flex: 0 0 auto; text-align: center; }
.btn-book {
  background: #ffffff;
  color: #1b2b4e;
  font-size: 1.05rem;
  padding: 0.95em 1.9em;
  box-shadow: var(--shadow-md);
}
.btn-book:hover { background: #e9f1f3; }
.book-note { margin: 12px 0 0; font-size: 0.85rem; color: rgba(255, 255, 255, 0.78); }
@media (max-width: 720px) {
  .book-action { width: 100%; text-align: left; }
  .btn-book { width: 100%; }
}

/* ---------- Footer (always dark) ---------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 48px 0 32px;
}
.footer-inner { text-align: center; display: grid; gap: 14px; justify-items: center; }
.site-footer .brand-mark { color: #4fb8b1; }
.site-footer .brand-text { color: var(--footer-text); }
.footer-brand { display: flex; align-items: baseline; gap: 8px; }
.footer-tag { font-family: var(--font-head); font-style: italic; color: var(--footer-text-soft); margin: 0; }
.footer-nav { display: flex; gap: 24px; }
.footer-nav a { color: var(--footer-text-soft); font-weight: 500; }
.footer-nav a:hover { color: #ffffff; }
.footer-legal { color: rgba(246, 248, 251, 0.6); font-size: 0.85rem; margin: 6px 0 0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero-logo { width: clamp(240px, 58vw, 360px); }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .brand-logo { height: 46px; }
  .primary-nav {
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 24px 20px;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .btn-nav { text-align: center; margin-top: 12px; border-bottom: none !important; }
  .theme-toggle { align-self: flex-start; margin-top: 12px; }
}

@media (max-width: 520px) {
  .services-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
