/* ==========================================================================
   prep.css — Ramadan Prep module styles (owned by the prep module).
   Builds on css/app.css components and tokens (hero, card, list/row, check, bar, seg, chips, display numbers).
   Logical properties only (RTL-safe); 44px touch targets; no shadows on ordinary cards; reduced motion respected.
   ========================================================================== */

/* Hero metrics: values share a baseline row even when a label wraps to two lines */
.prep-hero .metric { display: flex; flex-direction: column; justify-content: space-between; }

/* Small status line under a check-in */
.prep-status { margin-top: var(--s3); font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.prep-status.accent { color: var(--accent); }

/* Salah check-in: five round toggles with the prayer name below ----------------- */
.prep-salah { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; margin-top: 2px; }
.prep-pray {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 74px;
  padding: 4px 0 2px;
  border-radius: var(--r-block);
  color: var(--ink-2);
  text-align: center;
  transition: background-color var(--dur) var(--ease);
}
.prep-pray-dot {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid var(--control-line);
  color: var(--ink-3);
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.prep-pray-dot .ic { stroke-width: 1.75; }
.prep-pray.is-on .prep-pray-dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.prep-pray.is-on .prep-pray-dot .ic { stroke-width: 2.6; }
.prep-pray-name {
  max-width: 100%;
  font-size: clamp(11.5px, 3.4vw, 13px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prep-pray.is-on .prep-pray-name { color: var(--ink); }
@media (hover: hover) { .prep-pray:hover .prep-pray-dot { border-color: var(--accent); } }
.prep-pray:active .prep-pray-dot { transform: scale(.96); }

/* 7-day mini charts under the check-ins */
.prep-week { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--hairline); }
.prep-week .chart { margin-top: var(--s2); max-height: 64px; }

/* Quran check-in: − value + ------------------------------------------------------ */
.prep-qc { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.prep-qc-val { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 2px 8px; text-align: center; }
.prep-qc-val .display { font-size: clamp(46px, 14vw, 60px); }
.prep-step {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--hairline-2);
  background: var(--card);
  color: var(--ink);
  transition: background-color var(--dur) var(--ease), opacity var(--dur);
}
.prep-step .ic { stroke-width: 2; }
.prep-step[aria-disabled="true"] { opacity: .4; cursor: default; }
.prep-step:active:not([aria-disabled="true"]) { background: var(--card-2); }
@media (hover: hover) { .prep-step:hover:not([aria-disabled="true"]) { background: var(--accent-soft); } }

/* Counters (make-up fasts) */
.prep-counter { min-height: 48px; }
.prep-counter-ctl { display: inline-flex; align-items: center; gap: var(--s3); flex: none; }
.prep-counter-val { min-width: 2.2ch; text-align: center; font-size: 22px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Prompts: round check rows with track tags and an expandable tip ------------------- */
.prep-prompt .row-title { font-weight: 550; }
.prep-prompt.is-done .row-title { color: var(--ink-2); }
/* A locked prompt (a later day, a closed plan) is still there to read: full-strength text, only the check dimmed */
.row.prep-prompt.is-disabled { opacity: 1; }
.prep-prompt.is-disabled .row-title { color: var(--ink-2); }
.prep-prompt.is-disabled .check { opacity: .45; }
.prep-tags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; vertical-align: middle; margin-inline-end: 4px; }
.prep-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  background: var(--card-2);
  border: 1px solid var(--hairline);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.prep-tag.is-focus { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink, var(--accent)); }
.prep-tip-btn { gap: 2px; }
.prep-tip-btn .ic { transition: transform var(--dur) var(--ease); }
.prep-tip-btn[aria-expanded="true"] .ic { transform: rotate(180deg); }
.prep-tip { margin-top: 2px; padding: 10px 12px; border-radius: var(--r-input); background: var(--card-2); color: var(--ink-2); font-size: 14px; line-height: 1.5; }

/* The 30-day list: week headers fold their days away ------------------------------------ */
.prep-wk-h { margin: 0; font: inherit; }
.prep-wk-h ~ .prep-wk-h { border-top: 1px solid var(--hairline); }
.prep-wk-list:not([hidden]) + .prep-wk-h { margin-top: var(--s2); }
.prep-wk-list { border-top: 1px solid var(--hairline); }
.prep-wk {
  display: flex;
  align-items: center;
  gap: var(--s3);
  width: calc(100% + 20px);
  min-height: 52px;
  margin-inline: -10px;
  padding: 8px 10px;
  border-radius: 14px;
  color: var(--ink);
  text-align: start;
  transition: background-color var(--dur) var(--ease);
}
@media (hover: hover) { .prep-wk:hover { background: var(--card-2); } }
.prep-wk-txt { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
.prep-wk-n { font-size: 12px; font-weight: 650; letter-spacing: var(--track-wide); text-transform: uppercase; color: var(--ink-3); }
.prep-wk-t { font-size: 14.5px; font-weight: 650; color: var(--ink); letter-spacing: var(--track-tight); }
.prep-wk-c { flex: none; font-size: 13px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.prep-wk-chev { flex: none; color: var(--ink-3); transition: transform var(--dur) var(--ease); }
.prep-wk[aria-expanded="true"] .prep-wk-chev { transform: rotate(180deg); }
.prep-dn {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-2);
  border: 1px solid var(--hairline-2);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
/* A finished day keeps its number; completion is the accent edge plus a small check badge. Accent text on a tint uses
   --accent-ink (app.css) where the foundation defines it */
.prep-dn.is-done { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink, var(--accent)); }
.prep-dn-ok {
  position: absolute;
  inset-inline-end: -5px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 0 2px var(--card);
}
.prep-dn-ok .ic { width: 12px; height: 12px; stroke-width: 3; }
.prep-dn.is-today { border-color: var(--accent); color: var(--accent-ink, var(--accent)); box-shadow: 0 0 0 3px var(--accent-soft); }
.prep-dn.is-future { background: transparent; border-style: dashed; color: var(--ink-3); }
.row.prep-day.is-today { background: var(--accent-soft); }
/* Today's row is already tinted: its number sits on that one tint (a second tint behind the accent number would
   drop it below 4.5:1), and the check badge's ring takes the row's colour (tint over card) instead of a white halo */
.row.prep-day.is-today .prep-dn { background: transparent; }
.row.prep-day.is-today .prep-dn-ok { box-shadow: 0 0 0 2px var(--accent-soft), 0 0 0 2px var(--card); }
.row.prep-day.is-future .row-title { color: var(--ink-2); font-weight: 500; }
.row.prep-day .row-val { min-width: 2.6em; }

/* Six tracks progress */
.prep-track .row-extra .bar { margin-top: 2px; }
.prep-tracks .row-title .prep-tag { margin-inline-start: 4px; }

/* Settings rows */
.prep-danger .row-title { color: var(--danger); }
.prep-danger .row-ic { background: var(--danger-soft); color: var(--danger); }

/* Readiness check (assessment) ------------------------------------------------------- */
.prep-q-count { margin-top: 14px; font-size: 13px; font-weight: 600; color: var(--hero-ink-3); }
.prep-question { margin: 6px 0 16px; font-size: clamp(20px, 5.6vw, 24px); font-weight: 650; letter-spacing: var(--track-tight); line-height: 1.3; color: var(--hero-ink); }
.prep-opts { margin: 0; padding: 0; border: 0; min-width: 0; }
.prep-opt {
  position: relative;
  width: calc(100% + 20px);
  margin-inline: -10px;
  padding-inline: 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease);
}
.prep-opt.is-selected { background: var(--accent-soft); }
@media (hover: hover) { .prep-opt:not(.is-selected):hover { background: var(--card-2); } }
.prep-radio { position: absolute; inset-inline-start: 10px; top: 50%; width: 24px; height: 24px; margin: -12px 0 0; opacity: 0; cursor: pointer; }
.prep-radio-dot {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--control-line);
  transition: border-color .15s var(--ease);
}
.prep-radio-dot::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .15s var(--ease); }
.prep-radio:checked + .prep-radio-dot { border-color: var(--accent); }
.prep-radio:checked + .prep-radio-dot::after { transform: scale(1); }
.prep-radio:focus-visible + .prep-radio-dot { outline: 1px solid var(--accent); outline-offset: 1px; box-shadow: 0 0 0 4px var(--focus); }
.prep-opt .row-title { font-weight: 550; }
.prep-q-nav { margin-top: var(--s4); }
.prep-q-nav .btn { flex: 1 1 140px; }
.prep-q-nav + .caption { margin-top: var(--s3); }

