/* /community-survey. Colours come from shows-ui.css (--ev-*), which switches with html.night-mode.
   Selectors are scoped to .cs-page so night-mode.css's global p and heading colours don't apply. */

.cs-page {
  --cs-hero: radial-gradient(800px 360px at 80% -20%, color-mix(in srgb, var(--shows-primary) 18%, transparent), transparent 70%),
    radial-gradient(600px 320px at 0% 120%, rgba(232, 51, 109, 0.08), transparent 70%),
    var(--ev-bg);
  --cs-tile-bg: var(--ev-surface);
  --cs-tile-hover: var(--ev-surface-soft);
  background: var(--ev-bg);
  color: var(--ev-text);
  padding-bottom: 56px;
}

html.night-mode .cs-page {
  --cs-hero: radial-gradient(800px 360px at 80% -20%, color-mix(in srgb, var(--shows-primary) 20%, transparent), transparent 70%),
    radial-gradient(600px 320px at 0% 120%, rgba(232, 51, 109, 0.1), transparent 70%),
    var(--ev-bg);
  --cs-tile-bg: var(--ev-surface-muted);
}

.cs-container {
  max-width: 760px;
}

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

.cs-hero {
  padding: 48px 0 88px;
  background: var(--cs-hero);
  text-align: center;
}

.cs-hero__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: var(--ev-brand);
  color: #fff;
  font-size: 26px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--shows-primary) 30%, transparent);
}

