/* ===========================================================
   K Bedford Consulting — AI Adoption Assessment
   Mobile-first. Brand colors and fonts per the Build Requirements doc.
   =========================================================== */

:root {
  --teal: #36a3b0;
  --teal-soft: rgba(54, 163, 176, 0.12);
  --teal-border: rgba(54, 163, 176, 0.35);
  --magenta: #d73bd8;
  --warm-gray: #6d7473;
  --light-gray: #c7c7c7;
  --bg: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #3a3a3a;

  --heading: 'Josefin Sans', system-ui, sans-serif;
  --body: 'Lato', system-ui, sans-serif;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); }

h1, h2, h3, h4 {
  font-family: var(--heading);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.6em 0;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em 0; color: var(--ink-soft); }

/* ---------- Layout ---------- */

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 48px 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand-mark {
  display: inline-flex;
  justify-content: center;
}

.screen-container {
  flex: 1;
  padding: 28px 0 32px 0;
}

.brand-footer {
  border-top: 1px solid #f0f0f0;
  padding-top: 22px;
  padding-bottom: 8px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--warm-gray);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.brand-footer .tagline {
  font-style: italic;
  color: var(--warm-gray);
  font-size: 0.8rem;
  margin: 0;
}

.brand-footer .brand-mark img {
  display: block;
}

/* ---------- Buttons ---------- */

.btn {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 14px 28px;
  border-radius: var(--radius);
  border: 2px solid var(--teal);
  background: var(--teal);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.05s;
  -webkit-appearance: none;
  appearance: none;
}

.btn:hover { background: #2e8e99; border-color: #2e8e99; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--teal);
}
.btn-secondary:hover { background: var(--teal-soft); color: var(--teal); }

.btn-ghost {
  background: transparent;
  color: var(--warm-gray);
  border-color: transparent;
  font-weight: 400;
}
.btn-ghost:hover { color: var(--ink); background: transparent; }

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
  align-items: center;
}

/* ---------- Form fields ---------- */

label {
  display: block;
  font-family: var(--heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  font-family: var(--body);
  font-size: 1rem;
  padding: 12px 14px;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  margin-bottom: 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

textarea { resize: vertical; min-height: 88px; }

.field-help {
  font-size: 0.85rem;
  color: var(--warm-gray);
  margin-top: -10px;
  margin-bottom: 16px;
}

/* ---------- Screen 1: Landing ---------- */

.landing {
  text-align: left;
  padding: 12px 0;
}

.landing .eyebrow {
  font-family: var(--heading);
  font-size: 1.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 18px;
  line-height: 1.1;
}

.landing h1 {
  font-family: var(--body);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: 0;
  color: var(--teal);
}

.landing .lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.landing .meta {
  font-size: 0.9rem;
  color: var(--warm-gray);
  margin: 18px 0 28px 0;
}

/* ---------- Screen 2: Context ---------- */

.context-screen .skip-note {
  font-size: 0.9rem;
  color: var(--warm-gray);
  margin-bottom: 26px;
}

.size-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.size-option {
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: center;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}

.size-option:hover { border-color: var(--teal); }

.size-option.selected {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 600;
}

/* ---------- Screen 3: Self-scoring ---------- */

.progress-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.progress-track {
  flex: 1;
  height: 4px;
  background: #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--teal);
  transition: width 0.3s;
}

.progress-label {
  font-family: var(--heading);
  font-size: 0.85rem;
  color: var(--warm-gray);
  font-weight: 500;
  white-space: nowrap;
}

.dimension-name {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.dimension-desc {
  font-size: 0.95rem;
  color: var(--warm-gray);
  margin-bottom: 18px;
}

.scoring-instruction {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--teal);
  border-left: 4px solid var(--teal);
  padding: 10px 14px;
  margin: 0 0 18px 0;
  background: var(--teal-soft);
  border-radius: 0 6px 6px 0;
  line-height: 1.45;
}

.level-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.level-card {
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.level-card:hover { border-color: var(--teal); }

.level-card.selected {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: var(--shadow);
}

.level-card-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.level-num {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--teal);
  min-width: 18px;
}

.level-name {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.level-text {
  font-size: 0.93rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* ---------- Screen 4: Result ---------- */

.result-screen { padding-bottom: 16px; }

.result-eyebrow {
  font-family: var(--heading);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--teal);
  margin-bottom: 8px;
}

.result-band {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 2.2rem;
  color: var(--ink);
  margin: 0 0 6px 0;
  line-height: 1.1;
}

.result-band-desc {
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

.three-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 22px 0;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  padding: 16px 0;
}

/* Single-cell variant — used on the result screen now that raw + range
   are hidden. The cell fills the row and the value/label stay larger. */
.three-numbers.single-number {
  grid-template-columns: 1fr;
}

.three-numbers.single-number .number-cell .label {
  font-size: 0.8rem;
}

.three-numbers.single-number .number-cell .value {
  font-size: 2.4rem;
}

.number-cell {
  text-align: center;
  position: relative;
  cursor: help;
  padding: 6px 4px;
  border-radius: 6px;
  outline: none;
  transition: background 0.15s;
}

.number-cell:hover,
.number-cell:focus-visible,
.number-cell.open { background: #fafafa; }

.number-cell .label {
  display: block;
  font-family: var(--heading);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--warm-gray);
  margin-bottom: 4px;
}

.number-cell .info-icon {
  display: inline-block;
  color: var(--teal);
  font-size: 0.85em;
  margin-left: 2px;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.number-cell:hover .info-icon,
.number-cell.open .info-icon { opacity: 1; }

.number-cell .value {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.6rem;
  color: var(--ink);
}

.number-cell .value-meta {
  font-family: var(--heading);
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--warm-gray);
  margin-left: 1px;
}

.number-cell .tooltip {
  display: none;
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  background: #1a1a1a;
  color: #fff;
  font-size: 0.82rem;
  font-family: var(--body);
  line-height: 1.4;
  padding: 10px 12px;
  border-radius: 6px;
  width: 220px;
  max-width: 80vw;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
  pointer-events: none;
}

.number-cell .tooltip::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: #1a1a1a;
}

.number-cell:hover .tooltip,
.number-cell:focus-visible .tooltip,
.number-cell.open .tooltip { display: block; }

/* Edge-cell tooltips: keep them inside the viewport on mobile */
.number-cell:first-child .tooltip { left: 0; transform: none; }
.number-cell:first-child .tooltip::before { left: 28px; transform: rotate(45deg); }
.number-cell:last-child .tooltip { left: auto; right: 0; transform: none; }
.number-cell:last-child .tooltip::before { left: auto; right: 28px; transform: rotate(45deg); }

/* ---------- Band ladder ("you are here") ---------- */

.band-ladder {
  margin: 26px 0 18px 0;
  padding: 18px 4px 14px 4px;
}

.ladder-track {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  position: relative;
}

/* Connecting line behind the dots */
.ladder-track::before {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 8px;
  height: 2px;
  background: #e6e6e6;
  z-index: 0;
}

.ladder-step {
  position: relative;
  text-align: center;
  z-index: 1;
  padding-top: 0;
}

.ladder-dot {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--light-gray);
  margin: 0 auto 8px auto;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.ladder-step.active .ladder-dot {
  background: var(--teal);
  border-color: var(--teal);
  transform: scale(1.35);
  box-shadow: 0 0 0 4px var(--teal-soft);
}

.ladder-name {
  display: block;
  font-family: var(--heading);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--warm-gray);
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-bottom: 2px;
  word-break: break-word;
  hyphens: auto;
}

.ladder-step.active .ladder-name { color: var(--teal); }

.ladder-range {
  display: block;
  font-family: var(--body);
  font-size: 0.7rem;
  color: var(--warm-gray);
}

.ladder-step.active .ladder-range {
  color: var(--ink-soft);
  font-weight: 700;
}

.you-are-here {
  display: block;
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--heading);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--magenta);
  font-weight: 700;
  white-space: nowrap;
}

