/* path: app/styles.css */
:root {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #0f172a;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: #f6f7f9;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  box-sizing: border-box;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 20px;
  width: 100%;
}

h1 {
  margin: 0 0 16px;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.runtime-banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #f4d7a7;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font-size: 14px;
  line-height: 1.45;
}

.runtime-banner strong {
  font-weight: 700;
}

h2 {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 600;
}

h3 {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
}

.card {
  background: #fff;
  border: 1px solid #e6e8ee;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.done-screen {
  display: grid;
  gap: 16px;
}

.done-visual {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px solid #e6e8ee;
}

.done-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: #0f172a;
  box-sizing: border-box;
}

.done-icon.is-saving,
.done-icon.is-confirming {
  border: 3px solid rgba(15, 23, 42, 0.16);
  border-top-color: #0f172a;
  border-right-color: #0f172a;
  animation: done-spin 0.9s linear infinite;
}

.done-icon.is-saving::before,
.done-icon.is-confirming::before {
  content: "";
}

.done-icon.is-saved {
  background: #ecfdf5;
  color: #166534;
}

.done-icon.is-saved::before {
  content: "✓";
}

.done-icon.is-unstable {
  background: #fffbeb;
  color: #9a6700;
}

.done-icon.is-unstable::before {
  content: "!";
}

.done-icon.is-failed {
  background: #fff1f2;
  color: #b91c1c;
}

.done-icon.is-failed::before {
  content: "!";
}

.done-status {
  margin-top: 0;
}

.done-note {
  margin-bottom: 0;
}

.done-support {
  display: grid;
  gap: 6px;
  padding-top: 16px;
  margin-top: 6px;
  border-top: 1px solid #e6e8ee;
}

.done-support-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9a3412;
}

