:root {
  --background: #f7f7f8;
  --surface: #ffffff;
  --surface-subtle: #fafafa;
  --foreground: #18181b;
  --muted: #71717a;
  --muted-2: #a1a1aa;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --accent: #111111;
  --accent-foreground: #ffffff;
  --question-title-emphasis: #2a79be;
  --focus: #2563eb;
  --danger: #b91c1c;
  --success: #047857;
  --shadow: 0 24px 70px rgba(24, 24, 27, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  color-scheme: light;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.62)),
    repeating-linear-gradient(135deg, transparent 0 7px, rgba(24, 24, 27, 0.03) 7px 8px),
    var(--background);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.form-shell {
  width: 100%;
  max-width: 980px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 20px;
  display: grid;
  place-items: center;
}

.form-card {
  width: 100%;
  min-width: 0;
  min-height: 620px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.form-topline,
.question-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.form-topline {
  align-items: center;
  padding-bottom: 64px;
  color: var(--muted);
  font-size: 0.9rem;
}

.brand-mark {
  width: 32px;
  height: 44px;
  display: block;
  object-fit: contain;
}

.brand-logo {
  width: min(280px, 58vw);
  height: auto;
  display: block;
}

.question-mark {
  flex: 0 0 auto;
  width: 24px;
  height: 32px;
}

.intro-layout {
  display: grid;
  width: 100%;
  min-width: 0;
}

.stack {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-title,
.screen-title {
  margin: 0;
  max-width: 100%;
  color: var(--foreground);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-title {
  font-size: clamp(2.35rem, 4.5vw, 3.35rem);
  line-height: 1.02;
}

.screen-title {
  font-size: clamp(1.85rem, 4vw, 3.15rem);
}

.question-title-emphasis {
  color: var(--question-title-emphasis);
}

.hero-copy,
.help-text,
.muted {
  margin: 0;
  color: var(--muted);
}

.hero-copy {
  max-width: 100%;
  font-size: 1.12rem;
  overflow-wrap: anywhere;
}

.help-text {
  max-width: 680px;
  font-size: 1rem;
}

.question-header .help-text {
  max-width: none;
  margin-top: 8px;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 28px;
}

.question-form > .actions {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  width: 100%;
  margin: 0;
  padding: 12px max(20px, calc((100vw - 940px) / 2 + 30px)) max(12px, env(safe-area-inset-bottom));
  align-items: center;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -18px 42px rgba(24, 24, 27, 0.1);
  backdrop-filter: blur(18px);
}

.actions-intro {
  justify-content: flex-start;
  padding-top: 0;
}

.disclosure {
  width: 100%;
  max-width: 100%;
  margin: auto 0 0;
  padding-top: 28px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.disclosure a {
  color: var(--foreground);
  font-weight: 650;
  text-underline-offset: 3px;
}

.button {
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 650;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:focus-visible,
.choice-card:has(input:focus-visible),
.rating-chip:has(input:focus-visible),
.text-field input:focus-visible,
.text-field select:focus-visible,
textarea:focus-visible,
.consent-check:has(input:focus-visible),
.icon-button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 2px;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-foreground);
}

.button-primary:hover {
  background: #27272a;
}

.button:disabled,
.button:disabled:hover {
  transform: none;
  border-color: var(--border);
  background: #e4e4e7;
  color: #71717a;
  opacity: 1;
}

.button-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--foreground);
}

.button-secondary:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.question-header {
  padding-bottom: 22px;
}

.question-header > div {
  min-width: 0;
}

.selection-count {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
}

.progress-track {
  width: 100%;
  height: 8px;
  margin-bottom: 28px;
  display: block;
  overflow: hidden;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #ececef;
}

.progress-track::-webkit-progress-bar {
  border-radius: inherit;
  background: #ececef;
}

.progress-track::-webkit-progress-value {
  border-radius: inherit;
  background: var(--foreground);
}

.progress-track::-moz-progress-bar {
  border-radius: inherit;
  background: var(--foreground);
}

.question-form {
  display: grid;
  gap: 20px;
  padding-bottom: 84px;
}

.choice-list {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.choice-card {
  position: relative;
  min-height: 64px;
  padding: 14px 14px 14px 48px;
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--foreground);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.choice-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-subtle);
}

.choice-card input,
.rating-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-indicator {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
}

.choice-card:has(input[type="checkbox"]) .choice-indicator {
  border-radius: 5px;
}

