:root {
  --max: 900px;
  --pad: clamp(12px, 3vw, 24px);
  --muted: #6b7280;
  --accent: #0ea5a4;
  --bg-body: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --border-card: #eef2f7;
  --border-input: #e6eef7;
  --border-hr: #e6e9ee;
  --img-border: #eef2f7;
}

@media (prefers-color-scheme: dark) {
  :root {
    --muted: #9ca3af;
    --accent: #14b8a6;
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --border-card: #334155;
    --border-input: #475569;
    --border-hr: #334155;
    --img-border: #475569;
  }
}

html, body {
  height: 100%;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
  line-height: clamp(1.4, 1.35 + 0.2vw, 1.6);
  color: var(--text-primary);
  background: var(--bg-body);
}

.wrap {
  max-width: var(--max);
  margin: clamp(24px, 5vw, 48px) auto;
  padding: var(--pad);
}

header {
  display: block;
}

.logo {
  width: clamp(48px, 10vw, 54px);
  height: clamp(48px, 10vw, 54px);
  flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #06b6d4, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  margin-top: 10px;
}

/* top row inside header: logo + heading on one line */
.header-top {
  display: flex;
  align-items: flex-start;
  gap: clamp(8px, 2vw, 12px);
}

/* ensure header-content remains the main layout driver on desktop */
.header-content {
  display: flex;
  align-items: flex-start;
  gap: clamp(16px, 3vw, 24px);
  flex: 1;
  min-width: 0;
}

.header-text {
  flex: 1;
  min-width: 0;
}

.header-illustration {
  flex-shrink: 0;
  width: clamp(200px, 30vw, 280px);
  max-width: 42%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: -2px;
}

.header-illustration img {
  width: 100%;
  max-width: none;
  height: auto;
  object-position: top center;
  display: block;
  object-fit: cover;
  border-radius: 40px;
  border: 1px solid var(--img-border);
  background: var(--bg-card);
  padding: 6px;
}

/* desktop-only forced line break helper (KISS) */
.desktop-br { display: none; }

h1 {
  margin: .1rem 0;
  font-size: clamp(1.4rem, 1.2rem + 1.5vw, 2.2rem);
  line-height: 1.2;
}

p.lead {
  color: var(--muted);
  margin-top: 6px;
  font-size: clamp(0.9rem, 0.85rem + 0.3vw, 1.05rem);
}

hr {
  border: none;
  border-top: 1px solid var(--border-hr);
  margin: clamp(18px, 3vw, 24px) 0;
}

section {
  margin-bottom: clamp(16px, 2.5vw, 20px);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(12px, 2vw, 14px);
}

.card {
  padding: clamp(12px, 2vw, 16px);
  border-radius: 10px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
}

label {
  display: block;
  margin-bottom: clamp(6px, 1vw, 8px);
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: clamp(0.875rem, 0.85rem + 0.2vw, 0.95rem);
}

form {
  display: grid;
  gap: clamp(8px, 1.5vw, 10px);
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(6px, 1vw, 8px);
}

.option {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 8px);
  padding: clamp(8px, 1.2vw, 10px) clamp(10px, 1.5vw, 12px);
  border-radius: 8px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}

/* Visually indicate selected state. Uses :has where supported, with a fallback to styling the text when checked. */
.option:has(input:checked) {
  background: linear-gradient(90deg, rgba(6,182,212,0.06), rgba(124,58,237,0.04));
  border-color: rgba(124,58,237,0.28);
  transform: translateY(-1px);
}

/* Fallback class for browsers without :has support */
.option.selected {
  background: linear-gradient(90deg, rgba(6,182,212,0.06), rgba(124,58,237,0.04));
  border-color: rgba(124,58,237,0.28);
  transform: translateY(-1px);
}

.option input:checked + .option-text {
  font-weight: 700;
  color: var(--text-primary);
}

/* Textarea for 'other' input */
#otherText {
  width:100%;
  min-height: clamp(60px, 8vw, 64px);
  padding: clamp(8px, 1.5vw, 10px);
  border-radius:8px;
  border:1px solid var(--border-input);
  font-size: clamp(0.9rem, 0.85rem + 0.3vw, 1rem);
  resize:vertical;
  background: var(--bg-card);
  color: var(--text-primary);
}

input[type="email"], textarea, input[type="text"], select {
  width: 100%;
  padding: clamp(8px, 1.5vw, 10px);
  border-radius: 8px;
  border: 1px solid var(--border-input);
  font-size: clamp(0.9rem, 0.85rem + 0.3vw, 1rem);
  background: var(--bg-card);
  color: var(--text-primary);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right clamp(8px, 1.5vw, 12px) center;
  background-size: 1.2em;
  padding-right: clamp(32px, 5vw, 40px);
}

textarea {
  min-height: clamp(80px, 10vw, 90px);
}

