/* Top Level App — palette matches RenoCalc */
:root {
  --navy: #1A237E;
  --navy-dark: #0d1657;
  --gold: #FFC107;
  --gold-dark: #d49e00;
  --white: #FFFFFF;
  --grey-bg: #f6f7fb;
  --grey-line: #e2e5ee;
  --text: #212121;
  --text-muted: #5a5f72;
  --green: #2e7d32;
  --amber: #ed6c02;
  --red: #c62828;
  --radius: 12px;
  --shadow: 0 6px 24px rgba(26, 35, 126, 0.08);
  --shadow-lg: 0 12px 40px rgba(26, 35, 126, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.55;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 24px; }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

a { color: var(--navy); }
a:hover { color: var(--navy-dark); }

/* HEADER */
.site-header {
  background: var(--navy);
  color: var(--white);
  padding: 18px 0;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  background: var(--gold);
  color: var(--navy);
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 14px;
  letter-spacing: 1px;
}
.brand-name { font-weight: 700; font-size: 18px; }

/* HERO */
.hero {
  background: linear-gradient(180deg, var(--white) 0%, var(--grey-bg) 100%);
  padding: 72px 0 88px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--navy);
  font-weight: 800;
}
.accent { color: var(--gold-dark); }
.lede {
  font-size: clamp(18px, 2.2vw, 21px);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 32px;
}

