/* ---------------------------------------------------------------------------
   Lotus Launch — index.css
   Plain CSS, no build step. Custom properties drive the theme.
--------------------------------------------------------------------------- */

:root {
  --bg: #f7f8fb;
  --bg-alt: #eef1f7;
  --surface: #ffffff;
  --ink: #1c2333;
  --ink-soft: #4a5468;
  --accent: #0f766e;
  --accent-strong: #0d5f58;
  --accent-soft: #ccfbf1;
  --border: #dfe4ee;
  --success: #15803d;
  --success-bg: #dcfce7;
  --busy: #92400e;
  --busy-bg: #fef3c7;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(28, 35, 51, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(1040px, 92%);
  margin-inline: auto;
}

.container.narrow {
  width: min(680px, 92%);
}

code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas,
    monospace;
  font-size: 0.9em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

/* ----- Header ----------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 248, 251, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.brand-mark {
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent-strong);
}

/* ----- Hero ------------------------------------------------------------- */

.hero {
  padding: 5.5rem 0 4.5rem;
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--accent-soft) 0%, transparent 60%),
    var(--bg);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-strong);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.15;
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 52ch;
  margin: 0;
}

/* ----- Sections --------------------------------------------------------- */

.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
}

.section h2 {
  font-size: 1.8rem;
  margin: 0 0 1rem;
}

.section p {
  color: var(--ink-soft);
  max-width: 68ch;
}

/* ----- Cards ------------------------------------------------------------ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

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

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

.lead-form {
  margin: 1.75rem 0 0.5rem;
}

.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.7rem 2.2rem;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease,
    box-shadow 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.3);
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible {
  background: var(--accent-strong);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.38);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.65;
  cursor: progress;
}

/* The export button (class "export") sits next to the submit button: a
   secondary, outlined look. */
.lead-form .btn + .btn {
  margin-left: 0.75rem;
}

.export {
  background: var(--surface);
  color: var(--accent-strong);
  border-color: var(--accent);
}

.export:hover,
.export:focus-visible {
  background: var(--accent-soft);
}

.form-status {
  min-height: 1.6em;
  margin: 0.75rem 0 0;
  font-weight: 500;
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
}

.form-status.is-busy {
  color: var(--busy);
  background: var(--busy-bg);
}

.form-status.is-success {
  color: var(--success);
  background: var(--success-bg);
}

/* ----- Questions (built by common/*.js) ----------------------------------- */

.lead-form .q {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem 1.25rem;
  margin: 0 0 1rem;
}

.q-title {
  font-weight: 600;
  padding: 0 0.35rem;
}

/* The "n." index a question's title carries in its form's order (built
   by common/Question.js, kept in sync by numberQuestions). */
.q-index {
  color: var(--accent-strong);
  white-space: nowrap;
}

/* The per-question config panel (built by Question.createConfigPanel):
   a slim row under the question body with the "Required" checkbox — and,
   for questions with an options list, extra checkboxes: a "Select"
   checkbox (class "q-select") on single-selection questions and a
   "Shuffle" checkbox (class "q-shuffle") on the single-selection,
   multi-selection, and ranking questions. */
.q-config {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}

.q-config input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.q-config label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.q-body label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  color: var(--ink-soft);
  cursor: pointer;
}

.q-body input[type="text"],
.q-body select,
.q-body textarea {
  width: 100%;
  margin-top: 0.25rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

.q-body input[type="text"]:focus,
.q-body select:focus,
.q-body textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.q-body textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.q-body .star {
  display: inline-block;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.1rem 0.08rem;
  color: #c3cad8;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, transform 0.15s ease;
}

.q-body .star:hover {
  transform: scale(1.15);
}

.q-body .star.active {
  color: #f59e0b;
}

/* NPS score cell: the label is the visible box; the radio input
   (class "score") fills it, so clicking the cell picks the score and the
   checked state drives the highlight. */
.q-body .score-cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0.15rem 0.12rem 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, transform 0.15s ease;
}

.q-body .score-cell:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.q-body .score {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.q-body .score-cell:has(.score:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.q-body .score-cell:has(.score:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.q-body .likert-table {
  width: 100%;
  margin-top: 0.35rem;
  border-collapse: collapse;
}

.q-body .likert-table th,
.q-body .likert-table td {
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  vertical-align: middle;
}

.q-body .likert-table thead th {
  background: var(--bg);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

.q-body .likert-table thead th:first-child {
  width: 1.5em;
}

.q-body .likert-table tbody th {
  background: var(--bg);
  color: var(--ink-soft);
  font-weight: 500;
  text-align: left;
}

.q-body .likert-table tbody td {
  text-align: center;
}

.q-body .likert-table input[type="radio"] {
  margin: 0;
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.q-body .ranking-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.q-body .ranking-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink-soft);
  font-weight: 500;
  cursor: grab;
  user-select: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    opacity 0.15s ease;
}

.q-body .ranking-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.q-body .ranking-item.is-dragging {
  opacity: 0.5;
  border-style: dashed;
  cursor: grabbing;
}

.q-body .ranking-grip {
  color: #c3cad8;
  font-size: 1.05rem;
  line-height: 1;
}

/* ----- Contents panel (built by common/Contents.js) ------------------------- */

/* Hidden on small screens; shown (and space reserved) from 720px up, so the
   fixed panel never covers the question content. */
.contents {
  display: none;
  position: fixed;
  top: 50%;
  right: 1.25rem;
  transform: translateY(-50%);
  width: 250px;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.15rem;
  z-index: 20;
}

.contents-heading {
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
}

.contents-item {
  display: block;
  margin: 0.12rem 0;
  padding: 0.32rem 0.55rem;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.4;
  text-decoration: none;
  cursor: grab;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.contents-item:hover,
.contents-item:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
}

/* The item currently being dragged: it stays in the list at its preview
   position while the browser draws the drag image. */
.contents-item.is-dragging {
  opacity: 0.5;
  background: var(--accent-soft);
  cursor: grabbing;
}

/* Keep question tops clear of the sticky header when scrolled to. */
.q {
  scroll-margin-top: 5.5rem;
}

@media (min-width: 720px) {
  .contents {
    display: block;
  }

  /* Reserve room for the fixed contents panel so it can never cover the
     question content in the narrow "get started" container. */
  #get-started {
    padding-right: 300px;
  }
}

/* ----- Footer ------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-inner p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.to-top {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
}

.to-top:hover,
.to-top:focus-visible {
  text-decoration: underline;
}

/* ----- Scroll reveal (toggled by index.js) -------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn,
  .site-nav a {
    transition: none;
  }
}

/* ----- Small screens -------------------------------------------------------- */

@media (max-width: 560px) {
  .header-inner {
    flex-direction: column;
    gap: 0.5rem;
  }

  .hero {
    padding: 3.5rem 0 3rem;
  }

  .section {
    padding: 3rem 0;
  }

  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}