.you-are-here::after {
  content: '▼';
  display: block;
  margin-top: 1px;
  color: var(--magenta);
  font-size: 0.7rem;
  line-height: 1;
}

.cap-note {
  background: #fafafa;
  border-left: 3px solid var(--magenta);
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0 0 22px 0;
  border-radius: 4px;
}

.radar-wrap {
  margin: 18px 0 26px 0;
  padding: 12px;
  background: #fafafa;
  border-radius: var(--radius);
}

.radar-wrap canvas {
  max-width: 100%;
  height: auto !important;
}

.what-this-means {
  margin-bottom: 26px;
}

.what-this-means h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  margin-bottom: 10px;
}

/* Email gate + Team Diagnostic placeholder cards (visible on result screen) */

.gate-card, .upsell-card {
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  background: #fff;
}

.gate-card {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.gate-card h3 {
  color: var(--teal);
  margin-bottom: 8px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gate-card p { font-size: 0.95rem; }

.upsell-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.upsell-card .small {
  font-size: 0.85rem;
  color: var(--warm-gray);
}

.placeholder-note {
  display: inline-block;
  font-size: 0.75rem;
  background: #f5f5f5;
  color: var(--warm-gray);
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 8px;
  font-family: var(--body);
  letter-spacing: 0.04em;
}

/* Email gate form (within gate-card) */

.gate-card label {
  margin-top: 6px;
  font-size: 0.85rem;
}

.gate-card input[type="text"],
.gate-card input[type="email"] {
  margin-bottom: 12px;
}

.gate-card .consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-family: var(--body);
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin: 6px 0 16px 0;
  cursor: pointer;
  line-height: 1.4;
}

.gate-card .consent-row input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--teal);
  cursor: pointer;
}

.gate-card .consent-row span {
  flex: 1;
}

.gate-card .gate-error {
  background: #fff4f4;
  border-left: 3px solid #c63b3b;
  padding: 10px 12px;
  font-size: 0.88rem;
  color: #842020;
  border-radius: 0 4px 4px 0;
  margin: 0 0 12px 0;
}

.gate-card.gate-success {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.gate-card.gate-success h3 {
  color: var(--teal);
}

.gate-card.gate-success p { color: var(--ink-soft); }

.gate-card .small {
  font-size: 0.85rem;
  color: var(--warm-gray);
  margin-top: 8px;
}

.restart-row {
  text-align: center;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #f0f0f0;
}

/* ---------- Responsive ---------- */

@media (min-width: 600px) {
  .app { padding: 32px 32px 56px 32px; }
  h1 { font-size: 2rem; }
  .landing h1 { font-size: 1.8rem; }
  .size-options { grid-template-columns: repeat(3, 1fr); }
  .three-numbers { gap: 24px; }
  .number-cell .value { font-size: 1.9rem; }
  .result-band { font-size: 2.6rem; }
}

@media (max-width: 374px) {
  .app { padding: 16px 14px 36px 14px; }
  .landing h1 { font-size: 1.2rem; }
  .result-band { font-size: 1.8rem; }
}

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