:root {
  color-scheme: light;
  font-family: "Roboto", Arial, sans-serif;
  --page: #f8f2f1;
  --card: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --line: #dadce0;
  --accent: #9f1d2e;
  --accent-dark: #7d1725;
  --accent-soft: #fdeceb;
  --gold: #c9921d;
  --focus: rgba(159, 29, 46, 0.14);
  --radius: 8px;
  --elevation-1: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --elevation-2: 0 1px 3px 0 rgba(60, 64, 67, 0.3), 0 4px 8px 3px rgba(60, 64, 67, 0.15);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.form-shell {
  display: grid;
  gap: 16px;
}

.form-header,
.question-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--elevation-1);
}

.form-header {
  border-top: 0;
}

.hero-image {
  min-height: 210px;
  background-color: var(--page);
  background-position: center;
  background-size: cover;
}

.hero-image.is-logo-hero {
  background-repeat: no-repeat;
  background-size: min(58%, 380px) auto;
}

.header-strip {
  height: 10px;
  background: var(--accent);
}

.header-content {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.25;
}

h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.intro,
.helper-text,
.submit-message,
.rating-help {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.brand-select,
.field {
  display: grid;
  gap: 6px;
}

.brand-select {
  width: fit-content;
  max-width: 100%;
}

.brand-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.field input[type="text"] {
  max-width: 400px;
}

.field span {
  color: var(--text);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: #80868b;
  opacity: 1;
}

select,
input,
textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

select,
input {
  min-height: 38px;
  padding: 6px 2px;
}

select {
  width: auto;
  max-width: 100%;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 17px,
    calc(100% - 12px) 17px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding: 0 34px 0 12px;
}

textarea {
  resize: vertical;
  min-height: 110px;
  padding: 8px 2px;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 1px 0 0 var(--accent);
}

input:disabled,
textarea:disabled,
select:disabled {
  color: #9aa0a6;
  cursor: not-allowed;
}

select:disabled {
  background-color: #f3f0ea;
}

.survey-form {
  display: grid;
  gap: 16px;
}

.question-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-left: 4px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.question-card:focus-within {
  border-left-color: var(--accent);
  box-shadow: var(--elevation-2);
}

.rating-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.star {
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #9aa0a6;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  transition: background 0.1s ease, color 0.1s ease;
}

.star:hover {
  background: rgba(60, 64, 67, 0.06);
  color: var(--gold);
}

.star.is-active {
  background: transparent;
  color: var(--gold);
}

.question-list {
  display: grid;
  gap: 16px;
}

.survey-page {
  gap: 18px;
}

.survey-page h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
}

.progress-track {
  height: 4px;
  border-radius: 2px;
  background: var(--accent-soft);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.section-nav {
  display: grid;
  gap: 8px;
  padding: 0 4px;
}

.section-nav-message {
  margin: 0;
  color: var(--accent-dark);
  font-size: 13px;
  line-height: 1.4;
  min-height: 1em;
}

.section-nav-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 4px;
  padding: 0 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.nav-button.ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.nav-button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-button.primary {
  margin-left: auto;
  border: 0;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--elevation-1);
}

.nav-button.primary:hover {
  background: var(--accent-dark);
  box-shadow: var(--elevation-2);
}

.section-fields {
  display: grid;
  gap: 36px;
}

.field-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  margin: 0;
}

.field-group legend {
  padding: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.question {
  display: grid;
  min-width: 0;
  padding: 0;
  border: 0;
  margin: 0;
}

.question-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 6px;
  row-gap: 8px;
}

.question legend {
  display: contents;
  padding: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.question-number {
  white-space: nowrap;
}

.options {
  display: grid;
  gap: 0;
}

.survey-rating {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  grid-column: 2;
}

.standalone-rating {
  grid-column: auto;
}

.survey-star {
  display: grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #a4a39f;
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
  transition: background 0.1s ease, color 0.1s ease;
}

.survey-star:hover {
  background: rgba(60, 64, 67, 0.06);
  color: var(--gold);
}

.survey-star.is-active {
  color: var(--gold);
}

.mini-helper {
  font-size: 12px;
}

.checkbox-text-list {
  display: grid;
  gap: 10px;
}

.checkbox-text-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.6fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.option {
  position: relative;
  display: grid;
  min-width: 0;
}

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

.option span {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  margin: 0 -8px;
  padding: 0 8px 0 40px;
  border-radius: 24px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
  transition: background 0.1s ease;
}

.option:hover span {
  background: rgba(60, 64, 67, 0.06);
}

.option input:focus-visible + span {
  background: rgba(159, 29, 46, 0.08);
  box-shadow: 0 0 0 1px var(--focus);
}

.option span::before {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 2px solid #5f6368;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.option input:checked + span::before {
  border-color: var(--accent);
}

.option input:checked + span::after {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.option input[type="checkbox"] + span::before {
  border-radius: 2px;
}

.option input[type="checkbox"]:checked + span::before {
  background: var(--accent);
}

.option input[type="checkbox"]:checked + span::after {
  left: 15px;
  width: 6px;
  height: 11px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  border-radius: 0;
  background: transparent;
  transform: translateY(-58%) rotate(45deg);
}

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

.form-actions {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 4px 4px;
}

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  padding: 0 24px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--elevation-1);
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

.submit-button:hover {
  background: var(--accent-dark);
  box-shadow: var(--elevation-2);
}

.submit-button:disabled {
  cursor: progress;
  opacity: 0.86;
  box-shadow: none;
}

.button-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.submit-button.is-loading .button-spinner {
  display: inline-block;
}

.submit-message {
  text-align: left;
}

.thank-you-panel {
  gap: 10px;
}

.thank-you-panel h2 {
  margin-top: 0;
  font-size: 24px;
  line-height: 1.35;
}

.google-review-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 4px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: transparent;
  color: var(--accent);
  padding: 0 20px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease;
}

.google-review-button:hover {
  background: var(--accent-soft);
}

.thank-you-footer {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

[hidden] {
  display: none !important;
}

@media (max-width: 560px) {
  .app {
    padding: 12px 8px 32px;
  }

  .header-content,
  .question-card {
    padding: 18px 16px;
  }

  h1 {
    font-size: 28px;
  }

  .hero-image {
    min-height: 148px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .checkbox-text-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .star {
    width: 32px;
  }

  .form-actions {
    justify-items: stretch;
  }

  .submit-button {
    width: 100%;
  }
}
