/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #f6f8fb 0%, #eef2f7 100%);
  color: #1f2937;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- layout ---------- */
.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.card {
  width: 100%;
  max-width: 520px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.06),
    0 6px 18px rgba(16, 24, 40, 0.08);
  padding: 32px;
}
@media (max-width: 480px) {
  .card { padding: 24px 20px; border-radius: 12px; }
}

/* ---------- header ---------- */
.header h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.subtitle {
  margin: 0 0 24px;
  color: #6b7280;
  font-size: 14px;
}

/* ---------- form ---------- */
form .field { display: block; margin-bottom: 16px; }
form .field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
form .field > span em { font-weight: 400; color: #9ca3af; }
form .field input,
form .field textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
form .field input:focus,
form .field textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
form .field textarea { resize: vertical; min-height: 96px; }

.contact-details {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: #f9fafb;
}
.contact-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
  list-style: none;
}
.contact-details summary::-webkit-details-marker { display: none; }
.contact-details summary::after {
  content: "+";
  float: right;
  font-weight: 400;
  color: #6b7280;
}
.contact-details[open] summary::after { content: "−"; }
.contact-grid { margin-top: 12px; display: grid; gap: 12px; }
@media (min-width: 480px) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid .field:last-child { grid-column: 1 / -1; }
}

/* ---------- stars ---------- */
.rating-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 20px;
}
.rating-fieldset legend {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  padding: 0;
}
.stars {
  --star-size: 44px;
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
  font-size: var(--star-size);
  line-height: 1;
}
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label {
  cursor: pointer;
  color: #d1d5db;
  transition: color .1s, transform .1s;
  padding: 0 2px;
}
.stars label:hover,
.stars label:hover ~ label,
.stars input:checked ~ label {
  color: #f59e0b;
}
.stars label:active { transform: scale(0.9); }

.rating-label {
  margin: 8px 0 0;
  min-height: 18px;
  color: #6b7280;
  font-size: 13px;
}

/* ---------- buttons ---------- */
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .05s, background .15s, box-shadow .15s;
  min-height: 44px;
}
.primary { background: #2563eb; color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,.2); width: 100%; }
.primary:hover  { background: #1d4ed8; }
.primary:active { transform: translateY(1px); }
.primary:disabled { background: #93c5fd; cursor: not-allowed; }
.secondary { background: #f3f4f6; color: #1f2937; }
.secondary:hover { background: #e5e7eb; }

.cta-row {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.form-error {
  margin: 12px 0 0;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

/* ---------- success ---------- */
.state-success h1 {
  font-size: 22px;
  margin: 0 0 8px;
  font-weight: 700;
}
.state-success p { color: #4b5563; margin: 0 0 4px; }
.fineprint { color: #9ca3af; font-size: 12px; margin-top: 16px; text-align: center; }

/* ---------- loading ---------- */
.state-loading {
  text-align: center;
  padding: 24px 0;
  color: #6b7280;
}
.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- a11y ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
.stars label:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
