:root {
  --brand: #0156fc;      /* roommaster Royal Blue */
  --brand-dark: #0140c4;
  --brand-tint: #e8f0ff;
  --spring: #35ff69;     /* roommaster Spring Green */
  --spring-dark: #1fe653;
  --deep: #000a1e;       /* roommaster Deep Blue */
  --navy: #0a1a3a;
  --ink: #16233f;
  --muted: #5b6b8c;
  --line: #e4e9f2;
  --bg: #f5f7fb;
  --card: #ffffff;
  --good: #16a34a;
  --good-bg: #e9f7ef;
  --warn: #e08600;
  --warn-bg: #fdf3e2;
  --bad: #dc2626;
  --bad-bg: #fdeaea;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(10, 26, 58, 0.08);
  --shadow-lg: 0 20px 60px rgba(10, 26, 58, 0.16);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.topbar .logo { height: 30px; }
.topbar .cta-mini {
  background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-weight: 600; font-size: 14px; transition: background .2s;
}
.topbar .cta-mini:hover { background: var(--brand-dark); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, #041033 0%, #0a2a7a 55%, #0156fc 130%);
  color: #fff; padding: 72px 0 96px; position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 10%, rgba(255,255,255,.12), transparent 45%);
}
.hero .wrap { position: relative; z-index: 1; }
.eyebrow {
  display: inline-block; background: rgba(255,255,255,.14); color: #cfe0ff;
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  letter-spacing: .3px; margin-bottom: 22px;
}
.hero h1 { font-size: 46px; line-height: 1.08; font-weight: 800; max-width: 720px; letter-spacing: -1px; }
.hero h1 span { color: #7fb0ff; }
.hero p.sub { font-size: 19px; color: #c7d6f5; margin-top: 18px; max-width: 620px; }

.audit-form {
  margin-top: 36px; display: flex; gap: 12px; max-width: 640px;
  background: #fff; padding: 8px; border-radius: 14px; box-shadow: var(--shadow-lg);
}
.audit-form input {
  flex: 1; border: none; outline: none; font-size: 16px; padding: 14px 16px;
  color: var(--ink); border-radius: 8px; font-family: var(--font);
}
.btn {
  background: var(--brand); color: #fff; border: none; cursor: pointer;
  font-weight: 700; font-size: 16px; padding: 14px 26px; border-radius: 10px;
  font-family: var(--font); transition: background .2s, transform .1s; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.hero .trust { margin-top: 18px; font-size: 14px; color: #a9c0ec; display: flex; gap: 20px; flex-wrap: wrap; }
.hero .trust span::before { content: '✓ '; color: var(--spring); font-weight: 800; }

/* Spring Green CTA (roommaster palette) - deep blue text for contrast */
.btn-neon { background: var(--spring); color: var(--deep); }
.btn-neon:hover { background: var(--spring-dark); color: var(--deep); }

/* Quiet outline button (e.g. "Show all pages") */
.btn-ghost-blue { background: transparent; border: 1.5px solid var(--brand); color: var(--brand); }
.btn-ghost-blue:hover { background: var(--brand-tint); color: var(--brand); }
.form-error { color: #ffd0d0; font-size: 14px; margin-top: 10px; min-height: 18px; }

/* ---------- Feature strip ---------- */
.features { padding: 56px 0; }
.features h2 { text-align: center; font-size: 28px; color: var(--navy); margin-bottom: 6px; }
.features .lead { text-align: center; color: var(--muted); margin-bottom: 38px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.feature .ico { font-size: 26px; margin-bottom: 10px; }
.feature h3 { font-size: 15px; color: var(--navy); margin-bottom: 6px; }
.feature p { font-size: 13.5px; color: var(--muted); }

/* ---------- Progress bar ---------- */
.progress-track {
  width: min(420px, 84%);
  height: 10px;
  background: #e4e9f2;
  border-radius: 999px;
  margin: 18px auto 8px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), #338bff);
  border-radius: 999px;
  transition: width 1.1s ease;
}
.progress-pct { font-size: 13px; font-weight: 700; color: var(--brand); margin-bottom: 4px; }

/* ---------- How it works ---------- */
.how { padding: 56px 24px 10px; }
.how h2 { text-align: center; font-size: 28px; color: var(--navy); margin-bottom: 30px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); text-align: center;
}
.step .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 17px; margin-bottom: 14px;
}
.step h3 { font-size: 16.5px; color: var(--navy); margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--muted); line-height: 1.6; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* ---------- About roommaster ---------- */
.rm-about { background: #f7f5f2; border-top: 1px solid var(--line); padding: 56px 0 64px; margin-top: 48px; }
.rm-about h2 { text-align: center; font-size: 28px; color: var(--navy); margin-bottom: 12px; }
.rm-lead { text-align: center; color: var(--muted); max-width: 760px; margin: 0 auto 34px; font-size: 15.5px; line-height: 1.65; }

/* Stat band: deep blue, big animated numbers, spring green accents */
.rm-statband {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  background: linear-gradient(135deg, #000a1e, #0a2a7a);
  border-radius: var(--radius); padding: 34px 20px; margin-bottom: 30px;
  box-shadow: var(--shadow-lg);
}
.rm-stat { text-align: center; padding: 4px 18px; }
.rm-stat + .rm-stat { border-left: 1px solid rgba(255, 255, 255, .14); }
.rm-stat b { display: block; font-size: 44px; font-weight: 800; color: var(--spring); letter-spacing: -1px; line-height: 1.1; }
.rm-stat .lbl { display: block; margin-top: 8px; font-size: 13px; color: #c7d6f5; line-height: 1.45; }
@media (max-width: 860px) {
  .rm-statband { grid-template-columns: 1fr 1fr; row-gap: 22px; }
  .rm-stat:nth-child(3) { border-left: none; }
}
@media (max-width: 480px) {
  .rm-statband { grid-template-columns: 1fr; }
  .rm-stat + .rm-stat { border-left: none; }
}

.rm-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.rm-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.rm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.rm-ico { font-size: 30px; margin-bottom: 12px; }
.rm-card h3 { font-size: 17.5px; color: var(--navy); margin-bottom: 8px; }
.rm-card p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.rm-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 20px; }
.rm-stats span { background: #e8f0ff; color: var(--brand); font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.rm-stats span b { font-weight: 800; }
.rm-cta { margin-top: auto; text-align: center; }
.rm-note { text-align: center; color: var(--muted); font-size: 14px; margin-top: 28px; }
@media (max-width: 860px) { .rm-cards { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { padding: 60px 24px 70px; max-width: 840px; }
.faq h2 { text-align: center; font-size: 28px; color: var(--navy); margin-bottom: 28px; }
.faq-list details {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  margin-bottom: 12px; box-shadow: var(--shadow); overflow: hidden;
}
.faq-list summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 18px 22px; font-weight: 700; font-size: 15.5px; color: var(--navy);
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+'; flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #e8f0ff; color: var(--brand); font-weight: 800; font-size: 16px;
  transition: transform .2s ease;
}
.faq-list details[open] summary::after { content: '−'; background: var(--spring); color: var(--deep); }
.faq-list details p { padding: 0 22px 20px; color: var(--muted); font-size: 14.5px; line-height: 1.65; }
.faq-cta { text-align: center; margin-top: 30px; }
.faq-cta p { color: var(--muted); margin-bottom: 12px; font-size: 15px; }

/* ---------- Loading ---------- */
.loading { padding: 90px 0; text-align: center; }
.spinner {
  width: 64px; height: 64px; border: 5px solid var(--brand-tint);
  border-top-color: var(--brand); border-radius: 50%; margin: 0 auto 28px;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading h2 { color: var(--navy); font-size: 24px; }
.loading .step { color: var(--muted); margin-top: 10px; font-size: 15px; min-height: 22px; }
.loading .host { color: var(--brand); font-weight: 700; }

/* ---------- Report ---------- */
.report { padding: 40px 0 80px; }
.report-head {
  background: linear-gradient(160deg, #041033, #0a2a7a); color: #fff;
  border-radius: 20px; padding: 34px; display: flex; gap: 32px; align-items: center;
  box-shadow: var(--shadow-lg); flex-wrap: wrap;
}
.report-head .logo-wrap { flex: 0 0 auto; }
.report-head .logo-wrap img { height: 34px; filter: brightness(0) invert(1); }
.report-head .meta { flex: 1; min-width: 240px; }
.report-head .meta .kicker { color: #9db8ec; font-size: 13px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.report-head .meta h1 { font-size: 30px; margin: 6px 0 4px; word-break: break-word; }
.report-head .meta .date { color: #b9ccef; font-size: 14px; }

.score-badge { text-align: center; flex: 0 0 auto; }
.gauge { position: relative; width: 150px; height: 150px; }
.gauge svg { transform: rotate(-90deg); }
.gauge .num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gauge .num b { font-size: 40px; line-height: 1; }
.gauge .num small { font-size: 12px; color: #b9ccef; }
.grade-pill { display: inline-block; margin-top: 10px; padding: 5px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.grade-good { background: var(--good-bg); color: var(--good); }
.grade-warn { background: var(--warn-bg); color: var(--warn); }
.grade-bad { background: var(--bad-bg); color: var(--bad); }

.summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 26px 0; }
.scard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.scard .n { font-size: 30px; font-weight: 800; }
.scard .l { font-size: 13px; color: var(--muted); margin-top: 2px; }
.scard.crit .n { color: var(--bad); }
.scard.opp .n { color: var(--warn); }
.scard.win .n { color: var(--good); }
.scard.pages .n { color: var(--brand); }

.section-title { font-size: 21px; color: var(--navy); margin: 34px 0 14px; font-weight: 700; }

/* Category score bars */
.cat-scores { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cat-row { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; box-shadow: var(--shadow); }
.cat-row .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cat-row .name { font-weight: 600; font-size: 14.5px; color: var(--ink); }
.cat-row .val { font-weight: 800; font-size: 15px; }
.bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; }

/* Callout / teaser gate */
.teaser-note { background: var(--brand-tint); border: 1px dashed var(--brand); border-radius: var(--radius); padding: 20px 24px; margin: 24px 0; color: var(--navy); }

.issue-list { display: flex; flex-direction: column; gap: 12px; }
.issue {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow);
}
.issue.fail { border-left-color: var(--bad); }
.issue.warn { border-left-color: var(--warn); }
.issue.pass { border-left-color: var(--good); }
.issue .ihead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.issue .tag { font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .3px; }
.issue.fail .tag { background: var(--bad-bg); color: var(--bad); }
.issue.warn .tag { background: var(--warn-bg); color: var(--warn); }
.issue.pass .tag { background: var(--good-bg); color: var(--good); }
.issue .cat-label { font-size: 12px; color: var(--muted); }
.issue h4 { font-size: 15px; color: var(--navy); margin: 0; }
.issue p { font-size: 14px; color: var(--muted); margin-top: 6px; }
.impact-dot { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: auto; }
.impact-high { background: var(--bad-bg); color: var(--bad); }
.impact-medium { background: var(--warn-bg); color: var(--warn); }
.impact-low { background: #eef1f6; color: var(--muted); }

/* Category detail blocks */
.cat-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.cat-block > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; background: #fbfcfe; border-bottom: 1px solid var(--line); }
.cat-block > header h3 { font-size: 16px; color: var(--navy); }
.cat-block > header .cscore { font-weight: 800; font-size: 15px; }
.cat-block .items { padding: 8px 22px 16px; }
.line-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f3f8; }
.line-item:last-child { border-bottom: none; }
.line-item .st { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; margin-top: 2px; }
.st.pass { background: var(--good); }
.st.warn { background: var(--warn); }
.st.fail { background: var(--bad); }
.st.info { background: #9aa8c2; }
.line-item .body b { font-size: 14.5px; color: var(--ink); display: block; }
.line-item .body span { font-size: 13.5px; color: var(--muted); }

/* CTA block */
.promo {
  background: linear-gradient(160deg, #041033, #0a2a7a 70%, #0156fc);
  color: #fff; border-radius: 20px; padding: 44px; margin-top: 40px; text-align: center;
  box-shadow: var(--shadow-lg);
}
.promo img { height: 32px; filter: brightness(0) invert(1); margin-bottom: 18px; }
.promo h2 { font-size: 30px; margin-bottom: 12px; letter-spacing: -.5px; }
.promo p { color: #c7d6f5; font-size: 17px; max-width: 620px; margin: 0 auto 14px; }
.promo .benefits { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 22px 0 28px; }
.promo .benefit { background: rgba(255,255,255,.1); padding: 10px 16px; border-radius: 10px; font-size: 14px; }
.promo .cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-white { background: #fff; color: var(--brand); }
.btn-white:hover { background: #eef2ff; }
.btn-ghost { background: transparent; border: 1.5px solid rgba(255,255,255,.5); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }

.report-actions { display: flex; gap: 12px; justify-content: flex-end; margin-bottom: 20px; flex-wrap: wrap; }
.btn-outline { background: #fff; color: var(--brand); border: 1.5px solid var(--brand); }
.btn-outline:hover { background: var(--brand-tint); }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0 50px; }
.footer a { font-weight: 600; }

/* ---------- Modal (email gate) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(4, 16, 51, .6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 20px; max-width: 460px; width: 100%; padding: 34px;
  box-shadow: var(--shadow-lg); position: relative;
}
.modal img.mlogo { height: 28px; margin-bottom: 18px; }
.modal h2 { font-size: 24px; color: var(--navy); margin-bottom: 8px; }
.modal p.msub { color: var(--muted); font-size: 15px; margin-bottom: 20px; }
.modal .field { margin-bottom: 14px; }
.modal label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.modal input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-size: 15px; font-family: var(--font); outline: none; transition: border-color .2s;
}
.modal input:focus { border-color: var(--brand); }
.modal .btn { width: 100%; margin-top: 6px; }
.modal .fine { font-size: 12px; color: var(--muted); margin-top: 14px; text-align: center; }
.modal .lock-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-tint); color: var(--brand); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; margin-bottom: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero h1 { font-size: 34px; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  .cat-scores { grid-template-columns: 1fr; }
  .audit-form { flex-direction: column; }
  .report-head { flex-direction: column; text-align: center; }
}

/* ---------- Print / PDF ---------- */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .topbar, .report-actions, .audit-form, .hero, .features, .rm-about, .how, .faq, .loading { display: none !important; }
  body { background: #fff; }
  .report { padding: 0; }
  /* Chrome's PDF renderer drops multi-stop gradients: use solid brand colors. */
  .report-head { background: #0a1f5c !important; box-shadow: none; }
  .promo { background: #0a1f5c !important; box-shadow: none; break-inside: avoid; }
  .promo .benefit { background: rgba(255, 255, 255, .16) !important; }
  .promo p { color: #dbe6fb !important; }
  .cat-block, .issue, .scard, .cat-row { box-shadow: none; break-inside: avoid; }
  .section-title { break-after: avoid; }
  /* The PDF always contains the full pages table, never the collapsed view. */
  .pg-extra { display: table-row !important; }
  #show-all-pages { display: none !important; }
}
