/* CITron motion kit (owner 2026-11-25): floating cards, soft focus rings, button busy/done states, shake on a
   wrong entry, 6-digit code boxes, a password meter, save bar, snackbar, alert/modal motion and empty states.
   Shared by the student, staff, HR and instructor pages. Maroon branding; every animation stops under
   prefers-reduced-motion. Classes start with mk- so they never clash with page styles. */
:root {
  --mk-accent: #7A0019; --mk-accent-2: #A3223F; --mk-accent-ink: #5E0013;
  --mk-accent-soft: #FBEFF2; --mk-accent-line: #EDC6CF; --mk-ring: rgba(122, 0, 25, .14);
  --mk-grad: linear-gradient(135deg, #7A0019 0%, #A3223F 100%);
  --mk-surface: #F6F3F4; --mk-card: #FFFFFF; --mk-line: #E4DCDF; --mk-dot: #DDD2D6;
  --mk-ink: #1C1417; --mk-ink-2: #43373B; --mk-muted: #5F5257;
  --mk-ok: #16824B; --mk-ok-soft: rgba(22, 130, 75, .12); --mk-ok-ink: #0F6B3C;
  --mk-bad: #C8102E; --mk-bad-soft: rgba(200, 16, 46, .10); --mk-warn: #9A5200; --mk-warn-soft: rgba(255, 159, 10, .14);
  --mk-shadow: 0 1px 2px rgba(42, 8, 18, .06), 0 8px 24px rgba(42, 8, 18, .08);
  --mk-shadow-lg: 0 2px 4px rgba(42, 8, 18, .06), 0 22px 48px rgba(42, 8, 18, .16);
  --mk-ease: cubic-bezier(.32, .72, 0, 1);
  --mk-spring: cubic-bezier(.22, 1, .36, 1);
  --mk-bounce: cubic-bezier(.34, 1.56, .64, 1);   /* 2026-11-29: no longer used; pop-ups, toasts and dialogs settle smoothly (--mk-spring) */
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --mk-spring: linear(0, .0941 5.6%, .2736 11.1%, .4548 16.7%, .6076 22.2%, .7255 27.8%, .8119 33.3%, .8732 38.9%, .9156 44.4%,
      .9444 50%, .9636 55.6%, .9764 61.1%, .9848 66.7%, .9902 72.2%, .9938 77.8%, .996 83.3%, .9975 88.9%, .9984 94.4%, 1 100%);
    --mk-bounce: linear(0, .0833 5.6%, .2603 11.1%, .4566 16.7%, .6331 22.2%, .7737 27.8%, .8759 33.3%, .9442 38.9%, .9858 44.4%,
      1.0081 50%, 1.0178 55.6%, 1.0199 61.1%, 1.018 66.7%, 1.0143 72.2%, 1.0104 77.8%, 1.007 83.3%, 1.0043 88.9%, 1.0023 94.4%, 1 100%);
  }
}
html[data-theme="dark"], html.dark, html.theme-dark {
  --mk-accent: #C23A55; --mk-accent-2: #D9576F; --mk-accent-ink: #FFB3C1;
  --mk-accent-soft: #3A1D24; --mk-accent-line: #6B2C3B; --mk-ring: rgba(255, 179, 193, .18);
  --mk-grad: linear-gradient(135deg, #A52A44 0%, #C23A55 100%);
  --mk-surface: #161214; --mk-card: #1F1A1C; --mk-line: #3A3135; --mk-dot: #3A3135;
  --mk-ink: #F1EBED; --mk-ink-2: #D9CFD3; --mk-muted: #B3A6AB;
  --mk-ok: #3CCB7F; --mk-ok-soft: rgba(60, 203, 127, .16); --mk-ok-ink: #8FD9B0;
  --mk-bad: #FF8A8A; --mk-bad-soft: rgba(255, 138, 138, .14); --mk-warn: #F3C27A; --mk-warn-soft: rgba(243, 194, 122, .14);
  --mk-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  --mk-shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 22px 48px rgba(0, 0, 0, .5);
}

@keyframes mk-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes mk-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 55% { transform: translateX(5px); } 80% { transform: translateX(-2px); } }
@keyframes mk-sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes mk-pop { 0% { transform: scale(.7); opacity: .3; } 60% { transform: scale(1.07); opacity: 1; } 100% { transform: none; } }
@keyframes mk-draw { to { stroke-dashoffset: 0; } }
@keyframes mk-ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes mk-cd { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ── floating card on a dotted surface ─────────────────────────────────────────────────────── */
.mk-stage { position: relative; isolation: isolate; }
.mk-stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--mk-dot) 1px, transparent 1.3px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(60% 60% at 50% 42%, #000 0%, transparent 100%);
  mask-image: radial-gradient(60% 60% at 50% 42%, #000 0%, transparent 100%);
}
.mk-float {
  background: var(--mk-card); border-radius: 24px;
  box-shadow: inset 0 0 0 1px var(--mk-line), var(--mk-shadow-lg);
  animation: mk-in 520ms var(--mk-spring) both;
}
.mk-shake { animation: mk-shake 380ms var(--mk-ease); }

/* ── fields: soft ring on focus, shake when marked wrong ──────────────────────────────────── */
.mk-fields input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
.mk-fields select, .mk-fields textarea {
  transition: border-color .2s ease, box-shadow .25s ease, background-color .25s ease;
}
.mk-fields input:not([type=checkbox]):not([type=radio]):focus,
.mk-fields select:focus, .mk-fields textarea:focus {
  outline: none !important; border-color: var(--mk-accent) !important; box-shadow: 0 0 0 4px var(--mk-ring) !important;
}
.mk-fields [aria-invalid="true"] {
  border-color: var(--mk-bad) !important; box-shadow: 0 0 0 4px var(--mk-bad-soft) !important;
  animation: mk-shake 380ms var(--mk-ease);
}

/* ── buttons: busy sheen and a green "done" ───────────────────────────────────────────────── */
.mk-btns button[type="submit"], .mk-btns .mk-go, .mk-go {
  position: relative; overflow: hidden; transition: transform 90ms ease-out, background-color .3s ease, box-shadow .3s ease, opacity .2s ease;
}
.mk-btns button[type="submit"]:active:not([disabled]), .mk-go:active:not([disabled]) { transform: scale(.97); }
.mk-btns button[type="submit"][aria-busy="true"]::after, .mk-btns button[type="submit"].busy::after, .mk-go.is-busy::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%);
  background-size: 220% 100%; animation: mk-sheen 1.1s linear infinite;
}
.mk-go.is-ok, .mk-btns button[type="submit"].is-ok {
  background: var(--mk-ok) !important; border-color: var(--mk-ok) !important; color: #fff !important;
  box-shadow: 0 1px 2px rgba(22, 130, 75, .3), 0 10px 22px rgba(22, 130, 75, .22) !important;
}