.choice-card:has(input:checked) {
  border-color: var(--foreground);
  background: #f4f4f5;
  box-shadow: inset 0 0 0 1px var(--foreground);
}

.choice-card:has(input:checked) .choice-indicator {
  border-color: var(--foreground);
  background: var(--foreground);
}

.choice-card:has(input:checked) .choice-indicator::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: var(--surface);
}

.choice-label {
  font-weight: 560;
}

.selection-count {
  width: fit-content;
}

.matrix {
  --rating-chip-width: 64px;
  --rating-gap: 8px;
  --rating-option-count: 5;
  --rating-options-width: 242px;
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 12px;
}

.matrix-scale {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) var(--rating-options-width);
  gap: 16px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 0.78rem;
}

.matrix-scale-options {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(var(--rating-option-count), var(--rating-chip-width));
  gap: var(--rating-gap);
  align-items: center;
}

.scale-start,
.scale-end {
  white-space: nowrap;
}

.scale-start {
  grid-column: 1;
  justify-self: start;
}

.scale-end {
  justify-self: end;
}

.matrix-row {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) var(--rating-options-width);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.matrix-row-label {
  min-width: 0;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.rating-options {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(var(--rating-option-count), var(--rating-chip-width));
  gap: var(--rating-gap);
}

.rating-chip {
  position: relative;
  width: var(--rating-chip-width);
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.star-label {
  color: inherit;
  font-size: 1.18rem;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.na-label {
  font-size: 0.86rem;
}

.rating-chip:hover {
  border-color: var(--border-strong);
}

.rating-star-chip {
  border-color: transparent;
  background: transparent;
  color: var(--muted-2);
  font-size: 1rem;
}

.rating-star-chip.is-filled {
  border-color: transparent;
  background: transparent;
  color: #f5b301;
}

.rating-star-chip:has(input:checked) {
  border-color: transparent;
  box-shadow: none;
  color: #f5b301;
}

.rating-star-chip:hover {
  border-color: transparent;
  background: transparent;
  color: #d97706;
}

.rating-na-chip:has(input:checked) {
  border-color: var(--foreground);
  background: var(--foreground);
  color: var(--accent-foreground);
}

.text-response textarea {
  width: 100%;
  resize: vertical;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--foreground);
  line-height: 1.5;
}

.text-response textarea::placeholder {
  color: var(--muted-2);
}

.inline-fields,
.text-group {
  display: grid;
  gap: 14px;
}

.text-field,
.text-response {
  display: grid;
  gap: 8px;
  color: var(--foreground);
  font-weight: 620;
}

.text-field input,
.text-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--foreground);
}

.text-field input::placeholder {
  color: var(--muted-2);
}

.rank-list {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.rank-item {
  min-height: 58px;
  padding: 10px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.rank-number {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--surface-subtle);
  color: var(--muted);
  font-weight: 750;
}

.rank-actions {
  display: flex;
  gap: 6px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--foreground);
}

.icon-button:disabled {
  color: var(--muted-2);
  background: var(--surface-subtle);
}

.form-error {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  background: #fef2f2;
  color: var(--danger);
  font-size: 0.94rem;
  font-weight: 620;
}

.completion {
  min-height: 540px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  text-align: center;
}

.follow-up-panel,
.follow-up-form {
  width: min(100%, 720px);
  margin-top: 8px;
  padding: 18px;
  display: grid;
  gap: 16px;
  justify-self: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  text-align: left;
}

.follow-up-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.consent-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 0.9rem;
}

.consent-check input {
  margin-top: 0.25rem;
}

.follow-up-actions {
  justify-content: flex-start;
  padding-top: 0;
}

.success-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--success);
  font-size: 1.5rem;
  font-weight: 800;
}