.check-form {
  display: flex;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.check-form input[type="url"] {
  flex: 1 1 280px;
  padding: 16px 18px;
  font-size: 17px;
  border: 2px solid var(--grey-line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
}
.check-form input[type="url"]:focus { border-color: var(--navy); }
.check-form button {
  padding: 16px 28px;
  font-size: 17px;
  font-weight: 700;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.check-form button:hover { background: var(--navy-dark); }
.check-form button:active { transform: translateY(1px); }
.check-form button:disabled { opacity: 0.6; cursor: not-allowed; }

.hero-foot {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

/* LOADING */
.loading {
  padding: 80px 0;
  text-align: center;
}
.loading h2 {
  font-size: 24px;
  color: var(--navy);
  margin: 24px 0;
}
.spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto;
  border: 5px solid var(--grey-line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-steps {
  list-style: none;
  padding: 0;
  max-width: 380px;
  margin: 24px auto 0;
  text-align: left;
}
.loading-steps li {
  padding: 8px 0 8px 32px;
  position: relative;
  color: var(--text-muted);
}
.loading-steps li::before {
  content: "◯";
  position: absolute;
  left: 0;
  color: var(--grey-line);
}
.loading-steps li.done { color: var(--text); }
.loading-steps li.done::before { content: "✓"; color: var(--green); }
.loading-steps li.active { color: var(--navy); font-weight: 600; }
.loading-steps li.active::before { content: "●"; color: var(--gold); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* RESULTS */
.results { padding: 64px 0; }

.score-card {
  display: flex;
  gap: 32px;
  align-items: center;
  padding: 32px;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
}
.score-ring {
  flex: 0 0 auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: baseline;
  justify-content: center;
  font-weight: 800;
  border: 6px solid var(--gold);
}
.score-number { font-size: 64px; line-height: 1; }
.score-suffix { font-size: 18px; opacity: 0.7; margin-left: 4px; }
.score-summary { flex: 1; min-width: 220px; }
.score-summary h2 { margin: 0 0 8px; color: var(--navy); font-size: 24px; }
#score-verdict { margin: 0; font-size: 18px; color: var(--text); }

.results-subhead {
  margin: 48px 0 16px;
  color: var(--navy);
  font-size: 22px;
}
.breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cat {
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--white);
  transition: box-shadow 0.15s;
}
.cat:hover { box-shadow: var(--shadow); }
.cat-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.cat-name { font-weight: 700; color: var(--navy); font-size: 17px; }
.cat-score { font-weight: 700; font-size: 16px; }
.cat-bar {
  height: 8px;
  background: var(--grey-line);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0 12px;
}
.cat-bar-fill { height: 100%; background: var(--gold); transition: width 0.5s; }
.cat-note { margin: 0; color: var(--text-muted); font-size: 15px; }

.status-green { color: var(--green); }
.status-amber { color: var(--amber); }
.status-red { color: var(--red); }

.cta-block {
  margin-top: 48px;
  padding: 32px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  text-align: center;
}
.cta-block h3 { margin: 0 0 12px; font-size: 28px; color: var(--gold); }
.cta-block p { margin: 0 auto 20px; max-width: 540px; }
.cta-btn {
  background: var(--gold);
  color: var(--navy);
  border: none;
  padding: 16px 32px;
  font-size: 17px;
  font-weight: 800;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.cta-btn:hover { background: var(--gold-dark); }
.cta-btn:active { transform: translateY(1px); }

/* LEAD FORM */
.lead { padding: 64px 0; background: var(--grey-bg); }
.lead h2 { color: var(--navy); font-size: 28px; margin: 0 0 12px; }
.lead-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 520px;
  margin-top: 24px;
}
.lead-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  color: var(--navy);
}
.lead-form input[type="text"],
.lead-form input[type="email"],
.lead-form input[type="tel"] {
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid var(--grey-line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
}
.lead-form input:focus { border-color: var(--navy); }
.lead-form small { font-weight: 400; color: var(--text-muted); }
.consent {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  color: var(--text);
  font-size: 15px;
}
.consent input { margin-top: 4px; }

/* SCAM WARNING */
.scam-warning {
  margin-top: 40px;
  padding: 24px;
  background: var(--white);
  border-left: 6px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.scam-warning h3 { margin: 0 0 12px; color: var(--navy); font-size: 18px; }
.scam-warning ul { margin: 0 0 12px; padding-left: 20px; }
.scam-warning li { margin: 6px 0; color: var(--text); }
.scam-warning strong { color: var(--navy-dark); }
.scam-foot { margin: 0; color: var(--text-muted); font-style: italic; }

/* THANKS */
.thanks { padding: 80px 0; }
.thanks-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px;
  background: var(--white);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.thanks-card h2 { color: var(--navy); font-size: 32px; margin: 0 0 12px; }
.thanks-reminders {
  text-align: left;
  margin: 16px auto 0;
  display: inline-block;
}

/* FOOTER */
.site-footer {
  background: var(--navy-dark);
  color: var(--white);
  padding: 32px 0;
  margin-top: 64px;
  text-align: center;
}
.site-footer p { margin: 6px 0; opacity: 0.85; font-size: 15px; }
.site-footer a { color: var(--gold); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* DEMO BANNER */
#demo-banner {
  background: #FFF8DC;
  border: 1px solid var(--gold);
  color: var(--navy);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.5;
}
#demo-banner code {
  background: rgba(26,35,126,0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
}

/* RESULTS TITLE + EXPLAINER */
.results-title { font-size: 28px; color: var(--navy); margin: 0 0 24px; }
.results-title span { color: var(--gold-dark); }
.results-explain { color: var(--text-muted); margin: 0 0 20px; max-width: 720px; }

/* KPI CARDS */
.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 40px;
}
.kpi {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
  margin-bottom: 4px;
}
.kpi-label { font-size: 14px; font-weight: 600; color: var(--text); }
.kpi-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* KEYWORD TABLE */
.kw-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  margin-bottom: 40px;
  background: var(--white);
  box-shadow: var(--shadow);
}
.kw-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}
.kw-table th,
.kw-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--grey-line);
  font-size: 15px;
}
.kw-table th {
  background: var(--grey-bg);
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kw-table tbody tr:last-child td { border-bottom: 0; }
.kw-table tbody tr:hover { background: rgba(255, 193, 7, 0.05); }
.kw-name { font-weight: 600; color: var(--text); }
.kw-sources { white-space: nowrap; }
.kw-empty { text-align: center; color: var(--text-muted); padding: 32px 16px !important; }

.chip {
  display: inline-block;
  background: var(--grey-bg);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  margin-right: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.status-grey { color: var(--text-muted); font-weight: 600; }

/* ACTION PLAN */
.plan {
  counter-reset: planc;
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
}
.plan-item {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  padding: 18px 20px 18px 64px;
  margin-bottom: 12px;
  position: relative;
  counter-increment: planc;
  box-shadow: var(--shadow);
}
.plan-item::before {
  content: counter(planc);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 32px;
  height: 32px;
  background: var(--navy);
  color: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
}
.plan-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.plan-title { font-weight: 700; color: var(--navy); font-size: 16px; flex: 1; min-width: 0; }
.plan-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lift {
  background: var(--gold);
  color: var(--navy);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
}
.effort {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.effort-low    { background: #e8f5e9; color: var(--green); }
.effort-medium { background: #fff3e0; color: var(--amber); }
.effort-high   { background: #ffebee; color: var(--red); }
.plan-details { color: var(--text); font-size: 15px; line-height: 1.5; margin-bottom: 6px; }
.plan-cat { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

/* TECHNICAL AUDIT (collapsible) */
.technical-audit {
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}
.technical-audit summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--navy);
  font-size: 17px;
  padding: 4px 0;
  list-style-position: outside;
}
.technical-audit summary:hover { color: var(--navy-dark); }
.technical-audit[open] summary { margin-bottom: 16px; }
.technical-audit #tech-score { color: var(--gold-dark); }

/* MOBILE */
@media (max-width: 600px) {
  .hero { padding: 48px 0 64px; }
  .check-form button { width: 100%; }
  .score-card { gap: 20px; padding: 24px; }
  .score-ring { width: 130px; height: 130px; }
  .score-number { font-size: 52px; }
  .kpi-value { font-size: 26px; }
  .plan-item { padding-left: 56px; }
  .plan-item::before { left: 14px; top: 16px; width: 28px; height: 28px; font-size: 13px; }
}
