:root {
  --red: #be1014;
  --red-hover: #9b0b0f;
  --red-soft: #fff5f5;
  --navy: #152646;
  --ink: #1c2b42;
  --muted: #5d6877;
  --line: #e2d7d8;
  --line-light: #eee5e5;
  --bg: #f8f7f5;
  --white: #ffffff;
  --green: #11733c;
  --green-soft: #eef8f2;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 'Avenir Next', 'Segoe UI', Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.wrap {
  width: min(1060px, calc(100% - 40px));
  margin: auto;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.header-phone {
  font-weight: 800;
  white-space: nowrap;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.2;
}
.header-phone span {
  display: block;
  font-size: .62rem;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 700;
}
.header-back {
  font-weight: 700;
  color: var(--red);
  font-size: .92rem;
  padding: 6px 10px;
  border-radius: 4px;
  transition: background .18s;
}
.header-back:hover {
  background: var(--red-soft);
}

/* Intro */
.intro {
  padding: 50px 0 30px;
}
.eyebrow {
  color: var(--red);
  font-weight: 800;
  letter-spacing: .14em;
  font-size: .78rem;
  margin: 0 0 12px;
}
h1 {
  font-size: clamp(2.3rem, 4.2vw, 3.8rem);
  letter-spacing: -.045em;
  line-height: 1.12;
  margin: 0 0 16px;
  font-weight: 750;
  color: var(--ink);
}
.intro > p:last-child {
  max-width: 780px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
  margin: 0;
}

/* Shell / Container */
.test-shell {
  margin: 20px 0 40px;
}
.quiz-box, .contact-box, .result-box {
  background: #fff;
  border: 1px solid var(--line);
  padding: clamp(24px, 4vw, 44px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

/* Top Progress Bar & Meta */
.quiz-top {
  border-bottom: 1px solid var(--line-light);
  padding-bottom: 18px;
  margin-bottom: 20px;
}
.quiz-top-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
#question-count {
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--red);
  text-transform: uppercase;
}
.answered-badge {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  background: #f2edf0;
  padding: 4px 10px;
  border-radius: 12px;
}
.progress-bar-wrap {
  width: 100%;
}
progress {
  width: 100%;
  height: 8px;
  display: block;
  accent-color: var(--red);
  border-radius: 4px;
}
progress::-webkit-progress-bar {
  background-color: #f0e6e7;
  border-radius: 4px;
}
progress::-webkit-progress-value {
  background-color: var(--red);
  border-radius: 4px;
}

/* Question Navigator Grid / Strip */
.question-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 26px;
  padding: 10px;
  background: #faf7f7;
  border: 1px solid var(--line-light);
  border-radius: 6px;
  max-height: 140px;
  overflow-y: auto;
}
.q-pill {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #dcd1d2;
  background: #fff;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all .15s ease;
}
.q-pill:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fffafa;
}
.q-pill.is-current {
  border: 2px solid var(--red);
  color: var(--red);
  font-weight: 850;
  background: #fff;
}
.q-pill.is-answered {
  background: #edf7ef;
  border-color: #7ab88b;
  color: #175427;
}
.q-pill.is-answered.is-current {
  border: 2px solid var(--red);
  background: #edf7ef;
}

/* Question Content */
.question-type-tag {
  display: inline-block;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f0eaeb;
  padding: 4px 9px;
  border-radius: 3px;
  margin-bottom: 14px;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}
legend {
  font-size: clamp(1.28rem, 2.4vw, 1.7rem);
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: -.02em;
  margin-bottom: 24px;
  color: var(--ink);
  display: block;
  width: 100%;
}

/* Answers (Radio Choice) */
.answers-list {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}
.choice-label {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 1.05rem;
  transition: border-color .15s, background-color .15s, transform .12s;
}
.choice-label:hover {
  border-color: var(--red);
  background: var(--red-soft);
}
.choice-label:has(input:checked) {
  border-color: var(--red);
  background: #fff5f5;
  box-shadow: 0 0 0 1px var(--red);
}
.choice-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1e9ea;
  font-size: .85rem;
  font-weight: 800;
  color: var(--ink);
  flex-shrink: 0;
}
.choice-label:has(input:checked) .choice-letter {
  background: var(--red);
  color: #fff;
}
.choice-label input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--red);
  flex-shrink: 0;
  margin: 0;
}
.choice-text {
  flex: 1;
}

/* Answers (Text Fill-In) */
.text-answer-box {
  margin: 20px 0 26px;
}
.text-answer-box label {
  display: block;
  font-size: .92rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--muted);
}
.text-answer-box input[type="text"] {
  width: 100%;
  max-width: 520px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 1.12rem;
  color: var(--ink);
  background: #fff;
}
.text-answer-box input[type="text"]:focus {
  border-color: var(--red);
  outline: 3px solid #ffccd0;
}

/* Answers (Writing Task) */
.writing-box {
  margin: 20px 0 26px;
}
.writing-instructions {
  background: #fbf8f5;
  border-left: 4px solid var(--red);
  padding: 14px 18px;
  margin-bottom: 16px;
  border-radius: 0 6px 6px 0;
}
.writing-instructions p {
  margin: 0;
  font-size: .95rem;
  color: var(--ink);
}
.writing-box textarea {
  width: 100%;
  min-height: 160px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}
