:root {
  --bg: #f3eee7;
  --bg-deep: #e8e1d7;
  --surface: rgba(251, 247, 242, 0.9);
  --surface-strong: #fbf7f2;
  --text: #3f3a36;
  --muted: #6f675f;
  --line: rgba(215, 206, 195, 0.92);
  --accent: #b58c7a;
  --accent-strong: #8f6d5f;
  --accent-soft: rgba(181, 140, 122, 0.16);
  --secondary-soft: rgba(184, 192, 178, 0.2);
  --secondary: #b8c0b2;
  --tertiary: #b7c3cf;
  --success: #8f9b8d;
  --shadow: 0 18px 48px rgba(99, 89, 80, 0.12);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(181, 140, 122, 0.12), transparent 32%),
    radial-gradient(circle at bottom right, rgba(183, 195, 207, 0.18), transparent 28%),
    linear-gradient(180deg, #f4f1ec 0%, var(--bg) 56%, var(--bg-deep) 100%);
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.event-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel {
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: var(--radius-xl);
  padding: 36px;
}

.hero-card {
  border-radius: var(--radius-xl);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  line-height: 1.02;
}

h1 {
  font-size: clamp(2.6rem, 5vw, 5.2rem);
  max-width: 10ch;
}

h2 {
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
}

h3 {
  font-size: 1.1rem;
}

.hero-text,
.side-copy,
.side-note,
.result-summary,
.status-text,
.welcome-screen p,
.lead-capture p {
  color: var(--muted);
  line-height: 1.6;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-pills span,
.event-ribbon span,
.card-label,
.option-pill,
.tag {
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--accent-strong);
  font-size: 0.9rem;
  width: fit-content;
}

#host-mode-pill {
  background: rgba(184, 192, 178, 0.28);
  color: #657268;
}

.hero-card ul,
.goal-list,
.result-card ul {
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.app-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}

.panel {
  border-radius: var(--radius-xl);
  padding: 28px;
}

.side-panel {
  display: grid;
  gap: 28px;
  align-content: start;
}

.section-heading {
  margin-bottom: 16px;
}

.hidden {
  display: none;
}

.welcome-screen {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(184, 192, 178, 0.16));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.result-banner {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(181, 140, 122, 0.14), rgba(184, 192, 178, 0.16));
  padding: 16px 18px;
  color: var(--text);
}

.progress-meta,
.form-nav,
.lead-actions,
.operator-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.progress-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.94rem;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(26, 24, 21, 0.08);
  overflow: hidden;
  margin-bottom: 26px;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--secondary));
  border-radius: inherit;
  transition: width 180ms ease;
}

.question-card {
  display: grid;
  gap: 18px;
}

.question-title {
  font-size: clamp(1.4rem, 2vw, 1.8rem);
  line-height: 1.2;
}

.question-copy {
  margin: 0;
  color: var(--muted);
}

.option-list {
  display: grid;
  gap: 12px;
}

.option-button {
  width: 100%;
  text-align: left;
  padding: 18px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.option-button:hover {
  transform: translateY(-1px);
  border-color: rgba(143, 127, 115, 0.42);
}

.option-button.is-selected {
  background: rgba(181, 140, 122, 0.2);
  border-color: var(--accent);
}

.option-button strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}

.form-nav {
  margin-top: 24px;
}

.primary-button,
.ghost-button {
  border-radius: 999px;
  padding: 13px 18px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent) 0%, #c4a08f 100%);
  color: #f9f7f3;
}

.ghost-button {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

.primary-button:hover,
.ghost-button:hover,
.option-button:hover {
  transform: translateY(-1px);
}

.danger {
  color: var(--accent-strong);
}

.result-screen {
  display: grid;
  gap: 20px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.result-card,
.lead-capture {
  background: rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  padding: 20px;
}

.lead-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 18px 0;
}

.lead-fields label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  color: var(--muted);
}

.lead-fields input,
.lead-fields textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffdfa;
  padding: 12px 14px;
  color: var(--text);
}

.full-width {
  grid-column: 1 / -1;
}

.status-text {
  min-height: 24px;
  margin: 12px 0 0;
}

.operator-tools {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.36);
}

.host-toggle {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 12px 0 10px;
  color: var(--text);
}

.host-toggle strong,
.host-toggle small {
  display: block;
}

.host-toggle small {
  margin-top: 4px;
  color: var(--muted);
}

.host-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

#sync-status {
  margin-top: 0;
}

.operator-tools summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.operator-tools[open] summary {
  margin-bottom: 12px;
}

.side-note {
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: rgba(143, 127, 115, 0.08);
  border-radius: 10px;
}

@media (max-width: 920px) {
  .hero,
  .app-grid,
  .result-grid,
  .lead-fields {
    grid-template-columns: 1fr;
  }

  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .hero-copy,
  .hero-card,
  .panel {
    padding: 22px;
  }

  h1 {
    max-width: 12ch;
  }

  .form-nav {
    position: sticky;
    bottom: 12px;
    padding: 12px;
    background: rgba(251, 247, 242, 0.96);
    border: 1px solid var(--line);
    border-radius: 999px;
    backdrop-filter: blur(10px);
  }
}
