/* DWIS Quarterly Business Checkup. Brand: always dark, coral accent, Inter + Playfair italic accents. */
:root {
  --bg: #0A0A0A;
  --card: #141414;
  --raised: #1A1A1A;
  --line: #2A2A2A;
  --text: #FFFFFF;
  --soft: #B3B3B3;
  --muted: #777777;
  --coral: #F14F44;
  --coral-dark: #D44A35;
  --glow: rgba(232, 85, 63, 0.16);
  --ok: #4ADE80;
  --radius: 12px;
  --serif: "Playfair Display", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 85% -10%, var(--glow), transparent 60%),
    radial-gradient(700px 400px at -10% 110%, rgba(232, 85, 63, 0.07), transparent 60%),
    var(--bg);
}

.shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 20px 16px 40px; }
.topbar { width: 100%; max-width: 640px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 5px; font-weight: 800; font-size: 15px; letter-spacing: -0.01em; color: var(--text); }
.brand em { font-style: normal; background: var(--coral); color: #fff; padding: 1px 9px 2px 7px; border-radius: 4px 9px 4px 9px; transform: skewX(-8deg); display: inline-block; }
.step-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.progress { width: 100%; max-width: 640px; height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 22px; }
.progress span { display: block; height: 100%; width: 100%; background: var(--coral); border-radius: 4px; transform-origin: left center; transition: transform 300ms ease; }

.card {
  width: 100%; max-width: 640px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: rise 260ms ease both;
}
.card.center { display: flex; justify-content: center; padding: 60px 28px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } .progress span { transition: none; } }

.eyebrow { color: var(--coral); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; margin: 0 0 14px; }
h1 { font-size: clamp(30px, 6vw, 42px); line-height: 1.1; margin: 0 0 16px; font-weight: 800; letter-spacing: -0.02em; }
h1 .accent, h2 .accent { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--coral); letter-spacing: 0; }
h2 { font-size: clamp(22px, 4.6vw, 28px); line-height: 1.25; margin: 0 0 10px; font-weight: 700; letter-spacing: -0.01em; outline: none; }
p { margin: 0 0 14px; color: var(--soft); }
.lead { font-size: 17px; color: #D9D9D9; }
.hint { font-size: 14px; color: var(--muted); margin: 0 0 20px; }
.req { color: var(--coral); font-size: 13px; font-weight: 600; margin-left: 4px; white-space: nowrap; }

.signoff { display: flex; align-items: center; gap: 12px; margin: 22px 0 4px; }
.signoff .avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--glow); border: 1px solid rgba(241, 79, 68, 0.45); color: var(--coral); font-family: var(--serif); font-style: italic; font-size: 22px; }
.signoff b { display: block; color: var(--text); font-size: 15px; }
.signoff small { color: var(--muted); font-size: 13px; }

.promises { background: linear-gradient(180deg, rgba(232, 85, 63, 0.08), rgba(232, 85, 63, 0.02)); border: 1px solid rgba(241, 79, 68, 0.28); border-radius: var(--radius); padding: 18px 18px 8px; margin: 22px 0 6px; }
.promises h3 { margin: 0 0 4px; font-size: 15px; color: var(--text); }
.promises .sub { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.promises ul { list-style: none; padding: 0; margin: 0; }
.promises li { display: flex; gap: 10px; margin: 0 0 10px; color: #D9D9D9; font-size: 15px; }
.promises li::before { content: "✓"; color: var(--ok); font-weight: 700; }

/* Scales */
.scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; margin: 8px 0 8px; }
.scale.ten { grid-template-columns: repeat(10, 1fr); }
.scale-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.opt {
  appearance: none; border: 1px solid var(--line); background: var(--raised); color: var(--text);
  border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; min-height: 48px;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}
.opt:hover { border-color: #444; }
.opt:active { transform: scale(0.97); }
.opt:focus-visible, .btn:focus-visible, .chip:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }
.opt[aria-checked="true"] { background: var(--coral); border-color: var(--coral); color: #fff; box-shadow: 0 0 0 4px var(--glow); }
@media (max-width: 520px) {
  .scale { grid-template-columns: repeat(6, 1fr); }
  .scale.ten { grid-template-columns: repeat(5, 1fr); }
}

.labelled { display: grid; gap: 8px; }
.labelled .opt { text-align: left; padding: 12px 16px; display: flex; align-items: center; gap: 12px; font-weight: 500; }
.labelled .opt .n { width: 26px; height: 26px; border-radius: 7px; background: #262626; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex: none; }
.labelled .opt[aria-checked="true"] .n { background: rgba(255, 255, 255, 0.22); }

.matrix { display: grid; gap: 14px; margin-top: 4px; }
.matrix-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.matrix-row .label { color: #E6E6E6; font-weight: 500; font-size: 15px; }
.matrix-row .scale { grid-template-columns: repeat(5, 44px); margin: 0; }
.matrix-row .opt { min-height: 44px; }
@media (max-width: 520px) {
  .matrix-row { grid-template-columns: 1fr; gap: 6px; }
  .matrix-row .scale { grid-template-columns: repeat(5, 1fr); }
}

/* Score reasons */
.reason { margin-top: 16px; }
.reason-label { display: block; color: #E6E6E6; font-weight: 600; font-size: 14px; }
.reason-label input { margin-top: 8px; }
.reason-hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.matrix-row .reason { grid-column: 1 / -1; margin-top: 2px; }
.matrix { gap: 18px; }

/* Text */
textarea, input[type="text"] {
  width: 100%; background: var(--raised); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; font: inherit; font-size: 16px; resize: vertical;
}
textarea { min-height: 130px; }
textarea::placeholder, input::placeholder { color: #5f5f5f; }
.counter { text-align: right; color: var(--muted); font-size: 12px; margin-top: 6px; }

.chips-label { color: #E6E6E6; font-weight: 600; font-size: 14px; margin: 18px 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  appearance: none; border: 1px solid var(--line); background: var(--raised); color: #E6E6E6; font: inherit; font-size: 14px;
  padding: 9px 14px; border-radius: 999px; cursor: pointer; transition: background 120ms ease, border-color 120ms ease;
}
.chip[aria-pressed="true"] { background: var(--glow); border-color: var(--coral); color: #fff; }

/* Buttons */
.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; }
.btn {
  appearance: none; border: 0; background: var(--coral); color: #fff; font: inherit; font-weight: 700; font-size: 16px;
  padding: 14px 26px; border-radius: 10px; cursor: pointer; min-height: 50px; transition: background 120ms ease, opacity 120ms ease;
}
.btn:hover { background: var(--coral-dark); }
.btn[disabled] { opacity: 0.35; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--soft); padding: 14px 6px; font-weight: 600; }
.btn.ghost:hover { color: var(--text); background: transparent; }
.btn.secondary { background: var(--raised); border: 1px solid var(--line); color: var(--text); }
.time-note { color: var(--muted); font-size: 13px; }

.error { color: #FCA5A5; background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.3); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-top: 18px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--coral); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.footer { color: #4d4d4d; font-size: 12px; margin-top: 22px; text-align: center; }

@media (max-width: 520px) {
  .card { padding: 26px 18px; border-radius: 14px; }
  .actions { margin-top: 24px; }
}