.cs-page .cs-hero h1 {
  margin: 0 0 10px;
  color: var(--ev-text);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.cs-page .cs-hero__lead {
  max-width: 520px;
  margin: 0 auto;
  color: var(--ev-muted);
  font-size: 16px;
  line-height: 1.55;
}

/* ---------- Card ---------- */

.cs-form,
.cs-done {
  position: relative;
  margin-top: -56px;
  padding: 32px;
  border: 1px solid var(--ev-border);
  border-radius: var(--ev-radius);
  background: var(--ev-surface);
  box-shadow: var(--ev-shadow);
}

.cs-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Steps ---------- */

.cs-step {
  min-height: 260px;
}

.cs-step.is-entering-forward {
  animation: cs-step-forward 0.28s ease;
}

.cs-step.is-entering-back {
  animation: cs-step-back 0.28s ease;
}

@keyframes cs-step-forward {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes cs-step-back {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: none; }
}

.cs-page .cs-step__title {
  display: block;
  float: none;
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  color: var(--ev-text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.cs-page .cs-step__title:focus {
  outline: none;
}

.cs-step__title + .cs-question__hint {
  margin-top: -10px;
}

.cs-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.cs-nav .cs-btn--primary {
  margin-left: auto;
  min-width: 160px;
}

.cs-invite {
  margin-top: 18px;
  animation: cs-reveal 0.2s ease;
}

.cs-question {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.cs-page .cs-question__title {
  display: block;
  float: none;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  color: var(--ev-text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

.cs-page .cs-question__hint {
  margin: -6px 0 12px;
  color: var(--ev-muted);
  font-size: 14px;
}

.cs-page .cs-optional {
  margin-left: 4px;
  color: var(--ev-muted);
  font-size: 13px;
  font-weight: 400;
}

/* ---------- Account and fields ---------- */

.cs-account {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--ev-border);
  border-radius: var(--ev-radius-sm);
  background: var(--ev-surface-soft);
}

.cs-account__avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ev-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.cs-account__text {
  color: var(--ev-text);
  font-size: 15px;
  font-weight: 500;
}

.cs-fields {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.cs-field {
  grid-column: span 2;
}

.cs-field--half {
  grid-column: span 3;
}

.cs-account + .cs-fields .cs-field--title {
  grid-column: span 2;
}

.cs-page .cs-label {
  display: block;
  margin-bottom: 6px;
  color: var(--ev-text);
  font-size: 14px;
  font-weight: 500;
}

.cs-page .cs-input,
.cs-page .shows-phone-input .form-control {
  min-height: 46px;
  border-color: var(--ev-border);
  border-radius: 10px;
  background-color: var(--ev-surface);
  color: var(--ev-text);
  font-size: 16px;
}

.cs-page .cs-input::placeholder {
  color: var(--ev-muted);
  font-size: 16px;
}

.cs-page .cs-input:focus {
  border-color: var(--ev-brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--shows-primary) 16%, transparent);
}

.cs-page textarea.cs-input {
  min-height: 92px;
  resize: vertical;
}

.cs-page .is-invalid,
.cs-page .is-invalid:focus {
  border-color: var(--ev-danger);
}

/* ---------- Tiles ---------- */

.cs-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cs-tiles--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cs-tiles--segment {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.cs-tiles--pair {
  grid-template-columns: repeat(2, minmax(0, 160px));
}

.cs-tile {
  position: relative;
  margin: 0;
  cursor: pointer;
}

.cs-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cs-tile__body {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--ev-border);
  border-radius: 12px;
  background: var(--cs-tile-bg);
  color: var(--ev-text);
  font-size: 15px;
  line-height: 1.35;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  user-select: none;
}

.cs-tile__body > .uil:first-child {
  flex: 0 0 auto;
  color: var(--ev-brand);
  font-size: 20px;
}

.cs-tile__label {
  flex: 1 1 auto;
}

.cs-tile__check {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--ev-border);
  border-radius: 6px;
  color: transparent;
  font-size: 16px;
  transition: inherit;
}

.cs-tiles--4 .cs-tile__body {
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.cs-tiles--segment .cs-tile__body {
  justify-content: center;
  min-height: 46px;
  padding: 10px 8px;
  text-align: center;
  font-weight: 500;
}

.cs-tile:hover .cs-tile__body {
  border-color: color-mix(in srgb, var(--shows-primary) 45%, transparent);
  background: var(--cs-tile-hover);
}

.cs-tile:active .cs-tile__body {
  transform: scale(0.98);
}

.cs-tile input:focus-visible + .cs-tile__body {
  outline: 2px solid var(--ev-brand);
  outline-offset: 2px;
}

.cs-tile input:checked + .cs-tile__body {
  border-color: var(--ev-brand);
  background: var(--ev-brand-soft);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--shows-primary) 12%, transparent);
}

.cs-tile input:checked + .cs-tile__body .cs-tile__check {
  border-color: var(--ev-brand);
  background: var(--ev-brand);
  color: #fff;
}

.cs-tiles--segment .cs-tile input:checked + .cs-tile__body {
  background: var(--ev-brand);
  color: #fff;
}

.cs-question.is-invalid .cs-tile__body {
  border-color: rgba(192, 57, 43, 0.5);
}

.cs-other {
  margin-top: 10px;
  animation: cs-reveal 0.2s ease;
}

@keyframes cs-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Errors and submit ---------- */

.cs-page .cs-error {
  margin: 6px 0 0;
  color: var(--ev-danger);
  font-size: 14px;
}

.cs-page .cs-error:empty {
  display: none;
}

.cs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  border: 0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.cs-btn--primary {
  background: var(--ev-brand);
  color: #fff;
}

.cs-btn--ghost {
  background: transparent;
  color: var(--ev-muted);
  padding-right: 12px;
  padding-left: 12px;
}

.cs-btn--ghost:hover,
.cs-btn--ghost:focus {
  background: var(--ev-surface-muted);
  color: var(--ev-text);
}

.cs-btn--primary:hover,
.cs-btn--primary:focus {
  background: var(--ev-brand-strong);
  color: #fff;
}

.cs-btn:active {
  transform: scale(0.98);
}

.cs-btn[disabled] {
  opacity: 0.7;
  cursor: progress;
}

/* ---------- Done ---------- */

.cs-done {
  padding: 48px 32px;
  text-align: center;
  animation: cs-reveal 0.25s ease;
}

.cs-done:focus {
  outline: none;
}

.cs-done__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: rgba(25, 135, 84, 0.12);
  color: var(--ev-success);
  font-size: 34px;
}

.cs-page .cs-done__title {
  margin: 0 0 6px;
  color: var(--ev-text);
  font-size: 20px;
  font-weight: 600;
}

.cs-page .cs-done__text {
  margin: 0 auto 24px;
  max-width: 420px;
  color: var(--ev-muted);
  font-size: 15px;
}

/* ---------- Mobile ---------- */

@media (max-width: 767.98px) {
  .cs-hero {
    padding: 32px 0 76px;
  }

  .cs-form,
  .cs-done {
    padding-right: 18px;
    padding-left: 18px;
  }

  .cs-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .cs-field,
  .cs-field--half,
  .cs-account + .cs-fields .cs-field--title {
    grid-column: auto;
  }

  .cs-tiles,
  .cs-tiles--4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .cs-tiles--4 .cs-tile__body {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
  }

  .cs-tiles--segment {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-tiles--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cs-form {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .cs-nav .cs-btn--primary {
    flex: 1 1 auto;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cs-page *,
  .cs-page *::before,
  .cs-page *::after {
    animation: none !important;
    transition: none !important;
  }
}
