:root {
  --red: #c8102e;
  --red-dark: #a00d24;
  --black: #111111;
  --gray: #f5f5f5;
  --gray2: #ececec;
  --text: #111111;
  --text2: #4a4a4a;
  --text3: #767676; /* darkened from #9a9a9a so small text meets contrast guidelines */
  --border: #e0e0e0;
  --white: #ffffff;
  --green: #2d6a4f;
  --green-light: #d8f3dc;
  --amber: #b7791f;
  --low: #c53030;
  --r: 12px;
  --r-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--gray);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.header {
  background: var(--black);
  padding: 20px 40px;
  display: flex;
  align-items: center;
  border-bottom: 3px solid var(--red);
}
.logo { display: flex; align-items: center; gap: 14px; }
.logo-wordmark { font-size: 16px; font-weight: 600; color: var(--white); letter-spacing: 0.01em; white-space: nowrap; }
.logo-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.2); }
.logo-sub { font-size: 12px; color: rgba(255,255,255,0.6); letter-spacing: 0.04em; }

/* ---------- Layout ---------- */
.main { flex: 1; width: 100%; max-width: 680px; margin: 48px auto; padding: 0 24px 80px; }

.greeting { font-size: 15px; color: var(--text2); margin-bottom: 4px; }

.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--black);
  margin-bottom: 6px;
}
.page-desc { font-size: 14px; color: var(--text3); margin-bottom: 32px; }

.survey-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}

/* ---------- Questions ---------- */
.question-block {
  border-bottom: 1px solid var(--border);
  padding: 36px 40px;
  opacity: 0;
  transform: translateY(12px);
  animation: slideUp 0.4s ease forwards;
}
.question-block:nth-child(1) { animation-delay: 0.05s; }
.question-block:nth-child(2) { animation-delay: 0.15s; }
.question-block:nth-child(3) { animation-delay: 0.25s; }
@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .question-block { animation: none; opacity: 1; transform: none; }
}

.question-num {
  font-size: 10px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--red); margin-bottom: 10px;
}

.question-text {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 19px;
  font-weight: 400;
  color: var(--black);
  line-height: 1.4;
  margin-bottom: 4px;
  padding: 0;
}
.question-required { color: var(--red); margin-left: 3px; }
.question-hint { font-size: 13px; color: var(--text3); margin: 6px 0 24px; }

/* ---------- 0–10 scale (real radio buttons, styled as boxes) ---------- */
.nps-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 6px; margin-bottom: 10px; }

.nps-option { position: relative; }
.nps-option input {
  position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer;
}
.nps-option span {
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border);
  background: var(--gray);
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500;
  color: var(--text2);
  transition: all 0.12s;
  user-select: none;
}
.nps-option:hover span { border-color: var(--black); background: var(--gray2); color: var(--black); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.08); }
.nps-option input:focus-visible + span { outline: 3px solid var(--black); outline-offset: 2px; }

.nps-option input:checked + span { color: var(--white); transform: translateY(-2px); }
.nps-option.band-low  input:checked + span { background: var(--low);   border-color: var(--low);   box-shadow: 0 4px 10px rgba(197,48,48,0.25); }
.nps-option.band-mid  input:checked + span { background: var(--amber); border-color: var(--amber); box-shadow: 0 4px 10px rgba(183,121,31,0.25); }
.nps-option.band-high input:checked + span { background: var(--green); border-color: var(--green); box-shadow: 0 4px 10px rgba(45,106,79,0.25); }

.nps-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text3); font-weight: 500; }

/* ---------- Text answers ---------- */
.survey-textarea {
  width: 100%;
  background: var(--gray);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  font-family: inherit;
  font-size: 16px; /* 16px stops iPhones zooming in when you tap the box */
  color: var(--text);
  line-height: 1.6;
  resize: vertical;
  min-height: 110px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.survey-textarea:focus { border-color: var(--black); background: var(--white); }
.survey-textarea::placeholder { color: var(--text3); }

.char-count { font-size: 11px; color: var(--text3); text-align: right; margin-top: 6px; min-height: 1em; }

/* ---------- Submit ---------- */
.submit-area {
  padding: 28px 40px;
  background: var(--gray);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.submit-note { font-size: 12px; color: var(--text3); line-height: 1.5; max-width: 300px; }

.submit-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--r-sm);
  padding: 13px 26px;
  font-family: inherit;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.submit-btn:hover { background: var(--red-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(200,16,46,0.25); }
.submit-btn:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }
.submit-btn:disabled { background: var(--text3); cursor: not-allowed; transform: none; box-shadow: none; }
.submit-arrow { transition: transform 0.15s; }
.submit-btn:hover .submit-arrow { transform: translateX(3px); }

.error-msg {
  background: #fff5f5;
  border: 1px solid #feb2b2;
  color: var(--low);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 12px;
}
.submit-error { margin: 0 40px 28px; }

/* ---------- Loading / message / thank-you views ---------- */
.status-view { text-align: center; }
.status-message { color: var(--text2); font-size: 14px; }
.spinner {
  width: 32px; height: 32px; margin: 40px auto 16px;
  border: 3px solid var(--border); border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.message-card { padding: 64px 40px; }
.ty-icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--gray2); color: var(--text2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; font-size: 26px; font-weight: 600;
}
.ty-icon-success { background: var(--green-light); color: var(--green); }
.ty-title { font-family: 'Playfair Display', Georgia, serif; font-size: 26px; font-weight: 400; color: var(--black); margin-bottom: 12px; }
.ty-message { font-size: 14px; color: var(--text2); line-height: 1.7; max-width: 400px; margin: 0 auto; }

/* ---------- Footer ---------- */
.footer { text-align: center; padding: 28px 24px; font-size: 12px; color: var(--text3); }
.footer a { color: var(--black); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  .header { padding: 16px 20px; }
  .main { margin: 28px auto; padding: 0 16px 56px; }
  .page-title { font-size: 24px; }
  .question-block { padding: 28px 20px; }
  .question-text { font-size: 17px; }
  .submit-area { flex-direction: column; align-items: stretch; padding: 24px 20px; }
  .submit-btn { justify-content: center; padding: 15px 26px; }
  .submit-error { margin: 0 20px 24px; }
  .message-card { padding: 48px 24px; }
}

/* Very narrow phones: two rows (0–5, 6–10) so each box stays big enough to tap. */
@media (max-width: 480px) {
  .nps-scale { grid-template-columns: repeat(6, 1fr); gap: 8px; }
  .nps-option span { aspect-ratio: auto; height: 46px; font-size: 15px; }
}

/* Tiny screens: keep the header on one line by dropping the "Client Feedback" label. */
@media (max-width: 360px) {
  .logo-divider, .logo-sub { display: none; }
}