.answer-summary {
  margin-top: 8px;
  padding: 14px 18px;
  display: inline-grid;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.answer-summary span:first-child {
  font-size: 1.7rem;
  font-weight: 750;
}

.answer-summary span:last-child {
  color: var(--muted);
  font-size: 0.9rem;
}

.extension-actions {
  justify-content: center;
}

.loading-state {
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--foreground);
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

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

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .form-shell {
    padding: 14px;
    place-items: stretch;
  }

  .form-card {
    min-height: calc(100vh - 28px);
    padding: 22px;
    border-radius: 10px;
    font-size: 0.96rem;
  }

  .screen-title {
    font-size: clamp(1.75rem, 7.2vw, 2.45rem);
  }

  .hero-title {
    font-size: clamp(2.2rem, 10vw, 3rem);
    line-height: 1.04;
  }

  .help-text {
    font-size: 0.94rem;
  }

  .eyebrow {
    font-size: 0.76rem;
  }

  .form-topline {
    padding-bottom: 58px;
  }

  .choice-list,
  .follow-up-grid,
  .matrix-row {
    grid-template-columns: 1fr;
  }

  .matrix {
    gap: 10px;
  }

  .matrix-row {
    gap: 10px;
    padding: 12px;
  }

  .matrix-scale {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
  }

  .matrix-scale-options {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }

  .rating-options {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.35fr);
    gap: 6px;
  }

  .rating-chip {
    height: 34px;
    width: 100%;
  }

  .rating-na-chip {
    width: 100%;
  }

  .actions {
    flex-direction: column-reverse;
  }

  .question-form > .actions {
    flex-direction: row;
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
  }

  .question-form > .actions .button {
    width: auto;
  }

  .question-form > .actions .button-primary {
    flex: 1;
  }

  .actions-intro {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .form-card {
    padding: 18px;
  }

  .question-header {
    display: grid;
  }

  .choice-card {
    min-height: 58px;
  }

  .matrix-row {
    gap: 8px;
    padding: 10px;
  }

  .rating-options {
    gap: 4px;
  }

  .rating-chip {
    height: 32px;
  }
}

/* Student of the Week nomination flow */

.intro-next-step {
  margin-top: 34px;
  display: grid;
  gap: 20px;
}

.intro-notice {
  width: 100%;
  margin: 0;
  padding: 18px;
  display: grid;
  gap: 6px;
  border: 1px solid #dbeafe;
  border-radius: var(--radius);
  background: #f7fbff;
  color: #3f3f46;
  font-size: 0.88rem;
}

.intro-notice p {
  margin: 0;
}

.intro-notice-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.intro-notice a {
  width: fit-content;
  color: #1d4f7c;
  font-weight: 700;
  text-underline-offset: 3px;
}

.choice-list {
  width: 100%;
}

.choice-copy {
  font-weight: 560;
  line-height: 1.45;
}

.acknowledgment-list {
  grid-template-columns: 1fr;
}

.acknowledgment-list .choice-card {
  min-height: 82px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.question-resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.question-resource-links a {
  color: #1d4f7c;
  font-weight: 700;
  text-underline-offset: 3px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-wide {
  grid-column: 1 / -1;
}

.required-mark {
  color: var(--danger);
}

.text-field select {
  appearance: none;
  padding-right: 40px;
  background-image:
    linear-gradient(45deg, transparent 50%, #71717a 50%),
    linear-gradient(135deg, #71717a 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.response-meta {
  margin-top: -10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 620;
}

.word-counter {
  font-variant-numeric: tabular-nums;
}

.word-counter-over {
  color: var(--danger);
}

.state-mark {
  width: 40px;
  height: 54px;
}

.state-actions {
  justify-content: center;
}

.review-header {
  padding-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.review-form {
  display: grid;
  gap: 20px;
}

.review-list {
  display: grid;
  gap: 14px;
}

.review-item {
  padding: 20px;
  display: grid;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.review-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.review-item h2 {
  margin: 3px 0 0;
  font-size: 1.05rem;
  line-height: 1.35;
}

.review-group {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.edit-button {
  flex: 0 0 auto;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #1d4f7c;
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.review-fields {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 24px;
}

.review-fields div {
  min-width: 0;
}

.review-fields dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.review-fields dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.review-narrative {
  margin: 0;
  color: #3f3f46;
  line-height: 1.65;
  white-space: pre-wrap;
}

.review-checks {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  list-style: none;
}

.review-checks li {
  position: relative;
  padding-left: 26px;
  color: #3f3f46;
}

.review-checks li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 800;
}

.review-actions {
  justify-content: flex-end;
}

.confirmation-panel {
  width: min(100%, 560px);
  padding: 16px 18px;
  display: grid;
  gap: 3px;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  background: #f0fdf4;
  color: #065f46;
}

.confirmation-panel span {
  font-size: 0.9rem;
}

@media (max-width: 760px) {
  .form-grid,
  .review-fields {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .review-header {
    display: grid;
  }

  .review-item {
    padding: 16px;
  }

  .review-actions,
  .state-actions {
    flex-direction: column-reverse;
  }
}
