:root {
  color-scheme: light;
  color: #1a1a1a;
  background: #f8f6f1;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top right, #ffe4c4 0%, transparent 50%),
    radial-gradient(ellipse at bottom left, #d4e4d4 0%, transparent 50%),
    #f8f6f1;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 32px 32px;
}

/* HERO */

.hero {
  margin-bottom: 18px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.link-button {
  background: none;
  border: none;
  color: #c2410c;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: background 0.15s ease;
}

.link-button:hover {
  background: #fef3e7;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  font-weight: 700;
  color: #c2410c;
  margin: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 6px 0 14px;
  color: #1a1a1a;
}

.hero-copy {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #44403c;
  margin: 0 0 12px;
  max-width: 1100px;
}

.hero-copy:last-child {
  margin-bottom: 0;
}

/* CARD CONTAINER */

.card {
  margin-bottom: 14px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #ebe6dd;
  border-radius: 12px;
}

.name-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #44403c;
  margin-bottom: 4px;
}

.required {
  color: #c2410c;
}

.muted {
  color: #a8a29e;
  font-weight: 400;
  font-size: 0.78rem;
}

/* CARDS GRID (the 4 name cards) */

.cards-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.name-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid #ebe6dd;
  background: #ffffff;
}

.name-card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex: 0 0 220px;
  min-width: 0;
}

.name-card-slider {
  flex: 1;
  min-width: 0;
}

.rating-display {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 30px;
  padding: 0 10px;
  border-radius: 7px;
  background: transparent;
  color: #a8a29e;
  font-weight: 700;
  font-size: 1rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.rating-display.active {
  background: #c2410c;
  color: white;
}

.slider-with-hint {
  position: relative;
  padding-top: 22px;
}

.slide-hint {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 0.78rem;
  font-weight: 700;
  color: #2563eb;
  background: white;
  padding: 2px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  white-space: nowrap;
  cursor: grab;
  user-select: none;
  transition: opacity 0.2s ease;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.15);
}

.slide-hint:active {
  cursor: grabbing;
}

.slide-hint.hidden-hint {
  opacity: 0;
}

.rating-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  background: #e7e2d6;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.rating-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.rating-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #2563eb;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.slider-faces {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-bottom: 4px;
  font-size: 1.15rem;
  line-height: 1;
}

.slider-faces span:first-child {
  text-align: left;
}

.slider-faces span:last-child {
  text-align: right;
}

.slider-marks {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #57534e;
}

.slider-marks span:first-child {
  text-align: left;
}

.slider-marks span:nth-child(2) {
  text-align: center;
}

.slider-marks span:last-child {
  text-align: right;
}

/* WRITE-INS */

.write-in-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.write-in {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  border: 1px solid #ebe6dd;
  border-radius: 10px;
  background: #ffffff;
}

.write-in input[type='text'] {
  flex: 0 0 220px;
}

.write-in-slider {
  flex: 1;
  min-width: 0;
}

.custom-rating-row {
  display: grid;
  gap: 2px;
}

.rating-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.slider-label {
  font-size: 0.88rem;
  color: #78716c;
  font-weight: 600;
}

input[type='text'],
input[type='email'] {
  width: 100%;
  border: 1px solid #d6cfc1;
  border-radius: 8px;
  padding: 8px 11px;
  font: inherit;
  font-size: 0.92rem;
  background: #fdfcf9;
  color: #1a1a1a;
  transition: border-color 0.15s ease, background 0.15s ease;
}

input[type='text']:focus,
input[type='email']:focus {
  outline: none;
  border-color: #c2410c;
  background: white;
}

/* SUBMIT */

.submit-section {
  text-align: center;
  padding: 4px 0 0;
  margin-bottom: 12px;
}

.primary-button {
  border: none;
  cursor: pointer;
  color: white;
  background: #c2410c;
  border-radius: 9px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  transition: transform 0.1s ease, background 0.15s ease;
  font-family: inherit;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #9a3412;
}

.primary-button:disabled {
  background: #a8a29e;
  cursor: not-allowed;
}

.submit-message {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: #57534e;
  min-height: 1.1em;
}

.submit-message.success {
  color: #166534;
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 10px;
}

.submit-message.error {
  color: #b91c1c;
}

/* THANK YOU */

.primary-button.submitted,
.primary-button.submitted:disabled {
  background: #16a34a;
  color: white;
  cursor: default;
  opacity: 1;
}

.primary-button.submitted::before {
  content: '✓ ';
  font-weight: 900;
}

.hidden {
  display: none;
}

/* FOOTER */

.footer {
  padding: 6px 0 0;
  text-align: center;
  font-size: 0.7rem;
  color: #a8a29e;
}

/* RESPONSIVE */

@media (max-width: 640px) {
  .page-shell {
    padding: 16px 14px 20px;
  }

  .card,
  .name-card {
    padding: 12px 14px;
  }

  .name-card,
  .write-in {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .name-card-title,
  .write-in input[type='text'] {
    flex: 0 0 auto;
  }

  .name-card .rating-display,
  .write-in .rating-display {
    align-self: flex-end;
  }
}