.writing-box textarea:focus {
  border-color: var(--red);
  outline: 3px solid #ffccd0;
}
.writing-meta {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Action Buttons */
.quiz-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  border-top: 1px solid var(--line-light);
  padding-top: 20px;
}
.quiz-actions-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  font-weight: 750;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all .16s ease;
  font-size: 1rem;
}
.btn.primary {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.btn.primary:hover {
  background: var(--red-hover);
  border-color: var(--red-hover);
  transform: translateY(-1px);
}
.btn.secondary {
  background: #fff;
  color: var(--red);
  border-color: var(--line);
}
.btn.secondary:hover {
  border-color: var(--red);
  background: var(--red-soft);
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 8px 12px;
}
.btn.ghost:hover {
  color: var(--red);
}
.btn.btn-large {
  min-height: 52px;
  padding: 14px 32px;
  font-size: 1.08rem;
}
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
}

.quiz-error {
  color: var(--red);
  font-weight: 700;
  font-size: .92rem;
  margin: 12px 0 0;
  min-height: 1.4em;
}
.quiz-error:empty {
  display: none;
}

/* Contact Step Box */
.contact-header {
  border-bottom: 1px solid var(--line-light);
  padding-bottom: 22px;
  margin-bottom: 24px;
}
.badge-step {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  padding: 4px 10px;
  border-radius: 3px;
  margin-bottom: 12px;
}
.contact-header h2 {
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  font-weight: 750;
  letter-spacing: -.035em;
  margin: 0 0 10px;
  color: var(--ink);
}
.contact-header p {
  color: var(--muted);
  font-size: 1.02rem;
  margin: 0;
  max-width: 720px;
}

.test-summary-preview {
  background: #f7faf8;
  border: 1px solid #c9e4d0;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.test-summary-preview strong {
  color: #125828;
  font-size: 1.02rem;
}
.test-summary-preview span {
  color: #246a3a;
  font-size: .92rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full-width {
  grid-column: 1 / -1;
}
.form-group label {
  font-weight: 750;
  font-size: .95rem;
  color: var(--ink);
}
.req {
  color: var(--red);
}
.form-group input, .form-group select {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--red);
  outline: 3px solid #ffd0d3;
}
.field-help {
  font-size: .8rem;
  color: var(--muted);
}
.field-error {
  font-size: .82rem;
  color: var(--red);
  font-weight: 600;
  min-height: 1.2em;
}
.field-error:empty {
  display: none;
}

.rodo-box {
  background: #fdfafa;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 20px;
  margin-top: 10px;
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  font-size: .88rem;
  line-height: 1.55;
  color: var(--ink);
}
.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--red);
  margin-top: 3px;
  flex-shrink: 0;
}
.checkbox-text strong {
  color: var(--ink);
  font-size: .95rem;
}
.checkbox-text a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
}

.contact-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 30px;
  border-top: 1px solid var(--line-light);
  padding-top: 22px;
}

/* Result Screen */
.result-box h2 {
  font-size: clamp(2rem, 3.5vw, 2.9rem);
  letter-spacing: -.04em;
  margin: 0 0 12px;
  color: var(--ink);
}
.result-success-banner {
  background: #eef9f2;
  border: 1px solid #71c28c;
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 30px;
}
.result-success-banner h3 {
  color: #116832;
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 750;
}
.result-success-banner p {
  color: #1d5330;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.55;
}
.score-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 28px 0;
}
.score-card {
  background: #faf7f7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 20px;
  text-align: center;
}
.score-card-label {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.score-card-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1.1;
}
.score-card-value.level {
  font-size: 1.8rem;
  color: var(--navy);
}

.next-steps-card {
  background: #fbfbfb;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 32px;
}
.next-steps-card h4 {
  font-size: 1.25rem;
  margin: 0 0 12px;
  color: var(--ink);
}
.next-steps-card ol {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  line-height: 1.6;
}
.next-steps-card li {
  margin-bottom: 8px;
}

.result-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

/* Answers Review Accordion */
.answers-review-section {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  margin-top: 30px;
}
.answers-review-section h3 {
  font-size: 1.35rem;
  margin: 0 0 16px;
  color: var(--ink);
}
.review-item {
  border-top: 1px solid var(--line-light);
  padding: 14px 0;
  font-size: .95rem;
}
.review-item strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
}
.review-ans {
  margin: 3px 0;
  font-size: .92rem;
}
.review-ans.correct {
  color: var(--green);
  font-weight: 700;
}
.review-ans.wrong {
  color: var(--red);
}

/* Note */
.test-note {
  color: var(--muted);
  font-size: .9rem;
  margin: 24px 0 60px;
  line-height: 1.5;
  text-align: center;
}

/* Footer matching Enjoy School */
.site-footer {
  background: var(--red);
  color: #fff;
  padding: 60px 0 25px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand {
  display: inline-block;
  margin-bottom: 12px;
}
.site-footer p {
  color: #ffe6e8;
  font-size: .94rem;
  line-height: 1.55;
  margin: 0 0 12px;
}
.site-footer a {
  color: #fff;
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: .95rem;
}
.site-footer a:hover {
  color: #ffd9b7;
  text-decoration: underline;
}
.site-footer h2 {
  font-size: 1.18rem;
  letter-spacing: -.02em;
  margin: 0 0 14px;
  font-weight: 750;
  color: #fff;
}
.footer-small {
  font-size: .8rem !important;
  color: #fbd6da !important;
  margin-top: 12px !important;
}
.footer-links a {
  margin-bottom: 10px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  padding-top: 20px;
  font-size: .85rem;
  color: #fbd6da;
}
.footer-bottom a {
  display: inline-block;
  margin: 0;
}

/* Focus states */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #087ca7;
  outline-offset: 3px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .header-inner {
    min-height: 72px;
  }
  .header-right {
    gap: 12px;
  }
  .header-phone {
    font-size: .82rem;
  }
  .header-back {
    font-size: .8rem;
  }
  .intro {
    padding: 35px 0 20px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .quiz-actions, .contact-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .quiz-actions-right {
    flex-direction: column;
    width: 100%;
  }
  .btn {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

