:root {
  --input-border: #cbd5e1;
  --input-placeholder: #64748b;
  --input-focus: #6554f5;
  --input-ink: #0f172a;
  --input-radius: 14px;
  --input-height: 52px;
}

/* Presentation-only normalization of existing form wrappers. Specialized controls
   (numbers, colors, toggles, uploads, ranges and compact search) stay untouched. */
:root body :is(.field, .question-list-field, .question-field, .studio-field, .builder-title-editor, .builder-custom-field, .host-setup-team-row, .auth-card, .recovery-panel, .sample-guess-field, .classroom-student-page, .join-code-form)
  :is(input:where(:not([type]), [type="text"], [type="email"], [type="password"], [type="url"], [type="tel"]), textarea),
:root body .auth-card select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--input-border);
  border-radius: var(--input-radius);
  padding: 13px 15px;
  color: var(--input-ink);
  background: #fff;
  box-shadow: none;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

:root body :is(.field, .question-list-field, .question-field, .studio-field, .builder-title-editor, .builder-custom-field, .host-setup-team-row, .auth-card, .recovery-panel, .sample-guess-field, .classroom-student-page, .join-code-form)
  input:where(:not([type]), [type="text"], [type="email"], [type="password"], [type="url"], [type="tel"]),
:root body .auth-card select {
  height: var(--input-height);
  min-height: var(--input-height);
}

:root body :is(.field, .question-list-field, .question-field, .studio-field, .builder-title-editor, .builder-custom-field, .host-setup-team-row, .auth-card, .recovery-panel, .sample-guess-field, .classroom-student-page, .join-code-form)
  :is(input, textarea)::placeholder {
  color: var(--input-placeholder);
  font-size: 16px;
  font-weight: 400;
  opacity: 1;
  letter-spacing: 0;
}

:root body :is(.field, .question-list-field, .question-field, .studio-field, .builder-title-editor, .builder-custom-field, .host-setup-team-row, .auth-card, .recovery-panel, .sample-guess-field, .classroom-student-page, .join-code-form)
  :is(input:where(:not([type]), [type="text"], [type="email"], [type="password"], [type="url"], [type="tel"]), textarea):focus,
:root body .auth-card select:focus {
  border-color: var(--input-focus);
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgb(101 84 245 / 14%);
}

:root body :is(.field, .question-list-field, .question-field, .studio-field, .builder-title-editor, .builder-custom-field, .host-setup-team-row, .auth-card, .recovery-panel, .sample-guess-field, .classroom-student-page, .join-code-form)
  :is(input:where(:not([type]), [type="text"], [type="email"], [type="password"], [type="url"], [type="tel"]), textarea):is([aria-invalid="true"], :user-invalid),
:root body .question-list-row.has-error .question-list-field :is(input, textarea) {
  border-color: #b42318;
}

:root body :is(.field, .question-list-field, .question-field, .studio-field, .builder-title-editor, .builder-custom-field, .host-setup-team-row, .auth-card, .recovery-panel, .sample-guess-field, .classroom-student-page, .join-code-form)
  :is(input:where(:not([type]), [type="text"], [type="email"], [type="password"], [type="url"], [type="tel"]), textarea):disabled,
:root body .auth-card select:disabled {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
  opacity: 1;
  cursor: not-allowed;
}

:root body :is(.field, .question-list-field, .question-field, .studio-field) {
  gap: 8px;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
}
:root body :is(.field, .question-list-field, .question-field, .studio-field) > :is(label, span),
:root body :is(.recovery-panel, .join-code-form) label {
  color: var(--input-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
}
:root body .auth-card .field { margin-top: 18px; }
:root body .auth-card .field .input-help {
  margin: 0;
  color: #52627a;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}
:root body .auth-card { min-width: 0; }
:root body .auth-email-choice { min-width: 0; }
:root body .auth-intro-card h1 { overflow-wrap: anywhere; }
:root body .auth-card [role="alert"] { color: #b42318; }

/* The row remains the drag target; its dashed blank-state border was decorative. */
:root body .question-list-row {
  grid-template-columns: 36px minmax(0, 1fr);
  border: 0;
  padding: 8px 0;
  background: transparent;
  box-shadow: none;
}
:root body .question-row-number {
  width: 36px;
  height: 36px;
  font-size: 15px;
  font-weight: 700;
}
:root body .question-list-editor.is-classic-mode .question-list-field { grid-column: 2; }
:root body .question-list-row.has-error { background: #fff8f5; }
:root body .game-details-step .builder-title-editor {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

@media (max-width: 760px) {
  :root body .question-list-editor.is-host-mode .question-list-row { grid-template-columns: 36px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  :root body :is(.field, .question-list-field, .question-field, .studio-field, .builder-title-editor, .builder-custom-field, .host-setup-team-row, .auth-card, .recovery-panel, .sample-guess-field, .classroom-student-page, .join-code-form) :is(input, textarea, select) { transition: none; }
}
@media (forced-colors: active) {
  :root body :is(.field, .question-list-field, .question-field, .studio-field, .builder-title-editor, .builder-custom-field, .host-setup-team-row, .auth-card, .recovery-panel, .sample-guess-field, .classroom-student-page, .join-code-form) :is(input, textarea, select):focus { outline-color: Highlight; }
}
