/* Turning Point Training Institute — shared design system (exercise, landing, thank-you, privacy).
   Ivory paper, navy ink, restrained gold. Arabic first (RTL), phone first. Measured text contrast on --tp-paper:
   ink 13.5:1, sub 5.9:1, gold-text 5.2:1, success 6.5:1, error 7.1:1; control borders 3.8:1 on white.
   --tp-gold (4.45:1) is used for rules and accents only, never for text. */

@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/IBMPlexSansArabic-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/IBMPlexSansArabic-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans Arabic"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/IBMPlexSansArabic-Bold.woff2") format("woff2"); }

:root {
  --tp-paper: #fbfaf6;
  --tp-white: #ffffff;
  --tp-ink: #172e3c;
  --tp-sub: #53646c;
  --tp-line: #dcded8;
  --tp-control: #7a8584;
  --tp-gold: #9a6b32;
  --tp-gold-text: #8a6230;
  --tp-soft: #f3f1ea;
  --tp-success: #22664e;
  --tp-success-bg: #e8efe9;
  --tp-wait: #755721;
  --tp-wait-bg: #f4eddc;
  --tp-error: #9a312b;
  --tp-focus: #172e3c;
  --tp-radius: 12px;
  --tp-gutter: 20px;
  --tp-measure: 680px;
  --tp-wide: 820px;
  color-scheme: light;
  font-family: "IBM Plex Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  color: var(--tp-ink);
  background: var(--tp-paper);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-size: 1.125rem; line-height: 1.8; background: var(--tp-paper); color: var(--tp-ink); overflow-wrap: break-word; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3, h4, h5, h6, p, figure, dl, dd, ul, ol { margin: 0; }
img { max-width: 100%; }
a { color: var(--tp-ink); text-decoration-color: var(--tp-gold); text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--tp-focus); outline-offset: 3px; border-radius: 4px; }
.tp-visually-hidden, .tp-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.tp-own { unicode-bidi: isolate; }
/* Customer text may hold long unbroken tokens (file names, codes, addresses): let them wrap anywhere rather than widen
   the page, also at large text sizes (T8). */
.tp-own, [dir="auto"], .tp-quote { overflow-wrap: anywhere; }

/* ---------- page frame ---------- */
.tp-skip { position: absolute; inset-inline-start: 12px; top: 12px; transform: translateY(calc(-100% - 24px)); z-index: 10; background: var(--tp-ink); color: var(--tp-white); padding: 10px 16px; border-radius: 8px; }
.tp-skip:focus { transform: none; }
.tp-header { background: var(--tp-white); border-bottom: 1px solid var(--tp-line); }
.tp-header__inner { max-width: var(--tp-wide); margin: 0 auto; padding: 12px var(--tp-gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tp-logo-link { display: inline-flex; align-items: center; min-height: 44px; border-radius: 6px; }
.tp-logo { display: block; height: 52px; width: auto; }
/* Wide screens: the logo's own lettering («Training Institute») needs more height to stay legible (T8 review). */
@media (min-width: 900px) { .tp-logo { height: 72px; } }
.tp-nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tp-main { flex: 1 0 auto; width: 100%; max-width: var(--tp-wide); margin: 0 auto; padding: 32px var(--tp-gutter) 56px; outline: none; }
/* Screens keep a comfortable reading width, aligned with the logo on the start side; the report uses the full width. */
.tp-screen { max-width: var(--tp-measure); }
.tp-screen--wide { max-width: none; }
.tp-main > .tp-notice { max-width: var(--tp-measure); }
.tp-footer { border-top: 1px solid var(--tp-line); background: var(--tp-white); flex: none; }
.tp-footer__inner { max-width: var(--tp-wide); margin: 0 auto; padding: 18px var(--tp-gutter) 28px; font-size: 0.9375rem; line-height: 1.7; color: var(--tp-sub); display: grid; gap: 4px; }

/* ---------- type ---------- */
.tp-eyebrow { color: var(--tp-gold-text); font-size: 0.9375rem; font-weight: 600; margin-bottom: 6px; }
.tp-h1 { font-size: 1.875rem; line-height: 1.45; font-weight: 600; letter-spacing: 0; margin-bottom: 12px; }
.tp-h2 { font-size: 1.3125rem; line-height: 1.55; font-weight: 600; margin: 28px 0 10px; }
.tp-h3 { font-size: 1.1875rem; line-height: 1.55; font-weight: 600; margin-bottom: 6px; }
.tp-lead { font-size: 1.1875rem; line-height: 1.85; color: var(--tp-sub); margin-bottom: 20px; }
.tp-hint { font-size: 1rem; line-height: 1.7; color: var(--tp-sub); margin: 2px 0 8px; }
.tp-hint--inline { display: inline; margin: 0; }
.tp-date-echo { margin: 6px 0 0; color: var(--tp-ink); }
.tp-error { color: var(--tp-error); font-weight: 600; font-size: 1rem; margin: 6px 0 0; }
.tp-notice { background: var(--tp-success-bg); color: var(--tp-ink); border-radius: 10px; padding: 10px 16px; margin: 0 0 16px; font-size: 1rem; }
.tp-notice--warn { background: var(--tp-wait-bg); }
.tp-screen > * + * { margin-top: 16px; }
.tp-screen > .tp-h1 { margin-top: 0; }
.tp-screen > .tp-eyebrow + .tp-h1 { margin-top: 0; }

/* ---------- the person's own words ---------- */
.tp-quote { background: var(--tp-white); border: 1px solid var(--tp-line); border-inline-start: 4px solid var(--tp-gold); border-radius: 10px; padding: 12px 16px; }
.tp-quote__label { font-size: 0.875rem; color: var(--tp-sub); }
.tp-quote__text { font-size: 1.1875rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; text-align: start; }

/* ---------- buttons ---------- */
.tp-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 24px; }
.tp-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 22px; border-radius: 10px;
  font-size: 1.0625rem; font-weight: 600; line-height: 1.5; text-align: center; text-decoration: none; cursor: pointer; border: 1px solid transparent;
}
.tp-button--primary { background: var(--tp-ink); color: var(--tp-white); border-color: var(--tp-ink); }
.tp-button--primary:hover { background: #0f2230; }
.tp-button--secondary { background: var(--tp-white); color: var(--tp-ink); border-color: var(--tp-control); }
.tp-button--secondary:hover { border-color: var(--tp-ink); }
.tp-button--quiet { background: transparent; color: var(--tp-ink); min-height: 44px; padding: 8px 12px; text-decoration: underline; text-decoration-color: var(--tp-gold); text-underline-offset: 5px; font-weight: 600; }
.tp-button--quiet:hover { background: var(--tp-soft); }
.tp-back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--tp-sub); font-size: 1rem; }
.tp-inline-actions { margin-top: 6px; }