.done-support-email {
  width: fit-content;
  color: #b91c1c;
  font-size: 22px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.done-reload {
  width: fit-content;
  min-width: 0;
  padding-left: 18px;
  padding-right: 18px;
}

.done-reload.is-wide {
  width: 100%;
  justify-self: stretch;
}

.done-screen[data-state="unstable"] .done-support {
  display: none;
}

@keyframes done-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.form-field,
label {
  display: block;
  margin: 0 0 22px;
  font-size: 16px;
  color: #334155;
}

.form-field > span {
  display: block;
  margin-bottom: 5px;
}

input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin-top: 0;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  background: #fff;
  transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

input.is-filled {
  background: #fff;
  border-color: #d1d5db;
}

/* Keep filled/autofilled fields visually identical to default state. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:active {
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a;
  border: 1px solid #d1d5db !important;
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  box-shadow: 0 0 0 1000px #fff inset !important;
  background-color: #fff !important;
  transition: background-color 9999s ease-out 0s !important;
}

input:-webkit-autofill:focus {
  -webkit-text-fill-color: #0f172a !important;
  caret-color: #0f172a;
  border: 1px solid #3b82f6 !important;
  -webkit-box-shadow:
    0 0 0 1000px #fff inset !important,
    0 0 0 2px rgba(59, 130, 246, 0.2) !important;
  box-shadow:
    0 0 0 1000px #fff inset !important,
    0 0 0 2px rgba(59, 130, 246, 0.2) !important;
  background-color: #fff !important;
  transition: background-color 9999s ease-out 0s !important;
}

input:-moz-autofill {
  box-shadow: 0 0 0 1000px #fff inset !important;
  -moz-text-fill-color: #0f172a !important;
  border: 1px solid #d1d5db !important;
}

input:-moz-autofill:focus {
  box-shadow:
    0 0 0 1000px #fff inset,
    0 0 0 2px rgba(59, 130, 246, 0.2) !important;
  border: 1px solid #3b82f6 !important;
}

input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-field.error input {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.field-error-text {
  display: block;
  margin-top: 6px;
  color: #b91c1c;
  font-size: 14px;
  line-height: 1.35;
}

.intro-status {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.intro-status[data-tone="ready"] {
  color: #166534;
}

.intro-status[data-tone="warning"] {
  color: #9a6700;
}

.intro-status[data-tone="error"] {
  padding: 12px 14px;
  border: 1px solid #f2d1d5;
  border-radius: 12px;
  background: #fff9fa;
  color: #991b1b;
}

.intro-status[data-tone="pending"] {
  color: #475569;
}

.intro-status[data-tone="info"] {
  color: #475569;
}

.intro-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
}

.intro-status-marker {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #94a3b8;
  flex: 0 0 auto;
}

.intro-status[data-tone="ready"] .intro-status-marker {
  background: #16a34a;
}

.intro-status[data-tone="warning"] .intro-status-marker {
  background: #d97706;
}

.intro-status[data-tone="error"] .intro-status-marker {
  background: #dc2626;
}

.intro-status[data-tone="pending"] .intro-status-marker,
.intro-status[data-tone="info"] .intro-status-marker {
  background: #64748b;
}

.intro-status-summary {
  margin: 0;
  color: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  flex: 1 1 auto;
}

.intro-status-list {
  list-style: none;
  margin: 8px 0 0 18px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.intro-status-item {
  display: block;
  color: #526173;
  font-size: 13px;
  line-height: 1.35;
}

.intro-status-item.is-warning {
  color: #9a6700;
}

.intro-status-item.is-error {
  color: #b91c1c;
}

.intro-status-item.is-info,
.intro-status-item.is-pending,
.intro-status-item.is-ok {
  color: #526173;
}

.intro-status-action {
  margin-left: auto;
  padding: 0;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.intro-status-action:hover {
  background: transparent;
  color: #111827;
}

button {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 16px;
  cursor: pointer;
  min-width: 120px;
}

button:hover {
  background: #f8fafc;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.primary:disabled {
  background: #94a3b8;
  border-color: #94a3b8;
  color: #f8fafc;
  opacity: 0.5;
}

.primary:disabled:hover {
  background: #94a3b8;
  border-color: #94a3b8;
}

.primary {
  border-color: #0f172a;
  background: #0f172a;
  color: #fff;
}

.primary:hover {
  background: #111827;
}

.errors {
  margin-bottom: 16px;
  padding: 12px;
  background: #fff;
  border: 1px solid #fecaca;
  color: #991b1b;
  border-radius: 12px;
}
.notice {
  margin-bottom: 16px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #dbe4ee;
  color: #334155;
  border-radius: 12px;
}
.instructions {
  margin: 10px 0 18px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #334155;
  font-size: 16px;
  line-height: 1.55;
}
.instructions p {
  margin: 0 0 10px;
}
.instructions p:last-child {
  margin-bottom: 0;
}

#screen-instructions .instructions-text {
  margin: 0 0 12px;
  max-width: 62ch;
  font-size: 16px;
  line-height: 1.55;
  color: #334155;
}

#screen-form {
  display: flex;
  flex-direction: column;
}

#screen-form label {
  margin: 0 0 22px;
}

#screen-form button {
  align-self: flex-end;
}

.form-actions {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-top: 8px;
}

.form-actions .primary {
  flex: 0 0 auto;
  min-width: 156px;
}

#screen-question h3 {
  margin-bottom: 14px;
}

.progress {
  font-size: 16px;
  color: #334155;
  font-weight: 600;
  margin-bottom: 12px;
}

.answers {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0 0 38px;
}

.answer-btn {
  min-width: 0;
  text-align: left;
  padding: 17px 16px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #fff;
  line-height: 1.4;
  font-size: 20px;
  font-weight: 500;
  min-height: 68px;
}

.answer-btn.selected {
  border-color: #0f172a;
  background: #f1f5f9;
  box-shadow: inset 0 0 0 1px #0f172a;
}

.nav {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 0;
  align-items: center;
}

#screen-instructions .nav button {
  min-width: 190px;
}

.done-note {
  margin-top: 18px;
}

@media (max-width: 640px) {
  body {
    align-items: flex-start;
    padding-top: 24px;
  }
  .container { padding: 20px 14px; }
  h1 { font-size: 28px; }
  h2 { font-size: 24px; }
  h3 { font-size: 22px; }
  .card { padding: 18px; }
  .answer-btn { font-size: 18px; }
  #screen-form button { align-self: stretch; }
  .form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .intro-status {
    width: 100%;
  }
  .intro-status-row {
    align-items: flex-start;
  }
  .intro-status-action {
    margin-left: 0;
  }
  .nav {
    justify-content: stretch;
    flex-direction: column-reverse;
  }
  .nav button { width: 100%; }
}

/* Visual language shared with the Prof-Code landing and report. */
:root { font-family: Inter, Arial, sans-serif; color: #1f2512; font-synthesis: none; }
* { box-sizing: border-box; }
body { display: block; padding: 0; min-height: 100vh; line-height: normal; color: #1f2512; background: #fff url('./background.png') center bottom / cover fixed no-repeat; }
.site-header, .site-footer { max-width: 1320px; margin: auto; padding: 27px 5%; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.site-header { border-bottom: 1px solid #dce8c5; font-size: 13px; font-weight: 600; }
.container { max-width: 1220px; width: 100%; margin: auto; padding: 55px 5% 65px; display: grid; grid-template-columns: minmax(240px,.82fr) minmax(0,1.18fr); gap: 9%; align-items: start; }
.intro-side h1 { font-size: clamp(38px,4.5vw,62px); line-height: .98; letter-spacing: -.055em; font-weight: 700; margin: 25px 0; }
.intro-side h1 em { color: #7da91b; font-style: normal; }
.intro-side p { max-width: 330px; color: #59634b; line-height: 1.6; }
.eyebrow { display: flex; gap: 10px; align-items: center; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow span { width: 9px; height: 9px; background: #abe52c; border-radius: 50%; }
.facts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.facts span { background: #eaf8c9; border-radius: 50px; padding: 10px 15px; font-size: 12px; font-weight: 700; }
.content { min-width: 0; }
.card { border: 1px solid #e3ebd7; border-radius: 26px; padding: clamp(24px,4vw,48px); box-shadow: 0 18px 55px #35431a0a; }
.card-top { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 32px; color: #667254; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.card-top span + span { color: #849079; font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; }
h2, h3 { color: #1f2512; font-size: clamp(27px,3vw,38px); line-height: 1.1; letter-spacing: -.045em; font-weight: 700; margin: 0 0 14px; }
.lead { color: #69735e; line-height: 1.55; font-size: 15px; margin: 0 0 28px; }
.form-field, label { font-size: 13px; font-weight: 700; color: #1f2512; }
input { font-family: inherit; font-size: 13px; font-weight: 700; line-height: normal; border: 1px solid #dfe7d6; border-radius: 12px; padding: 15px; background: #fbfcf9; color: #1f2512; }
input:focus { border-color: #86b925; box-shadow: 0 0 0 3px #abe52c40; }
button { font-family: inherit; line-height: normal; border: 0; border-radius: 99px; padding: 16px 25px; min-height: 52px; background: #f2f5ee; color: #1f2512; font-size: 14px; font-weight: 800; }
button:hover { background: #eaf1e2; }
button:focus-visible, a:focus-visible { outline: 3px solid #6a921e; outline-offset: 3px; }
.primary { background: #abe52c; color: #1f2512; }
.primary:hover { background: #b9ed49; }
.primary:disabled, .primary:disabled:hover { background: #abe52c; color: #1f2512; opacity: .45; }
.intro-status { padding: 13px 15px; border-radius: 12px; background: #f1fbdb; }
.intro-status[data-tone="pending"], .intro-status[data-tone="info"] { color: #526173; }
.intro-status[data-tone="ready"] { color: #4e6432; }
.intro-status-action { min-height: 0; padding: 0; color: inherit; }
.intro-status-action:hover { background: transparent; }
#screen-instructions .instructions-text { color: #4d5844; }
.progress { font-size: 13px; color: #1f2512; margin-bottom: 10px; }
.progress-track { height: 6px; background: #edf2e8; border-radius: 8px; overflow: hidden; margin-bottom: 36px; }
.progress-track div { height: 100%; background: #abe52c; border-radius: inherit; }
.answers { margin: 28px 0; }
.answer-btn { display: flex; align-items: center; gap: 15px; font-size: 16px; min-height: 0; border-radius: 15px; padding: 18px; color: #1f2512; background: #fbfcf9; border: 1px solid #e0e8d8; font-weight: 600; }
.answer-btn::before { box-sizing: border-box; content: ''; width: 21px; height: 21px; flex: none; border: 1.5px solid #b9c5ad; border-radius: 50%; }
.answer-btn:hover { background: #fbfcf9; }
.answer-btn.selected, .answer-btn.selected:hover { background: #f1fbdb; border-color: #8ebd2c; box-shadow: none; }
.answer-btn.selected::before { border: 6px solid #86b91f; background: white; }
.done-visual { background: #eaf8c9; border: 0; border-radius: 50%; }
.done-icon.is-saved { background: transparent; color: #598917; }
.site-footer { border-top: 1px solid #dce8c5; color: #7d8970; font-size: 12px; padding-bottom: 35px; }
.site-footer a { color: inherit; }
@media(max-width:700px) {
 .site-header { padding: 20px 6%; font-size: 11px; }
 .container { grid-template-columns: 1fr; gap: 25px; padding: 35px 5% 45px; }
 .intro-side h1 { font-size: 42px; margin: 18px 0 12px; }
 .intro-side p { font-size: 14px; margin: 0; }
 .facts { margin-top: 20px; }
 .card { border-radius: 20px; padding: 25px; }
 .card-top { margin-bottom: 25px; }
 .progress-track { margin-bottom: 26px; }
 .form-actions { flex-direction: column; align-items: stretch; }
 #screen-form button { align-self: stretch; }
 .nav { flex-direction: column-reverse; align-items: stretch; }
 .nav button { width: 100%; }
 .site-footer { align-items: flex-start; flex-direction: column; }
}

/* Instruction content and layout follow the approved prototype. */
.instruction-list { counter-reset: instruction; list-style: none; padding: 0; margin: 27px 0; display: grid; gap: 16px; }
.instruction-list li { counter-increment: instruction; display: flex; gap: 15px; align-items: flex-start; line-height: 1.5; font-size: 15px; color: #4d5844; }
.instruction-list li::before { content: counter(instruction); flex: none; width: 30px; height: 30px; border-radius: 50%; background: #eaf8c9; display: grid; place-items: center; color: #527919; font-weight: 800; }
.instruction-tip { margin: 22px 0; padding: 13px 15px; border-radius: 12px; background: #f1fbdb; color: #4e6432; font-size: 13px; }
.instruction-tip::before { content: '●'; color: #7fad22; margin-right: 8px; }
#screen-instructions .nav { justify-content: space-between; gap: 14px; margin-top: 28px; }
#screen-instructions .nav button { min-width: 0; }
.button-arrow { margin-left: 24px; font-size: 18px; }

/* Form and question layout from the approved prototype. */
.form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
#screen-form .form-fields label { margin: 0; min-width: 0; }
.form-field-full { grid-column: 1 / -1; }
.form-field > span small { color: #8a9580; font-weight: 400; }
#screen-form .intro-status { margin: 22px 0; }
.form-actions { align-items: center; justify-content: space-between; margin-top: 6px; }
.required-hint { font-size: 12px; line-height: 1.5; color: #8a9580; }
.progress { display: flex; justify-content: space-between; gap: 12px; }
#screen-question .nav { justify-content: space-between; }
@media (max-width: 700px) {
 .form-fields { grid-template-columns: 1fr; }
 .form-field-full { grid-column: auto; }
 .form-actions { flex-direction: column-reverse; align-items: stretch; }
}

/* Match the prototype while retaining live status and validation states. */
#btn-start { min-width: 0; }
#btn-start::after { content: " ↗"; margin-left: 24px; font-size: 18px; }
#screen-form .form-actions { gap: 14px; margin-top: 6px; }
#screen-form .form-field > span { margin-bottom: 8px; }
#screen-form .intro-status-summary { font-size: 13px; font-weight: 400; line-height: normal; }
#screen-form .intro-status-list:empty { display: none; }
.done-visual { width: 64px; height: 64px; }
@media (max-width: 700px) { #screen-form .form-actions #btn-start { width: 100%; } }

/* Specific overrides for the active, accessible screens. */
#screen-question .progress { font-weight: 700; }
#screen-question .nav button { min-width: 0; }
#screen-done[data-state="saved"] { display: block; }
#screen-done[data-state="saved"] .done-visual { display: grid; place-items: center; margin-bottom: 25px; }
#screen-done[data-state="saved"] .done-icon.is-saved { font-size: 32px; }
#screen-done[data-state="saved"] .done-status,
#screen-done[data-state="saved"] .done-note { color: #69735e; line-height: 1.55; font-size: 15px; margin: 0 0 28px; }
#screen-done[data-state="saved"] .done-note:empty,
#screen-done[data-state="saved"] .done-status:empty { display: none; }

#screen-form .intro-status[data-tone="ready"] { font-size: 13px; }
#screen-form .intro-status[data-tone="ready"] .intro-status-row { min-height: 0; }
#screen-form .intro-status[data-tone="ready"] .intro-status-marker { width: 9px; height: 9px; background: #7fad22; }