button {
  background: var(--accent);
  border: none;
  color: white;
  padding: clamp(12px, 2vw, 16px) clamp(24px, 4vw, 32px);
  border-radius: 10px;
  font-weight: 600;
  font-size: clamp(0.95rem, 0.9rem + 0.4vw, 1.05rem);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 164, 0.3);
}

button:active {
  transform: translateY(0);
}

/* primary CTA class (can be used on <a> or <button>) */
.primary-cta {
  display: inline-block;
  background: var(--accent);
  border: none;
  color: white;
  padding: clamp(10px, 1.8vw, 12px) clamp(16px, 3vw, 20px);
  border-radius: 10px;
  font-weight: 600;
  font-size: clamp(0.9rem, 0.85rem + 0.35vw, 1rem);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(14, 165, 164, 0.3);
}

.primary-cta:active {
  transform: translateY(0);
}

/* Accessible focus for CTA links */
.primary-cta:focus-visible {
  outline: 3px solid rgba(14,165,164,0.18);
  outline-offset: 3px;
}

/* simple text-style button for unobtrusive inline actions */
.text-button {
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 6px 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
}
.text-button:hover {
  text-decoration: underline;
  background: rgba(14,165,164,0.04);
}
.text-button:focus-visible {
  outline: 3px solid rgba(14,165,164,0.12);
  outline-offset: 3px;
}

/* gentle, subtle callout for CTA (non-intrusive) */
.cta-callout {
  box-shadow: 0 6px 18px rgba(14,165,164,0.10);
  transform: translateY(-2px);
  position: relative;
  transition: transform 200ms ease, box-shadow 200ms ease;
  animation: cta-pulse 2.6s ease-in-out infinite;
}

@keyframes cta-pulse {
  0% { box-shadow: 0 6px 18px rgba(14,165,164,0.10); transform: translateY(-1px); }
  50% { box-shadow: 0 12px 30px rgba(14,165,164,0.12); transform: translateY(-3px); }
  100% { box-shadow: 0 6px 18px rgba(14,165,164,0.10); transform: translateY(-1px); }
}

/* stronger visible focus for keyboard users */
#submitBtn:focus-visible {
  outline: 3px solid rgba(14,165,164,0.18);
  outline-offset: 3px;
}

/* respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .cta-callout { animation: none; transform: none; }
}

@media (min-width: 720px) {
  .grid { grid-template-columns: 1fr 380px; }
  /* Make illustration flexible: take leftover space; constrain header text */
  .header-text { max-width: 520px; }
  .header-illustration { flex: 1 1 0; width: auto; max-width: 30%; }
  .desktop-br { display: inline; }
  .header-text p.lead { max-width: 46ch; }
}

@media (max-width: 719px) {
  header { flex-direction: column; align-items: flex-start; gap: 16px; }
  /* Stack logo + header-text so header-text is full-width and its CTA can center */
  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .header-content { flex-direction: column; align-items: flex-start; gap: 16px; width: 100%; }
  .header-illustration { width: 50%; max-width: 50%; margin: 0 auto; }
  /* Make form submit CTA full-width on mobile for easier tapping (scope to the earlyForm) */
  #earlyForm .center button { width: 100%; }
  /* Increase option tap area on mobile */
  .option { padding: 12px 14px; min-width: 100%; }

  /* Ensure header CTA expands to full page width on narrow viewports */
  .header-text .center {
    width: 100%; /* take full available width in the column layout */
    justify-content: center; /* center the CTA inside that full-width wrapper */
  }

  /* Make the header CTA block-level and full-width on mobile for easier tapping */
  .header-text .primary-cta {
    display: block;
    width: 100%;
    box-sizing: border-box; /* ensure padding is included in width */
  }
}

/* Small accessibility focus styles */
button:focus, .option:focus-within {
  outline: 3px solid rgba(14,165,164,0.16);
  outline-offset: 2px;
}

.option { cursor: pointer; }
.option input { margin-right: 8px; }

/* Link styles */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

footer {
  margin-top: clamp(20px, 3.5vw, 28px);
  color: var(--muted);
  font-size: clamp(0.85rem, 0.8rem + 0.2vw, 0.9rem);
}

.small {
  font-size: clamp(0.85rem, 0.8rem + 0.2vw, 0.9rem);
  color: var(--muted);
}

.center {
  display: flex;
  justify-content: center;
}

/* emoji-based heading icon (subtle) */
.heading-emoji {
  display: inline-block;
  font-size: 1.15em;
  line-height: 1;
  margin-right: 10px;
  vertical-align: middle;
  opacity: 0.85;
  transform: translateY(-1px);
}

/* emphasize important small labels and question line */
.question-label, label[for="otherText"], label[for="email"] {
  display: block;
  font-weight: 700;
  color: var(--text-primary);
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  margin-bottom: 8px;
  border-radius: 2px;
}

/* make the short early-user note more visible */
.early-note {
  margin-top: 8px;
  font-weight: 600;
  color: var(--muted);
}
