/* Qiwam Coach pages (/coach, /orders, /admin): the site's midnight-indigo tokens, one column, plain forms. */
:root {
  --bg: #090826; --surface: #121036; --surface-2: #1B1850; --line: #2A2668; --ink: #F4F2FF; --muted: #A6A3D6;
  --accent: #6650F2; --accent-soft: #A99CFF; --data: #3EE6FF; --hot: #FF4FD8; --user-bg: #221E63;
  --danger: #FF6B7A; --danger-bg: #3A1230; --ok: #45D49A; --ok-bg: #0F3A2C; --warn: #FFC861; --warn-bg: #3A2E10;
  --display: "Alexandria", "IBM Plex Sans Arabic", Tahoma, sans-serif;
  --body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F7F6FF; --surface: #FFFFFF; --surface-2: #EEECFF; --line: #DAD6F5; --ink: #15123F; --muted: #55508A;
    --accent: #5B47F0; --accent-soft: #4B37E0; --data: #0A8DB0; --hot: #C4249F; --user-bg: #E6E2FF;
    --danger: #C81E2B; --danger-bg: #FDECEC; --ok: #11845B; --ok-bg: #E3F6EE; --warn: #8A5A00; --warn-bg: #FFF3D6;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F7F6FF; --surface: #FFFFFF; --surface-2: #EEECFF; --line: #DAD6F5; --ink: #15123F; --muted: #55508A;
  --accent: #5B47F0; --accent-soft: #4B37E0; --data: #0A8DB0; --hot: #C4249F; --user-bg: #E6E2FF;
  --danger: #C81E2B; --danger-bg: #FDECEC; --ok: #11845B; --ok-bg: #E3F6EE; --warn: #8A5A00; --warn-bg: #FFF3D6;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.8; overflow-wrap: break-word; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; border-radius: 8px; }
a { color: var(--accent-soft); }
main { max-width: 860px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-left, 0px)) 64px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 6px 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand b { font-family: var(--display); font-weight: 900; font-size: 1.3rem; }
.mark { display: inline-flex; align-items: center; gap: 3px; transform: skewX(-14deg); }
.mark i { display: block; width: 6px; border-radius: 3px; }
.mark i:nth-child(1) { height: 12px; background: var(--data); opacity: .55; }
.mark i:nth-child(2) { height: 16px; background: var(--accent-soft); opacity: .8; }
.mark i:nth-child(3) { height: 20px; background: var(--hot); }
.top nav { display: flex; gap: 6px; flex-wrap: wrap; }
.top nav a { text-decoration: none; color: var(--muted); font-family: var(--display); font-weight: 600; font-size: .9rem; padding: 8px 12px; border-radius: 12px; min-height: 44px; display: inline-flex; align-items: center; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); background: var(--surface); }
h1 { font-family: var(--display); font-weight: 900; font-size: clamp(2.4rem, 7vw, 4.2rem); line-height: 1.2; margin: 18px 0 14px; }
h2 { font-family: var(--display); font-weight: 800; font-size: 1.45rem; line-height: 1.4; margin: 56px 0 12px; }
h3 { font-family: var(--display); font-weight: 700; font-size: 1.1rem; margin: 0 0 6px; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 52ch; margin: 0; }
.muted { color: var(--muted); }
small, .small { font-size: .85rem; }

