/* Carbon Potential Profile — shared styles (landing + assessment). No web fonts, no frameworks. */
:root {
  --carbon: #161616;
  --orange: #FC8F00;
  --royal: #0067CE;
  --teal: #24AEBC;
  --steel: #5689C6;
  --darkteal: #22525D;
  --red: #E05F55;
  --grey: #D8D8D8;
  --grey-light: #F3F3F3;
  --muted: #555555;
  --white: #FFFFFF;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  color: var(--carbon);
  background: var(--white);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; }
a { color: var(--royal); }
button { font: inherit; touch-action: manipulation; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; }
p { margin: 0 0 16px; }

:focus-visible { outline: 3px solid var(--royal); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 16px; }
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0;
}
.logo { display: inline-flex; align-items: center; }
.logo img { height: 30px; width: auto; display: block; }
.site-footer {
  margin-top: auto;
  padding: 28px 0 32px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--grey-light);
}
.site-footer p { margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 12px 24px;
  border-radius: var(--radius); border: 2px solid transparent;
  font-weight: 700; font-size: 18px; text-decoration: none;
  cursor: pointer; user-select: none;
}
.btn-primary { background: var(--orange); border-color: var(--orange); color: var(--carbon); }
.btn-primary:hover { background: #e68200; border-color: #e68200; }
.btn-primary[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: default; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: var(--grey); color: var(--carbon); }
.btn-ghost:hover { background: var(--grey-light); }

/* ---------- Landing ---------- */
.hero { text-align: center; padding: 8px 0 24px; }
.hero-atom { width: min(220px, 60vw); margin: 0 auto 18px; }
.hero-atom svg { width: 100%; height: auto; display: block; }
.hero h1 { font-size: clamp(30px, 7vw, 42px); font-weight: 800; margin-bottom: 20px; }
.hero .reassurance { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.intro { padding: 8px 0 24px; border-top: 1px solid var(--grey-light); }
.intro h2 { font-size: 24px; margin-top: 24px; }
.intro p { font-size: 17px; }
.intro .book { font-style: normal; font-weight: 600; }
.back-to-top { font-size: 16px; font-weight: 600; }

@keyframes cpp-orbit { to { transform: rotate(360deg); } }
.hero-atom .shell { transform-origin: 120px 120px; animation: cpp-orbit 60s linear infinite; }

/* ---------- Assessment ---------- */
.a-header { position: sticky; top: 0; background: var(--white); z-index: 5; border-bottom: 1px solid var(--grey-light); }
.a-header .wrap { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.a-header .logo img { height: 26px; }
.a-header .spacer { flex: 1; }
.link-btn {
  background: none; border: 0; padding: 8px 6px; min-height: 44px;
  color: var(--royal); text-decoration: underline; cursor: pointer; font-size: 15px;
}
.pill {
  display: inline-block; font-size: 12.5px; line-height: 1; padding: 7px 10px;
  border-radius: 999px; border: 1px solid var(--grey); color: var(--muted); background: var(--white);
  white-space: nowrap;
}
.pill[data-state="saving"] { border-color: var(--grey); color: var(--muted); }
.pill[data-state="saved"] { border-color: var(--teal); color: var(--darkteal); }
.pill[data-state="offline"] { border-color: var(--red); color: #b3423a; }
.pill[hidden] { display: none; }

main.a-main { flex: 1; display: flex; flex-direction: column; }
.card { padding: 22px 0 32px; }
.card h1 { font-size: 26px; }
.card h2 { font-size: 22px; }
.notice {
  background: var(--grey-light); border-left: 4px solid var(--teal);
  padding: 10px 14px; border-radius: 6px; font-size: 15px; margin: 0 0 18px;
}
.notice.warn { border-left-color: var(--red); }
.notice .link-btn { padding: 0 2px; min-height: 0; font-size: inherit; }
.error { color: #b3423a; font-size: 15px; margin: 10px 0 0; min-height: 1.4em; }

/* Form */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field .opt { font-weight: 400; color: var(--muted); }
.field-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"] {
  width: 100%; min-height: 48px; padding: 10px 12px; font: inherit; font-size: 17px;
  border: 1.5px solid var(--grey); border-radius: 8px; background: var(--white); color: var(--carbon);
}
.field input:focus { border-color: var(--royal); }
.check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; font-size: 15px; cursor: pointer; min-height: 44px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--royal); }
.instructions { font-size: 15px; color: var(--muted); margin: 0 0 22px; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Question */
.q-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.q-top strong { color: var(--carbon); font-weight: 700; }
.progress { height: 6px; background: var(--grey); border-radius: 3px; overflow: hidden; margin-bottom: 28px; }
.progress > i { display: block; height: 100%; width: 0; background: var(--royal); transition: width .2s ease; }
.statement { font-size: 23px; font-weight: 600; line-height: 1.35; margin: 0 0 26px; min-height: 3.6em; }
.scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; list-style: none; padding: 0; margin: 0 0 10px; }
.scale button {
  width: 100%; min-height: 48px; padding: 0;
  border: 1.5px solid var(--grey); border-radius: 8px; background: var(--white); color: var(--carbon);
  font-size: 18px; font-weight: 600; cursor: pointer;
}
.scale button:hover { border-color: var(--royal); }
.scale button.is-selected, .scale button[aria-pressed="true"] { background: var(--royal); border-color: var(--royal); color: var(--white); }
.anchors { display: grid; grid-template-columns: 1fr 1fr 1fr; font-size: 13px; color: var(--muted); margin-bottom: 26px; }
.anchors span:nth-child(2) { text-align: center; }
.anchors span:nth-child(3) { text-align: right; }
@media (max-width: 519px) {
  .scale { grid-template-columns: repeat(5, 1fr); gap: 8px; }
  .scale button { min-height: 52px; }
  /* The ten buttons wrap to 5 + 5 here, so a three-way anchor row would sit under the
     second row and put "Neutral" beneath 8. Tie each end label to its number instead. */
  .anchors { display: flex; justify-content: center; gap: 16px; text-align: center; }
  .anchors span:nth-child(2) { display: none; }
  .anchors span:first-child::before { content: "1 = "; }
  .anchors span:last-child::before { content: "10 = "; }
}
.q-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 8px 12px;
  background: none; border: 1.5px solid var(--grey); border-radius: 8px;
  color: var(--carbon); font-size: 15px; cursor: pointer;
}
.nav-btn:hover { background: var(--grey-light); }
.nav-btn[disabled] { opacity: .35; cursor: default; }
.nav-btn[hidden] { display: none; }
.kbd-hint { font-size: 13px; color: var(--muted); margin-top: 22px; }
@media (hover: none) { .kbd-hint { display: none; } }

/* Finish */
.finish { text-align: center; padding-top: 40px; }
.finish .tick {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  background: var(--teal); color: var(--white); font-size: 34px; font-weight: 800;
}
.finish p { color: var(--muted); }

/* Continue-later panel */
.panel {
  border: 1.5px solid var(--grey); border-radius: var(--radius); padding: 16px; margin: 0 0 20px; background: var(--grey-light);
}
.panel h2 { font-size: 18px; margin-bottom: 8px; }
.panel p { font-size: 15px; margin-bottom: 12px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input {
  flex: 1; min-width: 0; min-height: 44px; padding: 8px 10px; font: inherit; font-size: 15px;
  border: 1.5px solid var(--grey); border-radius: 8px; background: var(--white); color: var(--carbon);
}
.copy-row .btn { min-height: 44px; padding: 8px 16px; font-size: 15px; }
.panel-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.copied { font-size: 14px; color: var(--darkteal); }

.loading { text-align: center; color: var(--muted); padding: 60px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  .hero-atom .shell { animation: none; }
  .progress > i { transition: none; }
  * { scroll-behavior: auto !important; }
}
