/* Shared two-level site navigation. */
.site-header { width: 100%; box-sizing: border-box; background: #fff; color: #0f172a; border-bottom: 1px solid #cbd5e1; }
.site-header__inner { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-header a { color: #0f172a; text-decoration: none; }
.site-header__brand { font-size: 1.2rem; font-weight: 700; }
.site-header ul { list-style: none; margin: 0; padding: 0; }
.site-header__menu { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.site-header__menu > li { position: relative; }
.site-header__menu a, .site-header summary { display: block; padding: 10px 14px; border-radius: 6px; cursor: pointer; }
.site-header summary { display: list-item; list-style-position: inside; }
.site-header a:hover, .site-header summary:hover { background: #eff6ff; }
.site-header a[aria-current="page"], .site-header__section--active > summary { background: #dbeafe; color: #1e3a8a; font-weight: 650; }
.site-header a:focus-visible, .site-header summary:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.site-header .site-header__submenu { position: absolute; top: 100%; right: 0; min-width: 180px; z-index: 100; padding: 6px; background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; box-shadow: 0 8px 24px #0f172a1a; }
@media (max-width: 600px) {
  .site-header nav { width: 100%; }
  .site-header__menu { align-items: stretch; flex-direction: column; }
  .site-header .site-header__submenu { position: static; min-width: 0; margin: 4px 0 0 16px; box-shadow: none; }
}

/* NPS survey form styles.
   Selectors match src/web/nps.php. */

main:has(.nps-scale) {
  max-width: 760px;
}

main:has(.nps-scale) form {
  display: grid;
  gap: 20px;
}

main:has(.nps-scale) fieldset {
  min-width: 0;
  margin: 0;
  padding: 20px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #ffffff;
}

main:has(.nps-scale) legend {
  max-width: 100%;
  padding: 0 8px;
  color: #0f172a;
  font-size: 1rem;
  font-weight: 650;
}

.nps-scale {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.nps-scale label {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  cursor: pointer;
}

.nps-scale input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2563eb;
}

.nps-scale label:hover {
  border-color: #2563eb;
  background: #eff6ff;
}

.nps-scale label:has(input:checked) {
  border-color: #1d4ed8;
  background: #dbeafe;
  color: #1e3a8a;
  box-shadow: inset 0 0 0 1px #1d4ed8;
}

.nps-scale label:has(input:focus-visible) {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.nps-scale-labels {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  color: #475569;
  font-size: 0.875rem;
}

.nps-scale-labels span:last-child {
  text-align: right;
}

main:has(.nps-scale) select,
main:has(.nps-scale) textarea {
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
}

main:has(.nps-scale) textarea {
  min-height: 120px;
  resize: vertical;
}

main:has(.nps-scale) select:focus-visible,
main:has(.nps-scale) textarea:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

main:has(.nps-scale) button[type="submit"] {
  min-height: 48px;
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

main:has(.nps-scale) button[type="submit"]:hover {
  background: #1d4ed8;
}

main:has(.nps-scale) button[type="submit"]:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .nps-scale {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  main:has(.nps-scale) fieldset {
    padding: 16px 12px;
  }

  .nps-scale-labels {
    gap: 8px;
    font-size: 0.8125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nps-scale label,
  main:has(.nps-scale) button[type="submit"] {
    transition: none;
  }
}

/* NPS score groups: detractors, passives, promoters. */
.nps-scale label:nth-child(-n + 7) {
  --nps-background: #fee2e2;
  --nps-border: #dc2626;
  --nps-text: #991b1b;
}

.nps-scale label:nth-child(8),
.nps-scale label:nth-child(9) {
  --nps-background: #ffedd5;
  --nps-border: #ea580c;
  --nps-text: #9a3412;
}

.nps-scale label:nth-child(n + 10) {
  --nps-background: #dcfce7;
  --nps-border: #16a34a;
  --nps-text: #166534;
}

.nps-scale label {
  background: var(--nps-background);
  border-color: var(--nps-border);
  color: var(--nps-text);
}

.nps-scale input[type="radio"] {
  accent-color: var(--nps-border);
}

.nps-scale label:hover {
  background: var(--nps-background);
  border-color: var(--nps-text);
  box-shadow: inset 0 0 0 1px var(--nps-border);
}

.nps-scale label:has(input:checked) {
  background: var(--nps-border);
  border-color: var(--nps-text);
  color: #ffffff;
  box-shadow: inset 0 0 0 2px var(--nps-text);
}

.nps-scale label:has(input:focus-visible) {
  outline: 3px solid #0f172a;
  outline-offset: 3px;
}

.nps-scale-labels span:first-child {
  color: #991b1b;
}

.nps-scale-labels span:last-child {
  color: #166534;
}
