/* ==========================================================================
   Diversifi Cleaning Services — shared stylesheet
   Design language: "Crisp denim and sunbeam" (chalk / denim navy / sunbeam)
   Fonts: Sora (headings) + Public Sans (body)
   ========================================================================== */

/* ---- Palette tokens (light default) ------------------------------------- */
:root {
  --ground: #F6F8FB;        /* page background */
  --surface: #FFFFFF;       /* card / panel surface fill (flips dark) */
  --ink: #101A2E;           /* body text */
  --muted: #4A5873;         /* secondary text */
  --brand: #27508F;         /* CTA fill */
  --brand-text: #27508F;    /* brand as small text */
  --sun: #FFD23F;           /* highlight fill */
  --ink-on-fill: #101A2E;   /* text on sun fill — fixed in both themes */
  --sun-text: #7A5A00;      /* sun as small text (light: dark gold for contrast) */
  --on-brand: #FFFFFF;      /* text on brand / always-dark bands — FIXED white */
  --accent-on-dark: #FFD23F;/* highlight on always-dark bands — fixed */
  --band: #122443;          /* always-dark header/hero/footer/CTA/room-brief panel */

  /* decorative star / icon on light backgrounds must reach >=4.5:1 */
  --star: #8A5F00;         /* darker gold for light mode decorative stars */
  --star-on-dark: #FFD23F;  /* bright on dark bands */

  --border: #D7DEEA;        /* hairline borders on light surfaces */
  --border-on-dark: rgba(234,240,250,0.18);

  --radius: 10px;
  --radius-sm: 7px;
  --maxw: 1080px;
  --gap: 20px;

  --font-head: "Sora", system-ui, sans-serif;
  --font-body: "Public Sans", system-ui, sans-serif;

  --shadow: 0 1px 3px rgba(16,26,46,0.08), 0 4px 16px rgba(16,26,46,0.06);
}

/* ---- Dark theme override ------------------------------------------------- */
html[data-theme="dark"] {
  --ground: #0B1220;
  --surface: #152036;
  --ink: #EAF0FA;
  --muted: #A9B7D0;
  --brand: #3963B3;
  --brand-text: #A9C4F2;
  --sun: #FFD23F;
  --ink-on-fill: #101A2E;   /* dark ink on sun — never white */
  --sun-text: #FFD23F;      /* sun readable as small text on dark ground */
  --on-brand: #FFFFFF;      /* still white on brand/dark bands */
  --accent-on-dark: #FFD23F;
  --band: #060B15;

  --star: #FFD23F;          /* bright gold reads fine on dark */
  --star-on-dark: #FFD23F;

  --border: #26334E;
  --border-on-dark: rgba(234,240,250,0.16);

  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.3);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--ground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1.02rem; font-weight: 600; }

p { margin: 0 0 1rem; }
a { color: var(--brand-text); }
img { max-width: 100%; display: block; }

ul, ol { margin: 0 0 1rem; padding-left: 1.3em; }
li { margin: 0.25em 0; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.muted { color: var(--muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--brand); color: var(--on-brand);
  padding: 10px 16px; border-radius: var(--radius-sm);
  transition: top 0.15s;
}
.skip-link:focus { top: 8px; }

/* ---- Layout -------------------------------------------------------------- */
/* NOTE (bug rule 4): never `padding: X 0` on an element that is also .container.
   .container only sets inline padding + width. Vertical rhythm comes from .section. */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-left: 20px;
  padding-right: 20px;
}
.section { padding-top: 56px; padding-bottom: 56px; }
.section--tight { padding-top: 36px; padding-bottom: 36px; }