/* ── 6-digit code boxes ───────────────────────────────────────────────────────────────────── */
.mk-code { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin: 6px 0 4px; }
.mk-code input {
  width: 100%; min-width: 0; height: 58px; padding: 0 !important; border: 0 !important; border-radius: 14px; text-align: center;
  font: 650 24px/1 inherit; font-variant-numeric: tabular-nums; color: var(--mk-ink); caret-color: var(--mk-accent);
  background: var(--mk-surface) !important; box-shadow: inset 0 0 0 1px var(--mk-line);
  transition: box-shadow .25s ease, background-color .25s ease, transform 90ms ease-out;
}
.mk-code input:focus { outline: none; background: var(--mk-card) !important; box-shadow: inset 0 0 0 1.5px var(--mk-accent), 0 0 0 4px var(--mk-ring) !important; }
.mk-code input.fill { background: var(--mk-card) !important; box-shadow: inset 0 0 0 1.5px var(--mk-accent-line); }
.mk-code input.pop { animation: mk-pop 420ms var(--mk-spring) both; animation-delay: calc(var(--i, 0) * 55ms); }
.mk-code.bad input { background: var(--mk-card) !important; box-shadow: inset 0 0 0 1.5px var(--mk-bad), 0 0 0 4px var(--mk-bad-soft) !important; }
.mk-code.bad { animation: mk-shake 380ms var(--mk-ease); }
.mk-code.ok input { background: var(--mk-ok-soft) !important; box-shadow: inset 0 0 0 1.5px var(--mk-ok); color: var(--mk-ok-ink); }
@media (max-width: 420px) { .mk-code { gap: 6px; } .mk-code input { height: 50px; font-size: 21px; } }
.mk-sr { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }

/* ── password meter ───────────────────────────────────────────────────────────────────────── */
.mk-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.mk-meter i { position: relative; overflow: hidden; height: 6px; border-radius: 3px; background: var(--mk-line); }
.mk-meter i::after { content: ""; position: absolute; inset: 0; border-radius: 3px; background: var(--mk-dot);
  transform: scaleX(0); transform-origin: left center; transition: transform 420ms var(--mk-ease), background-color 300ms ease; }
.mk-meter[data-l="1"] i:nth-child(-n+1)::after, .mk-meter[data-l="2"] i:nth-child(-n+2)::after,
.mk-meter[data-l="3"] i:nth-child(-n+3)::after, .mk-meter[data-l="4"] i::after { transform: scaleX(1); }
.mk-meter[data-l="1"] i::after { background: #E5484D; }
.mk-meter[data-l="2"] i::after { background: #F5A524; }
.mk-meter[data-l="3"] i::after { background: var(--mk-accent-2); }
.mk-meter[data-l="4"] i::after { background: var(--mk-ok); }
.mk-meter-st { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; font-size: 12.5px; font-weight: 600; color: var(--mk-muted); }
.mk-meter-st .h { font-weight: 500; text-align: right; }
.mk-meter-st .w { white-space: nowrap; }
.mk-meter[data-l="1"] + .mk-meter-st .w { color: #C8102E; }
.mk-meter[data-l="2"] + .mk-meter-st .w { color: #9A5200; }
.mk-meter[data-l="3"] + .mk-meter-st .w { color: var(--mk-accent-ink); }
.mk-meter[data-l="4"] + .mk-meter-st .w { color: var(--mk-ok-ink); }

/* ── unsaved-changes bar (profile/settings forms) ─────────────────────────────────────────── */
.mk-savebar {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 1200;
  display: flex; align-items: center; gap: 12px; width: min(560px, calc(100% - 24px)); padding: 12px 12px 12px 18px;
  border-radius: 16px; background: #1C1417; color: #fff; box-shadow: var(--mk-shadow-lg);
  transform: translate(-50%, 170%); transition: transform 420ms var(--mk-spring); font-size: 14px;
}
.mk-savebar.on { transform: translate(-50%, 0); }
.mk-savebar .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #FF8FA6; }
.mk-savebar p { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; }
.mk-savebar b { font-weight: 600; }
.mk-savebar small { color: rgba(255, 255, 255, .62); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-savebar button { min-height: 38px; padding: 0 14px; border: 0; border-radius: 10px; font: 600 13.5px/1 inherit; cursor: pointer; }
.mk-savebar .dis { background: rgba(255, 255, 255, .12); color: #fff; }
.mk-savebar .dis:hover { background: rgba(255, 255, 255, .2); }
.mk-savebar .sv { background: var(--mk-grad); color: #fff; box-shadow: 0 8px 18px rgba(122, 0, 25, .3); }
.mk-savebar button:focus-visible { outline: 2px solid #FF8FA6; outline-offset: 2px; }
@media (max-width: 560px) { .mk-savebar small { display: none; } }
body.mk-has-savebar { padding-bottom: 90px; }

/* ── snackbar with undo and a countdown ───────────────────────────────────────────────────── */
.mk-snack {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 1300;
  display: flex; align-items: center; gap: 12px; min-width: min(360px, calc(100% - 24px)); max-width: calc(100% - 24px);
  padding: 12px 8px 12px 16px; border-radius: 12px; overflow: hidden; background: #1C1417; color: #fff;
  font-size: 14px; font-weight: 500; box-shadow: var(--mk-shadow-lg);
  transform: translate(-50%, 160%); transition: transform 560ms var(--mk-ease);
}
.mk-snack.on { transform: translate(-50%, 0); }
.mk-snack .msg { flex: 1; min-width: 0; }
.mk-snack button { flex: none; min-height: 34px; padding: 6px 12px; border: 0; border-radius: 8px; background: none;
  color: #FF8FA6; font: 600 14px/1 inherit; cursor: pointer; }
.mk-snack button:hover { background: rgba(255, 255, 255, .1); }
.mk-snack button:focus-visible { outline: 2px solid #FF8FA6; outline-offset: 1px; }
.mk-snack .cd { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: #FF8FA6; transform-origin: left center; }
.mk-snack.on .cd { animation: mk-cd var(--mk-cd, 6000ms) linear forwards; }
.mk-snack:hover .cd, .mk-snack:focus-within .cd { animation-play-state: paused; }

/* ── toast pill ───────────────────────────────────────────────────────────────────────────── */
.mk-toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); z-index: 1300;
  display: flex; align-items: center; gap: 9px; max-width: calc(100% - 32px); padding: 10px 16px 10px 10px;
  border-radius: 999px; background: #1C1417; color: #fff; font-size: 13.5px; font-weight: 600; box-shadow: var(--mk-shadow-lg);
  opacity: 0; transform: translate(-50%, -14px); pointer-events: none; transition: opacity .25s ease, transform 587ms var(--mk-spring);
}
.mk-toast.on { opacity: 1; transform: translate(-50%, 0); }
.mk-toast s { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--mk-ok); text-decoration: none; flex: none; }
.mk-toast.bad s { background: #E5484D; }

/* ── dialogs (SweetAlert2 and <dialog>): grow in from the button, alerts shake ────────────── */
.swal2-popup.swal2-show { animation: mk-in-pop 420ms var(--mk-spring) both !important; }
@keyframes mk-in-pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
.swal2-popup { border-radius: 20px !important; box-shadow: var(--mk-shadow-lg) !important; }
.swal2-popup.mk-shake { animation: mk-shake 520ms ease-in-out !important; }
dialog.mk-dialog[open] { animation: mk-dialog-in 420ms var(--mk-spring) both; }
dialog.mk-dialog { border-radius: 20px; box-shadow: var(--mk-shadow-lg); }
@keyframes mk-dialog-in { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }
dialog.mk-dialog::backdrop { background: rgba(20, 8, 12, .42); animation: mk-fade .3s ease both; }
@keyframes mk-fade { from { opacity: 0; } }

/* ── empty and no-results states ──────────────────────────────────────────────────────────── */
.mk-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 16px;
  color: var(--mk-muted); animation: mk-in 520ms var(--mk-spring) both; }
.mk-empty svg.mk-ill { width: min(180px, 55%); height: auto; margin-bottom: 8px; overflow: visible; }
.mk-empty .mk-ill .f1 { fill: var(--mk-accent-soft); } .mk-empty .mk-ill .f4 { fill: var(--mk-line); } .mk-empty .mk-ill .f5 { fill: var(--mk-card); }
.mk-empty .mk-ill .k1 { fill: none; stroke: var(--mk-accent-line); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mk-empty .mk-ill .k2 { fill: none; stroke: var(--mk-accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.mk-empty .mk-lens { animation: mk-scan 4.2s ease-in-out infinite; }
@keyframes mk-scan { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-12px, 8px); } }
.mk-empty b { font-size: 17px; font-weight: 650; color: var(--mk-ink); letter-spacing: -.015em; }
.mk-empty p { margin: 0; max-width: 40ch; font-size: 14px; line-height: 1.5; }
.mk-empty .mk-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }

/* ── success check (draws itself) ─────────────────────────────────────────────────────────── */
.mk-okc { position: relative; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--mk-ok-soft); color: var(--mk-ok-ink); margin: 0 auto 14px; }
.mk-okc::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 2px var(--mk-ok); opacity: 0;
  animation: mk-ring 900ms var(--mk-ease) 200ms both; }
.mk-okc path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: mk-draw 650ms var(--mk-ease) 240ms forwards; }

/* ── segmented filter with a sliding highlight ────────────────────────────────────────────── */
.mk-seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px;
  border-radius: 11px; background: var(--mk-surface); box-shadow: inset 0 0 0 1px var(--mk-line); max-width: 100%; }
.mk-seg .hl { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n, 2));
  border-radius: 8px; background: var(--mk-card); box-shadow: 0 1px 3px rgba(42, 8, 18, .14);
  transform: translateX(calc(var(--i, 0) * 100%)); transition: transform 587ms var(--mk-spring); }
.mk-seg > a, .mk-seg > button { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: none; font: 600 13.5px/1 inherit;
  color: var(--mk-muted); text-decoration: none; white-space: nowrap; cursor: pointer; transition: color .2s ease; }
.mk-seg > a[aria-current], .mk-seg > button.on, .mk-seg > a.on { color: var(--mk-ink); }
.mk-seg > a:focus-visible, .mk-seg > button:focus-visible { outline: 2px solid var(--mk-accent); outline-offset: 1px; }

/* ── pills, live dot, row reveal ─────────────────────────────────────────────────────────── */
.mk-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: var(--mk-accent-soft);
  font-size: 12px; font-weight: 600; color: var(--mk-accent-ink); white-space: nowrap; }
.mk-pill.ok { background: var(--mk-ok-soft); color: var(--mk-ok-ink); }
.mk-pill.warn { background: var(--mk-warn-soft); color: var(--mk-warn); }
.mk-pill.mute { background: var(--mk-surface); color: var(--mk-ink-2); box-shadow: inset 0 0 0 1px var(--mk-line); }
.mk-live { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mk-ok); flex: none; }
.mk-live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--mk-ok); animation: mk-ping 2.2s ease-out infinite; }
@keyframes mk-ping { 0% { opacity: .5; transform: scale(1); } 80%, 100% { opacity: 0; transform: scale(2.6); } }
.mk-rows > * { animation: mk-in 420ms var(--mk-spring) both; }
.mk-rows > *:nth-child(2) { animation-delay: 30ms; } .mk-rows > *:nth-child(3) { animation-delay: 60ms; }
.mk-rows > *:nth-child(4) { animation-delay: 90ms; } .mk-rows > *:nth-child(5) { animation-delay: 120ms; }
.mk-rows > *:nth-child(6) { animation-delay: 150ms; } .mk-rows > *:nth-child(n+7) { animation-delay: 180ms; }
.mk-expand { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--mk-ease); }
.mk-expand > * { min-height: 0; overflow: hidden; }
.mk-expand.open { grid-template-rows: 1fr; }

@media (prefers-reduced-motion: reduce) {
  .mk-float, .mk-shake, .mk-fields [aria-invalid="true"], .mk-code input.pop, .mk-code.bad, .mk-empty, .mk-empty .mk-lens,
  .mk-okc::after, .mk-rows > *, .mk-live::after, .swal2-popup.swal2-show, dialog.mk-dialog[open] { animation: none !important; }
  .mk-okc path { stroke-dashoffset: 0; animation: none; }
  .mk-btns button[type="submit"][aria-busy="true"]::after, .mk-go.is-busy::after { animation: none; }
  .mk-savebar, .mk-snack, .mk-toast, .mk-seg .hl, .mk-meter i::after, .mk-expand { transition-duration: .01ms !important; }
  .mk-snack.on .cd { animation-duration: var(--mk-cd, 6000ms); }
}
