:root {
  color-scheme: light;
  font-family: "Roboto", Arial, sans-serif;
  --page: #f4f1ec;
  --card: #fffdf9;
  --text: #202124;
  --muted: #5f6368;
  --line: #ddd7cd;
  --accent: #9f1d2e;
  --accent-dark: #7d1725;
  --accent-soft: #fff2f0;
  --gold: #c9921d;
  --focus: rgba(159, 29, 46, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, #fbfaf7 0%, var(--page) 42%, #eeebe5 100%);
  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: 18px 12px 42px;
}

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

.form-header,
.question-card,
.submit-status {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(60, 45, 32, 0.06);
}

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

.hero-image {
  min-height: 210px;
  background-color: #efe7d8;
  background-position: center;
  background-size: cover;
}

.header-strip {
  height: 10px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

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

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  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;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

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

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

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

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

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  outline: none;
}

select,
input {
  min-height: 40px;
  padding: 0 10px;
}

select {
  width: auto;
  max-width: 100%;
  appearance: none;
  border-color: #c7c9cc;
  border-radius: 6px;
  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-right: 34px;
}

textarea {
  resize: vertical;
  min-height: 120px;
  padding: 10px;
}

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

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

.question-card {
  display: grid;
  gap: 14px;
  padding: 22px 24px;
}

.menu-picker {
  display: grid;
  gap: 10px;
}

.menu-results {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.menu-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  overflow: visible;
}

.menu-result:hover {
  border-color: var(--accent);
  background: #fff8f8;
}

.menu-result strong,
.selected-menu-title strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.menu-result span,
.selected-menu-title span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.menu-result em {
  display: block;
  white-space: nowrap;
  color: var(--accent-dark);
  font-style: normal;
  font-weight: 600;
  line-height: 1.35;
}

.selected-menu-list {
  display: grid;
  gap: 10px;
}

.selected-menu {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}

.selected-menu-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.selected-menu-title {
  min-width: 0;
}

.remove-menu {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
}

.remove-menu:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.item-rating {
  padding-top: 2px;
}

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

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

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

.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: 4px;
}

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

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

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

.survey-help {
  font-size: 12px;
}

.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: 34px;
  padding-left: 34px;
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  line-height: 1.35;
}

.option span::before {
  position: absolute;
  left: 0;
  width: 18px;
  height: 18px;
  border: 2px solid #747775;
  border-radius: 50%;
  content: "";
}

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

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

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

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

.submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  padding: 0 22px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.submit-button:hover {
  background: var(--accent-dark);
}

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

.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: center;
}

.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: 42px;
  margin-top: 4px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  padding: 0 18px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

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

.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);
  }
}

.submit-status {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
}

.submit-status p {
  margin: 0;
  font-weight: 500;
  font-size: 14px;
}

pre {
  max-height: 260px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 4px;
  background: #202124;
  color: #e8eaed;
  font-size: 0.78rem;
  white-space: pre-wrap;
}

[hidden] {
  display: none !important;
}

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

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

  h1 {
    font-size: 30px;
  }

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

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

  .selected-menu {
    gap: 9px;
    padding: 12px;
  }

  .selected-menu-head {
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 10px;
    align-items: start;
  }

  .selected-menu-title span {
    display: block;
    margin-top: 1px;
  }

  .selected-menu .field {
    gap: 6px;
  }

  .selected-menu .field input {
    min-height: 38px;
  }

  .menu-result {
    display: flex;
    flex-direction: column;
    gap: 3px;
    align-items: start;
    padding: 10px 10px 11px;
  }

  .menu-result > span {
    display: block;
    width: 100%;
  }

  .menu-result em {
    justify-self: start;
  }

  .remove-menu {
    justify-self: end;
  }

  .star {
    width: 32px;
  }

  .item-rating {
    gap: 3px;
    padding-top: 0;
  }

  .item-star {
    width: 28px;
    font-size: 21px;
  }

  .form-actions {
    display: grid;
  }

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