.grid { display: grid; gap: var(--gap); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
/* bug rule 3: min-width:0 on grid children so long content can shrink */
.grid > * { min-width: 0; }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5em;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  line-height: 1.2;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  /* bug rule 3: big buttons must wrap long text, not overflow */
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}
.btn--primary { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.btn--primary:hover { background: #1d3f73; border-color: #1d3f73; }
html[data-theme="dark"] .btn--primary:hover { background: #6a93dc; border-color: #6a93dc; }

.btn--sun { background: var(--sun); color: var(--ink-on-fill); border-color: var(--sun); }
.btn--sun:hover { background: #ecbf2a; border-color: #ecbf2a; }

.btn--ghost {
  background: transparent; color: var(--brand-text); border-color: var(--brand);
}
.btn--ghost:hover { background: rgba(39,80,143,0.08); }
html[data-theme="dark"] .btn--ghost:hover { background: rgba(76,123,208,0.14); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---- Chips --------------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-size: 0.85rem; font-weight: 500;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(39,80,143,0.08);
  color: var(--muted);
  border: 1px solid var(--border);
}
.chip--proof { background: rgba(255,210,63,0.18); color: var(--sun-text); border-color: rgba(255,210,63,0.5); }
html[data-theme="dark"] .chip { background: rgba(169,183,208,0.12); }
html[data-theme="dark"] .chip--proof { background: rgba(255,210,63,0.14); color: var(--sun-text); }

.star { color: var(--star); font-style: normal; }

/* ---- Cards --------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card img { border-radius: var(--radius-sm); margin-bottom: 14px; }

.img-note {
  font-size: 0.78rem; color: var(--muted);
  margin-top: 6px; font-style: italic;
}

.notes, .note {
  font-size: 0.88rem; color: var(--muted);
}

.needs-content {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px; text-align: center;
  color: var(--muted); background: transparent;
}

/* ---- NAP list ------------------------------------------------------------ */
dl.nap { margin: 0; }
dl.nap dt { font-weight: 700; color: var(--ink); margin-top: 12px; }
dl.nap dd { margin: 2px 0 0; color: var(--muted); word-break: break-word; }

/* ==========================================================================
   ALWAYS-DARK SECTIONS: .site-header, .hero, .band, .site-footer,
   and the room-brief output panel (.rb-output).
   Full text rules so nothing inherits a swapped-dark surface token.
   (bug rules 1, 2, 7)
   ========================================================================== */
.site-header, .hero, .band, .site-footer, .rb-output {
  background: var(--band);
  color: var(--on-brand);
}
/* headings + text */
.hero h1, .hero h2, .hero h3, .hero h4,
.band h1, .band h2, .band h3, .band h4,
.rb-output h1, .rb-output h2, .rb-output h3, .rb-output h4,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4 { color: var(--on-brand); }

.hero p, .hero li,
.band p, .band li,
.rb-output p, .rb-output li,
.site-footer p, .site-footer li { color: var(--on-brand); }

/* muted inside dark bands: lighter, still readable (not the dark-ground muted) */
.hero .muted, .band .muted, .rb-output .muted, .site-footer .muted,
.hero .note, .band .note, .rb-output .note, .site-footer .note,
.hero .notes, .band .notes, .rb-output .notes, .site-footer .notes,
.hero .img-note, .band .img-note, .rb-output .img-note, .site-footer .img-note {
  color: #C3D0E6;
}

/* chips inside dark bands */
.hero .chip, .band .chip, .rb-output .chip, .site-footer .chip {
  background: rgba(255,255,255,0.1);
  color: #E4ECF8;
  border-color: var(--border-on-dark);
}
.hero .chip--proof, .band .chip--proof, .rb-output .chip--proof, .site-footer .chip--proof {
  background: rgba(255,210,63,0.16);
  color: var(--accent-on-dark);
  border-color: rgba(255,210,63,0.45);
}

/* decorative stars on dark bands */
.hero .star, .band .star, .rb-output .star, .site-footer .star { color: var(--star-on-dark); }

/* NAP list on dark bands */
.site-footer dl.nap dt, .band dl.nap dt, .rb-output dl.nap dt { color: var(--on-brand); }
.site-footer dl.nap dd, .band dl.nap dd, .rb-output dl.nap dd { color: #C3D0E6; }

/* links inside dark bands (bug rule 7: must NOT override button text colours) */
.hero a:not(.btn), .band a:not(.btn), .rb-output a:not(.btn), .site-footer a:not(.btn) {
  color: var(--accent-on-dark);
}
.hero a:not(.btn):hover, .band a:not(.btn):hover,
.rb-output a:not(.btn):hover, .site-footer a:not(.btn):hover { color: #fff; }

/* ghost buttons inside dark bands need light text/border */
.hero .btn--ghost, .band .btn--ghost, .rb-output .btn--ghost, .site-footer .btn--ghost {
  color: var(--on-brand); border-color: rgba(255,255,255,0.6); background: transparent;
}
.hero .btn--ghost:hover, .band .btn--ghost:hover,
.rb-output .btn--ghost:hover, .site-footer .btn--ghost:hover {
  background: rgba(255,255,255,0.12);
}

/* bug rule 7: primary & sun buttons keep their own text colour inside dark
   sections — equal-or-greater specificity than the a:not(.btn) rule, incl. hover */
.hero a.btn--primary, .band a.btn--primary, .rb-output a.btn--primary, .site-footer a.btn--primary,
.hero a.btn--primary:hover, .band a.btn--primary:hover, .rb-output a.btn--primary:hover, .site-footer a.btn--primary:hover {
  color: var(--on-brand);
}
.hero a.btn--sun, .band a.btn--sun, .rb-output a.btn--sun, .site-footer a.btn--sun,
.hero a.btn--sun:hover, .band a.btn--sun:hover, .rb-output a.btn--sun:hover, .site-footer a.btn--sun:hover {
  color: var(--ink-on-fill);
}

/* demo-note strip — solid dark background (bug rule 1) */
.demo-note {
  background: #0A1120;
  color: #C3D0E6;
  font-size: 0.82rem;
  text-align: center;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border-on-dark);
}
.demo-note a { color: var(--accent-on-dark); }

/* ---- Header / nav -------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--border-on-dark); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding-top: 14px; padding-bottom: 14px;
}
.brand {
  display: flex; flex-direction: column; text-decoration: none;
  color: var(--on-brand); line-height: 1.1;
  min-width: 0;
}
.brand .brand-name {
  font-family: var(--font-head); font-weight: 700; font-size: 1.15rem;
  color: var(--on-brand);
  /* bug rule 3: brand name wraps at spaces */
  white-space: normal; word-break: break-word;
}
.brand .brand-sub { font-size: 0.78rem; color: #C3D0E6; }

.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a {
  color: var(--on-brand); text-decoration: none; font-weight: 500;
  font-size: 0.95rem; padding: 4px 2px; border-bottom: 2px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent-on-dark); }

.header-actions { display: flex; align-items: center; gap: 10px; }

/* theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.1);
  color: var(--on-brand);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-sm);
  cursor: pointer; flex: none;
}
.theme-toggle:hover { background: rgba(255,255,255,0.2); }
.theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }

/* ---- Hero ---------------------------------------------------------------- */
.hero .section { padding-top: 56px; padding-bottom: 56px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
.hero-grid > * { min-width: 0; }
.hero-media img { border-radius: var(--radius); width: 100%; height: auto; }
.hero .lead { font-size: 1.1rem; }
.proof-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }

/* ---- Footer -------------------------------------------------------------- */
.site-footer .footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px;
}
.site-footer .footer-grid > * { min-width: 0; }
.footer-bottom {
  border-top: 1px solid var(--border-on-dark);
  margin-top: 28px; padding-top: 18px;
  font-size: 0.82rem; color: #C3D0E6;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--on-brand); text-decoration: none; }
.footer-links a:hover { color: var(--accent-on-dark); }

/* ==========================================================================
   ROOM-BY-ROOM BRIEF — signature feature
   ========================================================================== */
.rb-step { margin-bottom: 28px; }
.rb-step > legend, .rb-step > .rb-step-title {
  font-family: var(--font-head); font-weight: 600; font-size: 1.15rem;
  margin: 0 0 4px; padding: 0; color: var(--ink);
}
.rb-step-help { font-size: 0.9rem; color: var(--muted); margin: 0 0 14px; }

fieldset.rb-step { border: 0; padding: 0; margin-inline: 0; }

/* segmented toggle (home/office, depth) */
.rb-toggle { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.rb-toggle button, .rb-depth button {
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  padding: 10px 18px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--surface); color: var(--ink);
  cursor: pointer; max-width: 100%; white-space: normal;
}
.rb-toggle button[aria-pressed="true"],
.rb-depth button[aria-pressed="true"] {
  background: var(--brand); color: var(--on-brand); border-color: var(--brand);
}

/* room tiles */
.rb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.rb-tiles > * { min-width: 0; }
.rb-tile {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--surface);
  cursor: pointer; text-align: left;
}
.rb-tile[aria-pressed="true"], .rb-tile.is-selected {
  border-color: var(--brand);
  background: rgba(39,80,143,0.07);
  box-shadow: inset 0 0 0 1px var(--brand);
}
html[data-theme="dark"] .rb-tile.is-selected { background: rgba(76,123,208,0.14); }
.rb-tile .rb-tile-name { font-weight: 700; color: var(--ink); }

/* stepper */
.rb-stepper { display: inline-flex; align-items: center; gap: 10px; margin-top: 4px; }
.rb-stepper button {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 2px solid var(--brand); background: var(--surface); color: var(--brand-text);
  font-size: 1.2rem; font-weight: 700; cursor: pointer; line-height: 1;
}
.rb-stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
.rb-stepper output { min-width: 2.4ch; text-align: center; font-weight: 700; color: var(--ink); }

/* extras checkboxes */
.rb-extras { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.rb-extras > * { min-width: 0; }
.rb-check {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; color: var(--ink);
}
.rb-check input { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.rb-check:has(input:checked) { border-color: var(--brand); background: rgba(39,80,143,0.07); }
html[data-theme="dark"] .rb-check:has(input:checked) { background: rgba(76,123,208,0.14); }

/* text + date inputs */
.rb-field { margin-top: 12px; }
.rb-field label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.rb-input, input[type="text"].rb-input, input[type="date"].rb-input {
  font-family: var(--font-body); font-size: 1rem;
  padding: 10px 12px; width: 100%; max-width: 360px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
}
.rb-charcount { font-size: 0.8rem; color: var(--muted); }

/* selected-option helper text — readable in both themes (bug rule 8) */
.rb-selected-help {
  font-size: 0.9rem; font-weight: 500;
  color: var(--brand-text);
  margin-top: 8px;
}

/* Output panel is an ALWAYS-DARK section (.rb-output defined in dark block above) */
.rb-output {
  border-radius: var(--radius);
  padding: 26px;
  margin-top: 8px;
}
.rb-output .rb-summary-line {
  font-family: var(--font-head); font-weight: 600; font-size: 1.1rem;
  color: var(--on-brand);
}
.rb-output .rb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; }
.rb-output .rb-cols > * { min-width: 0; }
.rb-output h4 { color: var(--accent-on-dark); }
.rb-ticklist { list-style: none; padding: 0; margin: 0; }
.rb-ticklist li { position: relative; padding-left: 1.6em; color: var(--on-brand); }
.rb-ticklist li::before { content: "\2713"; position: absolute; left: 0; color: var(--accent-on-dark); font-weight: 700; }

.rb-send { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.rb-copy-status { font-size: 0.85rem; color: #C3D0E6; margin-top: 8px; min-height: 1.2em; }

/* ---- Utility sections ---------------------------------------------------- */
.lead { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }
.section-intro { max-width: 62ch; margin-bottom: 28px; }
.center { text-align: center; }
.band .lead, .hero .lead { color: #C3D0E6; }
.cta-band { text-align: center; }
.cta-band .btn-row { justify-content: center; }

.badge-award {
  display: inline-flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow);
}
.badge-award strong { color: var(--ink); }

/* ==========================================================================
   RESPONSIVE (bug rule 3)
   ========================================================================== */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; }
  .rb-output .rb-cols { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .grid--3 { grid-template-columns: 1fr; }
  .grid--2 { grid-template-columns: 1fr; }
  /* nav on its own row <=700px handled at 700 below */
}

@media (max-width: 700px) {
  .header-inner { flex-wrap: wrap; }
  /* nav drops onto its own full-width row */
  .nav { order: 3; width: 100%; justify-content: flex-start; gap: 14px 18px; }
}

@media (max-width: 560px) {
  .site-footer .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  /* bug rule 3: hide header CTA + brand subtitle on tiny screens */
  .brand .brand-sub { display: none; }
  .header-cta { display: none; }
  h1 { font-size: 1.75rem; }
}

/* 320px safety: everything must still fit */
@media (max-width: 360px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .btn { width: 100%; }
  .btn-row { gap: 10px; }
}

/* ---- Reduced motion ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
