:root {
  --primary: #6b7280;
  --primary-ink: #ffffff;
  --bg: #f4f4f2;
  --text: #1a1a1a;
  --font-title: Georgia, serif;
  --font-text: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --ink-soft: color-mix(in srgb, var(--text) 62%, var(--bg) 38%);
  --surface: color-mix(in srgb, var(--bg) 90%, white 10%);
  --border: color-mix(in srgb, var(--text) 14%, var(--bg) 86%);
  --star-dim: color-mix(in srgb, var(--primary) 32%, var(--bg) 68%);
  --shadow: 0 1px 2px color-mix(in srgb, var(--text) 6%, transparent),
            0 12px 32px -12px color-mix(in srgb, var(--text) 22%, transparent);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 40px 36px 36px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.logo {
  display: block;
  max-height: 56px;
  width: auto;
  margin: 0 auto;
}
.logo[hidden] { display: none; }

.eyebrow {
  font-family: var(--font-title);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
  letter-spacing: 0.01em;
}

h1 {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.25;
  text-align: center;
  margin: 0;
  text-wrap: balance;
  color: var(--text);
}

.subtitle {
  text-align: center;
  font-size: 14.5px;
  color: var(--ink-soft);
  margin-top: -10px;
}

.stars {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 2px;
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  line-height: 0;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.star-btn svg {
  width: 42px;
  height: 42px;
  display: block;
  fill: none;
  stroke: var(--star-dim);
  stroke-width: 1.5;
  transition: fill 0.15s ease, stroke 0.15s ease, transform 0.12s ease;
}

.star-btn:hover svg,
.star-btn.hovered svg {
  stroke: var(--primary);
  transform: scale(1.08);
}

.star-btn.filled svg {
  fill: var(--primary);
  stroke: var(--primary);
}

.star-btn:focus-visible svg {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

.rating-label {
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  min-height: 18px;
  letter-spacing: 0.02em;
}

.panel {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.panel.active {
  display: flex;
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .panel.active { animation: none; }
  .star-btn svg { transition: none; }
}

.panel-title {
  font-family: var(--font-title);
  font-size: 18px;
  text-align: center;
  margin: 0;
}

.panel-copy {
  font-size: 14px;
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

.redirect-btn, .submit-btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  background: var(--primary);
  color: var(--primary-ink);
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-text);
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.redirect-btn:hover, .submit-btn:hover { opacity: 0.9; }
.redirect-btn:active, .submit-btn:active { transform: scale(0.98); }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 6px;
}

textarea,
input[type="email"],
input[type="text"] {
  width: 100%;
  font-family: var(--font-text);
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
}

textarea {
  resize: vertical;
  min-height: 96px;
}

textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.change-rating {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  align-self: center;
  font-family: var(--font-text);
}

.confirm {
  display: none;
  text-align: center;
  gap: 10px;
  flex-direction: column;
}
.confirm.active { display: flex; animation: rise 0.35s ease both; }

.confirm-icon { font-size: 30px; }

.honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.send-error {
  font-size: 13px;
  color: #b3432f;
  text-align: center;
  margin: 0;
}
.send-error[hidden] { display: none; }

.state-message {
  text-align: center;
  font-family: var(--font-text);
  color: var(--ink-soft);
  padding: 40px 20px;
}