.panel { background: var(--surface); border-radius: 20px; padding: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
ul.ticks, ul.crosses { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
ul.ticks li::before, ul.crosses li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 10px; vertical-align: .15em; }
ul.ticks li::before { background: var(--ok); }
ul.crosses li::before { background: var(--danger); }

.product { display: flex; flex-direction: column; gap: 10px; }
.product .price { font-family: var(--display); font-weight: 900; font-size: 2.2rem; line-height: 1.1; }
.product .price span { font-size: 1rem; font-weight: 600; color: var(--muted); }
.product ul { margin: 0; padding-inline-start: 20px; }
.product .btn { margin-top: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border: 0; border-radius: 14px; background: var(--accent); color: #fff; font-family: var(--display); font-weight: 700; cursor: pointer; text-decoration: none; transition: background-color .15s, transform .1s; }
.btn:hover { background: color-mix(in srgb, var(--accent) 85%, #fff); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
.btn.ok { background: var(--ok-bg); color: var(--ok); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .9rem; border-radius: 11px; }

details { background: var(--surface); border-radius: 16px; padding: 4px 18px; margin-bottom: 8px; }
summary { cursor: pointer; font-family: var(--display); font-weight: 700; padding: 12px 0; list-style-position: inside; }
details p { margin: 0 0 14px; color: var(--ink); }

/* forms */
form.stack, .stack { display: flex; flex-direction: column; gap: 16px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-family: var(--display); font-weight: 600; font-size: .95rem; }
label.field .hint { font-family: var(--body); font-weight: 400; font-size: .85rem; color: var(--muted); }
input[type=text], input[type=number], input[type=tel], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-family: var(--body); font-size: 1rem;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-family: var(--display); font-weight: 700; margin-bottom: 8px; }
.parq { display: flex; flex-direction: column; gap: 10px; }
.parq-q { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.yn { display: flex; gap: 4px; }
.yn label { cursor: pointer; }
.yn input { position: absolute; opacity: 0; pointer-events: none; }
.yn span { display: inline-flex; align-items: center; justify-content: center; min-width: 52px; min-height: 40px; padding: 0 10px; border-radius: 10px; background: var(--bg); font-family: var(--display); font-weight: 600; }
.yn input:checked + span { background: var(--ink); color: var(--bg); }
.yn input:focus-visible + span { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 4px; accent-color: var(--accent); flex-shrink: 0; }
.err { color: var(--danger); margin: 0; }
.note { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); }
.note.warn { background: var(--warn-bg); color: var(--ink); }
.note.warn b { color: var(--warn); }
.note.ok { background: var(--ok-bg); }
.note.ok b { color: var(--ok); }
.note.bad { background: var(--danger-bg); }
.note.bad b { color: var(--danger); }
.paybox { display: grid; gap: 10px; }
.paybox .acct { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.paybox .acct b { font-family: var(--display); font-size: 1.15rem; direction: ltr; unicode-bidi: isolate; }
.steps { display: flex; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; flex-wrap: wrap; }
.steps li { padding: 4px 12px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .85rem; font-family: var(--display); font-weight: 600; }
.steps li[aria-current="step"] { background: var(--ink); color: var(--bg); }
.steps li.done { color: var(--ok); }

/* status chips */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 12px; border-radius: 999px; font-family: var(--display); font-weight: 700; font-size: .82rem; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.status.s-active { background: var(--ok-bg); color: var(--ok); }
.status.s-confirm, .status.s-payment { background: var(--warn-bg); color: var(--warn); }
.status.s-medical, .status.s-cancelled { background: var(--danger-bg); color: var(--danger); }
.order { display: flex; flex-direction: column; gap: 10px; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-head h3 { margin: 0; }
.reply { padding: 14px 16px; border-radius: 16px; background: var(--user-bg); }
/* automatic notes look different from the coach's reply: a cyan rule and a plain surface, labelled as automatic */
.ai-card { padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border-inline-start: 4px solid var(--data); }
.ai-card h3 { margin: 0 0 4px; font-family: var(--display); font-size: 1rem; color: var(--data); }
.ai-card .ai-note { margin: 0 0 10px; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.ai-card .ai-text { white-space: pre-wrap; line-height: 1.85; }
.ai-dots { display: flex; gap: 6px; }
.ai-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--data); animation: aiDot 1.2s ease-in-out infinite; }
.ai-dots i:nth-child(2) { animation-delay: .15s; } .ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ai-dots i { animation: none; opacity: .6; } }
.reply h3 .by { font-weight: 600; color: var(--muted); font-size: .85rem; }
.reply.new { box-shadow: inset 0 0 0 2px var(--hot); }
audio, video { width: 100%; border-radius: 12px; }
video { max-height: 420px; background: #000; }
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 40; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; max-width: calc(100% - 32px); box-shadow: 0 10px 30px rgb(0 0 0 / .3); }
.progress { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
footer.foot { margin-top: 64px; color: var(--muted); font-size: .85rem; }
footer.foot a { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