/* ---------- answer choices (move to the next screen) ---------- */
.tp-choices { display: grid; gap: 12px; margin-top: 20px; }
.tp-choice {
  display: grid; gap: 2px; width: 100%; min-height: 60px; text-align: start; padding: 14px 18px; border-radius: var(--tp-radius);
  background: var(--tp-white); border: 1px solid var(--tp-control); cursor: pointer; color: var(--tp-ink);
}
.tp-choice:hover { border-color: var(--tp-ink); box-shadow: inset 0 0 0 1px var(--tp-ink); }
.tp-choice.is-previous { border-color: var(--tp-ink); box-shadow: inset 0 0 0 1px var(--tp-ink); }
.tp-choice__label { font-size: 1.125rem; font-weight: 600; line-height: 1.6; }
.tp-choice__hint { font-size: 1rem; color: var(--tp-sub); line-height: 1.6; }

/* ---------- form controls ---------- */
.tp-field { margin-top: 20px; }
.tp-label, .tp-legend { display: block; font-weight: 600; font-size: 1.125rem; line-height: 1.6; margin-bottom: 4px; padding: 0; }
.tp-input, .tp-textarea, .tp-select {
  display: block; width: 100%; min-height: 50px; padding: 10px 14px; font-size: 1.125rem; line-height: 1.7; background: var(--tp-white); color: var(--tp-ink);
  border: 1px solid var(--tp-control); border-radius: 10px;
}
.tp-textarea { resize: vertical; min-height: 96px; }
.tp-input[type="date"], .tp-input[type="time"] { max-width: 260px; }
.tp-input[aria-invalid="true"], .tp-textarea[aria-invalid="true"], fieldset[aria-invalid="true"] .tp-option { border-color: var(--tp-error); border-width: 2px; }
.tp-options { border: 0; padding: 0; margin: 20px 0 0; min-width: 0; }
.tp-option-wrap + .tp-option-wrap { margin-top: 10px; }
.tp-option {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--tp-radius); background: var(--tp-white);
  border: 1px solid var(--tp-control); cursor: pointer; min-height: 56px;
}
.tp-option:has(input:checked) { border-color: var(--tp-ink); box-shadow: inset 0 0 0 1px var(--tp-ink); }
.tp-option input { width: 1.375rem; height: 1.375rem; margin: 4px 0 0; flex: none; accent-color: var(--tp-ink); }
.tp-option__text { display: grid; gap: 2px; }
.tp-option__label { font-weight: 600; font-size: 1.125rem; line-height: 1.6; }
.tp-option__hint { font-size: 1rem; color: var(--tp-sub); line-height: 1.6; }
.tp-reveal { padding-block: 4px 6px; padding-inline: 16px 0; border-inline-start: 3px solid var(--tp-gold); margin-block: 8px 0; margin-inline-start: 12px; }
.tp-reveal > .tp-field:first-child { margin-top: 8px; }
.tp-checks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tp-check {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px; border: 1px solid var(--tp-control); border-radius: 999px;
  background: var(--tp-white); cursor: pointer; font-size: 1.0625rem;
}
.tp-check:has(input:checked) { border-color: var(--tp-ink); background: var(--tp-soft); box-shadow: inset 0 0 0 1px var(--tp-ink); }
.tp-check input { width: 1.25rem; height: 1.25rem; flex: none; margin: 0; accent-color: var(--tp-ink); }
.tp-group { border: 1px solid var(--tp-line); border-radius: var(--tp-radius); padding: 6px 18px 20px; margin: 28px 0 0; background: var(--tp-white); min-width: 0; }
.tp-group__title { font-size: 1rem; color: var(--tp-sub); font-weight: 600; padding: 0 6px; }
.tp-group .tp-options { margin-top: 8px; }
.tp-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }

