/* Only the test's two pages load this file, so the other pages stay light. */
.quiz-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.quiz-facts li { padding: 4px 14px; background: var(--gray); border-radius: 4px; }
.quiz { margin-top: 20px; }
.quiz-progress { position: sticky; top: var(--bar); z-index: 5; padding: 10px 0 6px; background: #fff; }
.quiz-progress p { font-size: 15px; color: var(--soft); }
.quiz progress, .quiz-result progress { width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--gray); overflow: hidden; appearance: none; }
progress::-webkit-progress-bar { background: var(--gray); }
progress::-webkit-progress-value { background: var(--red); }
progress::-moz-progress-bar { background: var(--red); }
.q-step { margin-bottom: 24px; }
.q-step > .small { margin-top: 4px; }
.q { min-width: 0; margin: 0; padding: 18px 0; border: 0; border-bottom: 1px solid var(--line); }
.q legend { float: inline-start; width: 100%; margin-bottom: 10px; padding: 0; font-weight: 600; }
.q legend + div { clear: both; }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scale label, .options label { position: relative; display: flex; cursor: pointer; }
.scale input, .options input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale span, .options span { display: grid; place-items: center; width: 100%; min-height: 52px; padding: 6px 4px; border: 1px solid #8c8c8c; border-radius: 4px; text-align: center; font-size: 15px; line-height: 1.4; }
.scale label:hover span, .options label:hover span { border-color: var(--red); background: #fbeaea; }
.scale input:checked + span, .options input:checked + span { border-color: var(--red); background: var(--red); color: #fff; font-weight: 700; }
.scale input:focus-visible + span, .options input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
.q.bad legend { color: var(--red-dark); }
.q.bad legend::after { content: " (لم تجب)"; font-size: 15px; }
.quiz .form-nav { margin-top: 20px; }
.contact > .small { margin: 4px 0 20px; }

.quiz-result { padding-bottom: 56px; }
.quiz-result > section { padding-top: 32px; }
.quiz-result .alert { margin: 16px 0 0; }
.meters { display: grid; gap: 10px; margin: 16px 0 24px; }
.meters li { display: grid; grid-template-columns: 90px 1fr 52px; gap: 12px; align-items: center; }
.meters b { font-variant-numeric: tabular-nums; }
.type { margin-bottom: 16px; padding: 20px 24px; background: var(--gray); border-bottom: 5px solid var(--red); }
.type h3 small { font-weight: 400; color: var(--soft); }
.matches { display: grid; gap: 14px; margin-block: 16px 12px; }
.matches li { padding: 18px 20px; border: 1px solid var(--line); border-radius: 4px; }
.matches h3 a { display: inline-flex; align-items: center; min-height: 44px; }
.fit { display: grid; grid-template-columns: minmax(80px, 220px) auto; gap: 12px; align-items: center; margin-block: 4px; font-size: 15px; }
.areas { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-block: 6px; }
.next .form-nav { flex-wrap: wrap; margin-block: 12px; }
/* Sharing a result */
.share-jump { margin-top: 16px; }
.share-jump .more { margin: 0; }
.share-result { scroll-margin-top: var(--bar); }
.share-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 14px 18px; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 22px; border: 0; border-radius: 4px; color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.share-btn:hover { filter: brightness(.9); color: #fff; text-decoration: none; }
.share-btn svg { flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.share-btn svg .fill { fill: currentColor; stroke: none; }
.share-btn.whatsapp { background: #0f7a5a; }
.share-btn.facebook { background: #1264d1; }
.share-btn.other { background: #191919; }
.copy-row { display: flex; gap: 8px; margin-top: 6px; }
.copy-row input { flex: 1; min-width: 0; min-height: 48px; padding: 8px 12px; border: 1px solid #8c8c8c; border-radius: 4px; background: var(--gray); color: inherit; font: inherit; font-size: 16px; text-align: left; }
.copy-row .btn { flex: none; }
.copy-state { min-height: 1.8em; margin-block: 6px; color: #1f6b30; font-weight: 700; }

.quiz .intro { margin-bottom: 10px; }
.timer { font-weight: 700; }
.time-up [data-next], .time-up [data-back] { display: none; }
.matrix { clear: both; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; max-width: 420px; margin-bottom: 14px; padding: 4px; background: var(--line); }
.matrix > div { display: grid; place-items: center; min-height: 56px; padding: 6px; background: #fff; }
.matrix .gap { font-size: 28px; font-weight: 800; color: var(--red); }
.shape { display: block; width: 100%; max-width: 130px; height: auto; }
.pictures span { padding: 8px; }
.options.pictures input:checked + span { background: #fbeaea; box-shadow: inset 0 0 0 3px var(--red); }
.test-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-block: 14px 36px; }
.test-cards a { display: flex; flex-direction: column; height: 100%; background: var(--gray); border-bottom: 5px solid var(--red); color: inherit; text-decoration: none; }
.test-cards img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.test-cards a > span { display: grid; gap: 6px; align-content: start; padding: 16px 20px 20px; }
.test-cards a:hover h3 { color: var(--red-dark); text-decoration: underline; }
.test-cards small { color: var(--soft); }
.score { font-size: 20px; }
.score strong { display: block; font-size: 40px; color: var(--red-dark); line-height: 1.4; }
.axis { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; margin-block: 8px; font-size: 15px; }
.careers { padding-inline-start: 22px; list-style: decimal; }
.review summary { color: var(--red-dark); }
.review.ok summary { color: #1f6b30; }
.review > * { margin-bottom: 10px; }
.given > span:first-child { font-weight: 700; }
.given .shape { max-width: 160px; }

.test-hero .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding-block: 24px 48px; }
.test-hero h1 { font-size: clamp(28px, 3.4vw, 44px); font-weight: 800; line-height: 1.45; }
.test-hero h1 span { display: block; color: var(--red-dark); }
.test-hero p { max-width: 52ch; margin-block: 14px 20px; }
.test-hero .small { margin-block: 10px 0; }
.test-hero img { width: 100%; border-radius: 8px; }
.center { margin-bottom: 24px; text-align: center; }
.numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.numbers li { display: grid; flex: 1 1 150px; max-width: 220px; justify-items: center; padding: 18px 12px; background: #fff; border-bottom: 5px solid var(--red); text-align: center; line-height: 1.6; }
.numbers strong { font-size: 34px; color: var(--red-dark); }
.line-steps { display: grid; grid-template-columns: repeat(4, 1fr); }
.line-steps li { position: relative; display: grid; justify-items: center; gap: 22px; text-align: center; }
.line-steps li::before { content: ""; position: absolute; top: 58px; inset-inline: 0; height: 2px; background: var(--line); }
.line-steps li::after { content: ""; position: absolute; top: 53px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); }
.line-steps strong { font-size: 36px; color: var(--red-dark); line-height: 1.3; }
.helps { display: grid; grid-template-columns: 1fr 1.3fr; gap: 40px; align-items: start; }
.helps > div p { margin-top: 14px; }
.help-list { display: grid; padding: 8px 24px; background: #fff; border: 1px solid var(--line); border-radius: 8px; counter-reset: help; }
.help-list li { position: relative; padding-block: 18px; padding-inline-start: 56px; counter-increment: help; }
.help-list li + li { border-top: 1px solid var(--line); }
.help-list li::before { content: counter(help); position: absolute; top: 18px; right: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #fbeaea; color: var(--red-dark); font-weight: 800; }
.parts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.parts li { padding: 16px 20px; border: 1px solid var(--line); border-radius: 4px; }
.start-again { margin-top: 24px; }

/* The personality test: seven circles, larger toward both ends. Agreeing sits where reading starts. */
.q .ends { clear: both; display: flex; justify-content: space-between; max-width: 520px; margin: 0 auto 4px; font-size: 15px; font-weight: 700; }
.ends span:first-child { color: var(--red-dark); }
.circles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); max-width: 520px; margin-inline: auto; }
.circles label { position: relative; display: grid; place-items: center; min-height: 56px; cursor: pointer; }
.circles input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.circles span { width: 24px; height: 24px; overflow: hidden; border: 2px solid #6b6b6b; border-radius: 50%; color: transparent; font-size: 1px; transition: background-color .15s, transform .15s; }
.circles label:nth-child(-n+3) span { border-color: var(--red); }
.circles label:nth-child(n+5) span { border-color: #191919; }
.circles label:nth-child(1) span, .circles label:nth-child(7) span { width: 44px; height: 44px; }
.circles label:nth-child(2) span, .circles label:nth-child(6) span { width: 37px; height: 37px; }
.circles label:nth-child(3) span, .circles label:nth-child(5) span { width: 30px; height: 30px; }
.circles label:hover span { transform: scale(1.1); }
.circles input:checked + span { background: #6b6b6b; }
.circles label:nth-child(-n+3) input:checked + span { background: var(--red); }
.circles label:nth-child(n+5) input:checked + span { background: #191919; }
.circles input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 3px; }

/* The type pages */
/* One tint per family; the pictures are on white paper, which "multiply" lets the tint through. */
.f1 { --tint: #f8e9e9; --ink: #8f1f1f; }
.f2 { --tint: #e4f2ec; --ink: #165c48; }
.f3 { --tint: #e6eef6; --ink: #1c4366; }
.f4 { --tint: #fbf0d8; --ink: #77500a; }
.persona { display: block; width: 100%; }
.persona img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; mix-blend-mode: multiply; }
.persona-wait { display: grid; place-items: center; width: 70%; margin: 15% auto; aspect-ratio: 1; background: var(--ink); clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); color: #fff; font-size: 26px; font-weight: 800; letter-spacing: 2px; }
.type-card { display: grid; justify-items: center; margin-top: 24px; padding: 24px 16px 32px; background: var(--tint); border-radius: 8px; text-align: center; }
.quiz-result > .type-card { padding-top: 24px; }
.type-card .persona { max-width: 280px; }
.type-card .code { color: var(--ink); font-size: clamp(48px, 10vw, 88px); font-weight: 800; line-height: 1.15; letter-spacing: 4px; }
.type-card .code::after { content: ""; display: block; width: 90px; height: 6px; margin: 8px auto 14px; background: var(--ink); }
.type-card h2 { font-size: 28px; }
.read-type { margin-top: 16px; }
.type-face { display: grid; justify-items: center; margin: 0 0 20px; padding: 12px 16px 10px; background: var(--tint); border-radius: 8px; }
.type-face .persona { max-width: 360px; }
.families { display: grid; gap: 20px; margin-bottom: 12px; }
.family { padding: 24px 20px; background: var(--tint); border-radius: 8px; }
.family h3 { color: var(--ink); font-size: 28px; text-align: center; }
.family > p { max-width: 70ch; margin: 4px auto 8px; text-align: center; }
.type-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.type-cards a { display: grid; justify-items: center; align-content: start; height: 100%; padding: 8px 8px 16px; border-radius: 6px; color: inherit; text-align: center; text-decoration: none; }
.type-cards strong { color: var(--ink); font-size: 19px; }
.type-cards b { font-size: 15px; letter-spacing: 1px; }
.type-cards a > span:last-child { margin-top: 4px; font-size: 14px; line-height: 1.6; }
.type-cards a:hover { background: #fff; }
.type-cards a:hover strong { text-decoration: underline; }
.suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-block: 12px; }
.suggest li { padding: 12px 18px 16px; border: 1px solid var(--line); border-radius: 4px; }
.suggest a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.letters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-block: 24px 8px; }
.letters div { padding: 14px 16px; background: var(--gray); border-bottom: 5px solid var(--red); }
.letters dt { font-weight: 800; }
.letters dt b { display: block; text-align: right; color: var(--red-dark); font-size: 30px; line-height: 1.3; }
.letters dd { margin: 4px 0 0; font-size: 15px; }
.traits { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-block: 12px; }
.traits li { padding: 16px 20px; background: var(--gray); border-radius: 4px; }
.steps-list { padding-inline-start: 22px; list-style: decimal; }
.steps-list li + li { margin-top: 8px; }
.kind > section { padding-top: 32px; }
.kind > section:last-child { padding-bottom: 56px; }
.kind p + p { margin-top: 12px; }
.kind .chips { margin-top: 12px; }
.axes-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-block: 16px; }
.axes-list li { padding: 16px 20px; border: 1px solid var(--line); border-radius: 4px; }
.kind-more { margin-bottom: 8px; }

@media (max-width: 900px) {
  .type-cards, .letters { grid-template-columns: 1fr 1fr; }
  .test-hero .wrap, .helps { grid-template-columns: 1fr; gap: 20px; }
  .test-hero img { grid-row: 1; }
  .parts { grid-template-columns: 1fr 1fr; }
  .test-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .test-cards { grid-template-columns: 1fr; }
  .test-cards img { aspect-ratio: 9 / 5; }
  .parts { grid-template-columns: 1fr; }
  .line-steps { grid-template-columns: 1fr 1fr; row-gap: 28px; }
  .options.pictures { grid-template-columns: 1fr 1fr; }
  .meters li { grid-template-columns: 96px 1fr 48px; }
  .axis { grid-template-columns: 1fr 1fr; }
  .axis progress { grid-column: 1 / -1; order: 3; }
  .scale { gap: 4px; }
  .scale span { min-height: 56px; padding-inline: 1px; font-size: 13px; }
  .options { grid-template-columns: 1fr; }
  .share-buttons li { flex: 1 1 130px; }
  .share-btn { width: 100%; }
  .copy-row { flex-direction: column; }
  .circles label:nth-child(1) span, .circles label:nth-child(7) span { width: 38px; height: 38px; }
  .circles label:nth-child(2) span, .circles label:nth-child(6) span { width: 33px; height: 33px; }
  .circles label:nth-child(3) span, .circles label:nth-child(5) span { width: 28px; height: 28px; }
  .suggest, .traits, .axes-list { grid-template-columns: 1fr; }
  .family { padding: 20px 8px; }
  .type-cards { gap: 4px; }
  .persona-wait { font-size: 20px; }
  .fit { grid-template-columns: 1fr; gap: 2px; }
}