/* Day screen: the day number is the hero figure and the day's theme its headline (the ring shows the prompts done) */
.prep-day-hero .hero-main { align-items: flex-start; }
.prep-day-hero .hero-label {
  margin-top: 10px;
  font-size: clamp(19px, 5.4vw, 22px);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: var(--track-tight);
  color: var(--hero-ink);
  overflow-wrap: break-word;
  text-wrap: balance;
}
.prep-mot .quote { margin: 0; }

/* Salah check-in before Fajr: which day the ticks count for */
.prep-late { margin: -2px 0 var(--s3); }

/* Catch-up card (started after day 1): earlier days with focus prompts */
.prep-catch .list .row { min-height: 60px; }

/* Intro bottom CTA */
.prep-start { margin-top: var(--s5); }

/* Completion moment (day 30): a quiet card and a soft glow on the hero — no confetti --------- */
.prep-complete-in { display: flex; align-items: flex-start; gap: var(--s4); }
.prep-complete-ic { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.prep-complete .card-title { font-size: 19px; }
.hero.is-complete .kicker .ic { color: var(--hero-accent); }
@keyframes prep-glow {
  0% { box-shadow: var(--hero-shadow), 0 0 0 0 rgba(110, 231, 183, .42); }
  100% { box-shadow: var(--hero-shadow), 0 0 0 22px rgba(110, 231, 183, 0); }
}
.hero.prep-celebrate { animation: prep-glow 1.4s var(--ease) 2; }

@media (max-width: 360px) {
  .prep-salah { gap: 2px; }
  .prep-pray-dot { width: 44px; height: 44px; }
  .prep-complete-in { gap: var(--s3); }
}

@media (prefers-reduced-motion: reduce) {
  .hero.prep-celebrate { animation: none; }
  .prep-pray:active .prep-pray-dot { transform: none; }
  .prep-tip-btn .ic, .prep-radio-dot::after, .prep-pray-dot, .prep-wk-chev { transition-duration: .01ms !important; }
}