/* ---------- cards, details, tags ---------- */
.tp-card { background: var(--tp-white); border: 1px solid var(--tp-line); border-radius: var(--tp-radius); padding: 18px 20px; }
.tp-card--lead { border-inline-start: 4px solid var(--tp-gold); }
.tp-card--form { padding: 4px 20px 20px; }
.tp-card--question { background: var(--tp-soft); }
.tp-cards { list-style: none; padding: 0; display: grid; gap: 14px; }
.tp-details { border-top: 1px solid var(--tp-line); padding-top: 10px; margin-top: 20px; }
.tp-details > summary { cursor: pointer; display: list-item; list-style-position: inside; padding: 9px 0; min-height: 44px; font-weight: 600; color: var(--tp-ink); }
.tp-details > summary::marker { color: var(--tp-gold); }
.tp-details__body { padding: 4px 0 6px; color: var(--tp-sub); }
.tp-details__body p + p { margin-top: 8px; }
.tp-tag { display: inline-block; font-size: 0.9375rem; font-weight: 600; padding: 2px 10px; border-radius: 6px; background: var(--tp-soft); color: var(--tp-sub); }
.tp-tag--wait { background: var(--tp-wait-bg); color: var(--tp-wait); }
.tp-tag--example { background: var(--tp-wait-bg); color: var(--tp-wait); }
.tp-stages { display: flex; flex-wrap: wrap; gap: 4px 0; align-items: center; font-weight: 600; font-size: 1.0625rem; color: var(--tp-ink); }
.tp-stages__arrow { color: var(--tp-gold-text); padding: 0 6px; }
.tp-aside { margin-top: 28px; }
.tp-aside__line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.tp-link-list { list-style: none; padding: 0; display: grid; gap: 2px; }
.tp-examples { padding-inline-start: 22px; }
.tp-terms { display: grid; gap: 4px 0; }
.tp-terms dt { font-weight: 600; color: var(--tp-ink); margin-top: 8px; }

/* ---------- dialog ---------- */
.tp-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); border: 1px solid var(--tp-line); border-radius: 16px; padding: 0; background: var(--tp-paper); color: var(--tp-ink); }
.tp-dialog::backdrop { background: rgba(23, 46, 60, 0.45); }
.tp-dialog__body { padding: 20px 20px 24px; }
.tp-dialog__title { font-size: 1.375rem; font-weight: 600; }

@media (max-width: 560px) {
  :root { --tp-gutter: 16px; }
  .tp-main { padding-top: 22px; }
  .tp-h1 { font-size: 1.5625rem; }
  .tp-lead { font-size: 1.125rem; }
  .tp-logo { height: 44px; }
  .tp-actions { display: grid; grid-template-columns: 1fr; }
  .tp-actions .tp-back { justify-self: start; }
  /* minmax(0, 1fr): a native date/time field's own minimum width must not widen the column past the screen
     (320 px with 200 % text, T10 review R7). */
  .tp-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .tp-input[type="date"], .tp-input[type="time"] { max-width: none; min-width: 0; padding-inline: 8px; }
  .tp-input::-webkit-calendar-picker-indicator { margin-inline-start: 2px; }
  .tp-card, .tp-group { padding-inline: 14px; }
  .tp-reveal { margin-inline-start: 6px; padding-inline: 12px 0; }
}
@media (max-width: 360px) {
  .tp-nav .tp-button--quiet { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
