/* Module intro card - shown before a module starts (and as Review when done).
   Three targets: phone, tablet, PC. The CTA is deliberately small - it is a
   single confirm action, not the hero of the screen, so it does not stretch
   across the card or shout. Fluid from 320px up. */

.mvidx-host{display:flex;justify-content:center;padding:16px 0}
.mvidx-host .mvidx-panel{width:100%;max-width:440px;margin:0 auto}

.mvidx-panel{
  background:#fff;border-radius:10px;
  box-shadow:0 2px 4px rgba(0,0,0,.09);
  padding:20px 22px 22px;box-sizing:border-box;
}

/* Subject line - small and quiet, does not compete with the module name. */
.mvidx-sub{margin:0 0 6px;font-size:11.5px;font-weight:700;color:#62c8df;
  letter-spacing:.02em}

.mvidx-title{margin:0 0 4px;font-size:18px;font-weight:700;color:#16202b;
  line-height:1.35;word-break:break-word}

.mvidx-meta{margin:0 0 16px;font-size:13px;font-weight:600;color:#5d6b7a}

.mvidx-score{margin:0 0 14px;font-size:12.5px;font-weight:600;color:#8a929c}

/* --- CTA: compact and self-sized, never full width --- */
.mvapp .mvidx-btn,body .mvidx-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:auto;min-width:0;
  min-height:34px!important;height:auto!important;max-height:none!important;
  box-sizing:border-box;
  padding:7px 16px!important;line-height:1.2!important;
  background:#62c8df;color:#fff;
  font-size:12.5px;font-weight:700;letter-spacing:.02em;
  border:0!important;border-radius:7px!important;
  cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.08);
  transition:background .16s ease,transform .12s ease;
}
.mvidx-btn:hover{background:#4fbcd6}
.mvidx-btn:active{transform:scale(.985)}

/* --- tablet --- */
@media (min-width:641px) and (max-width:1024px){
  .mvidx-host .mvidx-panel{max-width:480px}
  .mvidx-panel{padding:22px 24px 24px}
  .mvidx-title{font-size:19px}
  .mvapp .mvidx-btn,body .mvidx-btn{min-height:36px!important;padding:8px 18px!important}
}

/* --- PC: sits in the reading column, never full-bleed --- */
@media (min-width:1025px){
  .mvidx-host .mvidx-panel{max-width:520px}
  .mvidx-panel{padding:24px 28px 26px}
  .mvidx-title{font-size:20px}
  .mvapp .mvidx-btn,body .mvidx-btn{min-height:36px!important;padding:8px 18px!important}
}

/* --- phone: full-width card, CTA still small but tappable --- */
@media (max-width:640px){
  .mvidx-host{padding:10px 0}
  .mvidx-host .mvidx-panel{max-width:none}
  .mvidx-panel{padding:16px 16px 18px;border-radius:12px}
  .mvidx-title{font-size:17px}
  .mvidx-meta{font-size:12.5px;margin-bottom:14px}
  .mvapp .mvidx-btn,body .mvidx-btn{min-height:38px!important;font-size:13px;padding:9px 18px!important}
}

/* Short phones in landscape: keep the card above the fold. */
@media (max-width:640px) and (max-height:500px){
  .mvidx-panel{padding:12px 14px 14px}
  .mvidx-title{font-size:16px;margin-bottom:2px}
  .mvidx-meta{margin-bottom:10px}
}

@media (prefers-reduced-motion:reduce){
  .mvidx-btn{transition:none}
  .mvidx-btn:active{transform:none}
}

/* Dark mode: the card was hard-coded white and glared on a dark page. */
html[data-mvtheme="dark"] .mvidx-panel{background:#16202b;box-shadow:0 2px 4px rgba(0,0,0,.5)}
html[data-mvtheme="dark"] .mvidx-title{color:#e8edf2}
html[data-mvtheme="dark"] .mvidx-meta{color:#9aa6b3}
html[data-mvtheme="dark"] .mvidx-score{color:#7d8794}

/* --- Back sits ABOVE the card, not below it ----------------------------- */

/* On the intro screen the back button is a sibling that comes AFTER the card,
   so it rendered underneath the Start button - the last thing on the screen
   and the opposite of where a back control belongs. The screen is turned into
   a flex column and the two are ordered: Back first, card second. */
#introScreen {
  display: flex;
  flex-direction: column;
}
#introScreen > .back,
#introScreen > button.back,
#introScreen > a.back {
  order: 1;
  align-self: flex-start;
  margin: 0 0 10px !important;
}
#introScreen > .mvidx-host { order: 2; }

/* --- card content order: subject, topic, count, CTA --------------------- */

/* Reads top-down as "where am I -> what is it -> how big -> go": the subject
   is the smallest line, the module/topic name is the headline, then the
   question count, then the button. */
.mvidx-panel { display: flex; flex-direction: column; align-items: flex-start; }
.mvidx-sub   { order: 1; margin: 0 0 4px; }
.mvidx-title { order: 2; margin: 0 0 6px; }
.mvidx-meta  { order: 3; margin: 0 0 14px; }
.mvidx-score { order: 4; }
.mvapp .mvidx-btn, body .mvidx-btn { order: 5; margin-top: 2px; }
