/* =========================================================
   IndigiTrail Motion System v13
   Smooth, restrained motion for learner + instructor UI.
   Design goal: premium dashboard motion without changing app logic.
   ========================================================= */

:root {
  --it-motion-fast: 140ms;
  --it-motion-ui: 190ms;
  --it-motion-medium: 260ms;
  --it-motion-slow: 520ms;
  --it-motion-ease-out: cubic-bezier(.22, .78, .28, 1);
  --it-motion-ease-standard: cubic-bezier(.4, 0, .2, 1);
  --it-motion-ease-soft: cubic-bezier(.2, .7, .2, 1);
}

/* ---------------------------------------------------------
   Page navigation stability — v11 no-flash architecture

   Cross-document View Transitions are intentionally disabled. In testing,
   browser-owned document snapshots could expose a blank/cream frame while
   navigating between separate HTML documents. Instead, each new page paints
   normally and only the already-visible center content receives a tiny
   transform-only settle. No opacity is used, so there is no blank frame.
   --------------------------------------------------------- */

/* Keep the compositor work local and avoid accidental page-wide fades. */
body.student-dashboard-body .student-dashboard-content,
body.teacher-dashboard-body .teacher-dashboard-content,
body.it-auth-page .it-auth-shell,
body.login-body .forgot-password-wrapper {
  backface-visibility: hidden;
  transform: translateZ(0);
}

/* Learner and instructor dashboards now use the exact same page-level motion:
   visible immediately, then a tiny transform-only settle. */
html.indigi-motion-v13 body.student-dashboard-body .student-dashboard-content,
html.indigi-motion-v13 body.teacher-dashboard-body .teacher-dashboard-content,
html.indigi-motion-v13 body.it-auth-page .it-auth-shell,
html.indigi-motion-v13 body.login-body .forgot-password-wrapper {
  animation: itContentSettleV13 145ms cubic-bezier(.22, .78, .28, 1) both;
}

@keyframes itContentSettleV13 {
  from { transform: translate3d(0, 3px, 0); }
  to   { transform: translate3d(0, 0, 0); }
}

/* ---------------------------------------------------------
   Sidebar navigation feedback
   --------------------------------------------------------- */
body.student-dashboard-body .student-sidebar-nav a,
body.teacher-dashboard-body .teacher-sidebar-nav a {
  position: relative;
  transition:
    background-color var(--it-motion-ui) var(--it-motion-ease-standard),
    color var(--it-motion-ui) var(--it-motion-ease-standard),
    border-color var(--it-motion-ui) var(--it-motion-ease-standard),
    box-shadow var(--it-motion-ui) var(--it-motion-ease-standard);
}

body.student-dashboard-body .student-sidebar-nav a::before,
body.teacher-dashboard-body .teacher-sidebar-nav a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  transform: scaleY(.35);
  transform-origin: center;
  transition:
    opacity var(--it-motion-ui) ease,
    transform var(--it-motion-ui) var(--it-motion-ease-out);
  pointer-events: none;
}

body.student-dashboard-body .student-sidebar-nav a.active::before,
body.teacher-dashboard-body .teacher-sidebar-nav a.active::before {
  opacity: .62;
  transform: scaleY(1);
}

body.student-dashboard-body .student-sidebar-nav a > *,
body.teacher-dashboard-body .teacher-sidebar-nav a > * {
  transition: transform var(--it-motion-ui) var(--it-motion-ease-out);
}
body.student-dashboard-body .student-sidebar-nav a:not(.active):hover > *,
body.teacher-dashboard-body .teacher-sidebar-nav a:not(.active):hover > * {
  transform: translateX(2px);
}

/* ---------------------------------------------------------
   Topbar/profile feedback
   --------------------------------------------------------- */
body.student-dashboard-body .student-profile-link {
  transition:
    background-color var(--it-motion-ui) ease,
    box-shadow var(--it-motion-ui) ease,
    color var(--it-motion-ui) ease;
}
body.student-dashboard-body .student-profile-link .student-user-avatar {
  transition:
    box-shadow var(--it-motion-ui) ease,
    border-color var(--it-motion-ui) ease,
    filter var(--it-motion-ui) ease;
}
body.student-dashboard-body .student-profile-link:hover .student-user-avatar {
  filter: brightness(1.035);
  box-shadow: 0 0 0 4px rgba(31, 90, 58, .10);
}

/* ---------------------------------------------------------
   Buttons and form controls
   Avoid global transform changes: some existing controls use
   transform for positioning/centering.
   --------------------------------------------------------- */
body.student-dashboard-body button,
body.student-dashboard-body a.learner-logout-btn,
body.student-dashboard-body a.student-logout-btn,
body.teacher-dashboard-body button,
body.teacher-dashboard-body a.teacher-logout-btn,
body.it-auth-page button,
body.login-body button,
.indigi-message-card button {
  transition:
    background-color var(--it-motion-ui) var(--it-motion-ease-standard),
    border-color var(--it-motion-ui) var(--it-motion-ease-standard),
    color var(--it-motion-ui) var(--it-motion-ease-standard),
    box-shadow var(--it-motion-ui) var(--it-motion-ease-standard),
    filter var(--it-motion-fast) ease,
    opacity var(--it-motion-fast) ease;
}

body.student-dashboard-body button:not(:disabled):hover,
body.student-dashboard-body a.learner-logout-btn:hover,
body.student-dashboard-body a.student-logout-btn:hover,
body.teacher-dashboard-body button:not(:disabled):hover,
body.teacher-dashboard-body a.teacher-logout-btn:hover,
body.it-auth-page button:not(:disabled):hover,
body.login-body button:not(:disabled):hover,
.indigi-message-card button:not(:disabled):hover {
  filter: brightness(1.035);
}

body.student-dashboard-body button:not(:disabled):active,
body.student-dashboard-body a.learner-logout-btn:active,
body.student-dashboard-body a.student-logout-btn:active,
body.teacher-dashboard-body button:not(:disabled):active,
body.teacher-dashboard-body a.teacher-logout-btn:active,
body.it-auth-page button:not(:disabled):active,
body.login-body button:not(:disabled):active,
.indigi-message-card button:not(:disabled):active {
  filter: brightness(.975);
}

body.student-dashboard-body input,
body.student-dashboard-body select,
body.student-dashboard-body textarea,
body.teacher-dashboard-body input,
body.teacher-dashboard-body select,
body.teacher-dashboard-body textarea,
body.it-auth-page input,
body.it-auth-page select,
body.login-body input {
  transition:
    border-color var(--it-motion-fast) ease,
    box-shadow var(--it-motion-fast) ease,
    background-color var(--it-motion-fast) ease;
}

/* ---------------------------------------------------------
   Universal IndigiTrail custom dropdowns.
   The original native <select> remains the data source while
   the visible control gets the same branded arrow, animated
   menu, selection state, and keyboard interaction everywhere.
   --------------------------------------------------------- */
.it-custom-select {
  position: relative;
  width: 100%;
  min-width: 0;
  z-index: 20;
  font: inherit;
}

.it-custom-select.is-open,
.it-custom-select.is-closing {
  z-index: 1000;
}

.it-native-select-source {
  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;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.it-select-trigger {
  width: 100%;
  min-height: 48px;
  padding: 0 9px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-sizing: border-box;
  border: 1px solid rgba(132, 101, 67, .22);
  border-radius: 14px;
  background: #fffdf9;
  color: #30271f;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(54, 39, 24, .04);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    transform 180ms var(--it-motion-ease-out);
}

.it-select-trigger:hover:not(:disabled) {
  border-color: rgba(47, 107, 63, .46);
  background: #fffefb;
  box-shadow: 0 7px 18px rgba(54, 39, 24, .07);
}

.it-custom-select.is-open .it-select-trigger {
  border-color: #2f6b3f;
  background: #fffefb;
  box-shadow: 0 0 0 3px rgba(47, 107, 63, .11), 0 9px 22px rgba(54, 39, 24, .08);
  transform: translateY(-1px);
}

.it-select-trigger:focus-visible {
  outline: none;
  border-color: #2f6b3f;
  box-shadow: 0 0 0 3px rgba(47, 107, 63, .15), 0 8px 20px rgba(54, 39, 24, .07);
}

.it-custom-select.is-disabled .it-select-trigger,
.it-select-trigger:disabled {
  cursor: not-allowed;
  opacity: .68;
  background: #f4f0e9;
}

.it-select-value {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.it-select-arrow {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: block;
  border: 1px solid rgba(47, 107, 63, .16);
  border-radius: 10px;
  background: rgba(47, 107, 63, .10);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
  transition:
    transform 220ms cubic-bezier(.2,.75,.25,1),
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.it-select-arrow::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 44%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #2f6b3f;
  border-bottom: 2px solid #2f6b3f;
  transform: translate(-50%, -50%) rotate(45deg);
  transform-origin: center;
  transition:
    transform 240ms cubic-bezier(.2,.82,.25,1),
    border-color 180ms ease;
}

.it-custom-select.is-open .it-select-arrow {
  background: #2f6b3f;
  border-color: #2f6b3f;
  box-shadow: 0 5px 12px rgba(47, 107, 63, .20);
  transform: scale(1.05);
}

.it-custom-select.is-open .it-select-arrow::before {
  border-color: #fff;
  transform: translate(-50%, -32%) rotate(-135deg);
}

.it-custom-select.it-select-changed .it-select-arrow {
  animation: itCustomSelectSettle 220ms var(--it-motion-ease-out) both;
}

.it-select-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  max-height: 280px;
  padding: 6px;
  overflow-y: auto;
  box-sizing: border-box;
  border: 1px solid rgba(94, 72, 49, .18);
  border-radius: 14px;
  background: rgba(255, 253, 249, .985);
  box-shadow: 0 18px 38px rgba(49, 36, 24, .16), 0 4px 12px rgba(49, 36, 24, .07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(.975);
  transform-origin: top center;
  z-index: 2147483000 !important;
  transition:
    opacity 160ms ease,
    transform 190ms cubic-bezier(.2,.78,.25,1),
    visibility 0s linear 190ms;
}

.it-select-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.it-select-option {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #33271e;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    background-color 150ms ease,
    color 150ms ease,
    transform 150ms ease,
    opacity 150ms ease;
}

.it-select-menu.is-open .it-select-option {
  animation: itCustomSelectOptionIn 170ms cubic-bezier(.2,.78,.25,1) both;
  animation-delay: calc(var(--it-select-index, 0) * 20ms);
}

.it-select-option:hover:not(:disabled),
.it-select-option:focus-visible:not(:disabled) {
  outline: none;
  background: rgba(47, 107, 63, .09);
  color: #174f35;
  transform: translateX(2px);
}

.it-select-option.is-selected {
  background: linear-gradient(90deg, #23643f, #2f774c);
  color: #fff;
  box-shadow: 0 4px 10px rgba(35, 100, 63, .15);
}

.it-select-option.is-selected::after {
  content: "✓";
  margin-left: auto;
  padding-left: 10px;
  font-size: 12px;
  font-weight: 900;
}

.it-select-option.is-selected:hover,
.it-select-option.is-selected:focus-visible {
  background: linear-gradient(90deg, #1d5937, #296c45);
  color: #fff;
}

.it-select-option:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.it-select-group-label {
  padding: 8px 10px 5px;
  color: #7b6a5a;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@keyframes itCustomSelectOptionIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes itCustomSelectSettle {
  0% { transform: scale(.94); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* ---------------------------------------------------------
   Teacher cards: subtle load stagger + hover polish.
   Learner cards already have page-specific motion in learner-polish.css.
   --------------------------------------------------------- */
body.teacher-dashboard-body :is(
  .teacher-dashboard-summary-card,
  .classes-panel-card,
  .class-progress-summary-card,
  .weekly-release-class-card,
  .weekly-release-summary-card,
  .quiz-builder-card,
  .teacher-leaderboard-summary-card,
  .submissions-summary-card,
  .reports-filter-card,
  .report-summary-redesign-card,
  .reports-analytics-card,
  .reports-student-details-card,
  .submissions-filter-card,
  .submissions-table-card
) {
  animation: itCardReveal 260ms var(--it-motion-ease-out) backwards;
  transition:
    transform var(--it-motion-ui) var(--it-motion-ease-out),
    box-shadow var(--it-motion-ui) var(--it-motion-ease-standard),
    border-color var(--it-motion-ui) var(--it-motion-ease-standard);
}

body.teacher-dashboard-body :is(
  .teacher-dashboard-summary-card,
  .class-progress-summary-card,
  .weekly-release-summary-card,
  .teacher-leaderboard-summary-card,
  .submissions-summary-card,
  .report-summary-redesign-card
):hover {
  transform: translateY(-2px);
}

body.teacher-dashboard-body .teacher-dashboard-summary-grid > *:nth-child(2),
body.teacher-dashboard-body .reports-summary-redesign-grid > *:nth-child(2),
body.teacher-dashboard-body .submissions-summary-grid > *:nth-child(2) { animation-delay: 24ms; }
body.teacher-dashboard-body .teacher-dashboard-summary-grid > *:nth-child(3),
body.teacher-dashboard-body .reports-summary-redesign-grid > *:nth-child(3),
body.teacher-dashboard-body .submissions-summary-grid > *:nth-child(3) { animation-delay: 48ms; }
body.teacher-dashboard-body .teacher-dashboard-summary-grid > *:nth-child(4),
body.teacher-dashboard-body .reports-summary-redesign-grid > *:nth-child(4),
body.teacher-dashboard-body .submissions-summary-grid > *:nth-child(4) { animation-delay: 72ms; }
body.teacher-dashboard-body .teacher-dashboard-summary-grid > *:nth-child(5),
body.teacher-dashboard-body .reports-summary-redesign-grid > *:nth-child(5) { animation-delay: 96ms; }
body.teacher-dashboard-body .teacher-dashboard-summary-grid > *:nth-child(6),
body.teacher-dashboard-body .reports-summary-redesign-grid > *:nth-child(6) { animation-delay: 120ms; }

@keyframes itCardReveal {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   Tables: rows reveal softly and hover without shifting layout.
   Newly rendered Firebase rows automatically receive the animation
   because the animation is selector-based (no MutationObserver).
   --------------------------------------------------------- */
body.student-dashboard-body table tbody tr,
body.teacher-dashboard-body table tbody tr {
  animation: itRowReveal 210ms var(--it-motion-ease-out) both;
  transition:
    background-color var(--it-motion-fast) ease,
    box-shadow var(--it-motion-fast) ease;
}
body.student-dashboard-body table tbody tr:nth-child(2),
body.teacher-dashboard-body table tbody tr:nth-child(2) { animation-delay: 18ms; }
body.student-dashboard-body table tbody tr:nth-child(3),
body.teacher-dashboard-body table tbody tr:nth-child(3) { animation-delay: 36ms; }
body.student-dashboard-body table tbody tr:nth-child(4),
body.teacher-dashboard-body table tbody tr:nth-child(4) { animation-delay: 54ms; }
body.student-dashboard-body table tbody tr:nth-child(5),
body.teacher-dashboard-body table tbody tr:nth-child(5) { animation-delay: 72ms; }
body.student-dashboard-body table tbody tr:nth-child(n+6),
body.teacher-dashboard-body table tbody tr:nth-child(n+6) { animation-delay: 90ms; }

@keyframes itRowReveal {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   Tabs / conditional panels
   display:none -> display:block naturally restarts this animation.
   --------------------------------------------------------- */
body.teacher-dashboard-body .submission-tab {
  position: relative;
  overflow: hidden;
  transition:
    color var(--it-motion-ui) ease,
    background-color var(--it-motion-ui) ease,
    border-color var(--it-motion-ui) ease,
    box-shadow var(--it-motion-ui) ease;
}
body.teacher-dashboard-body .submission-tab::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition:
    transform var(--it-motion-ui) var(--it-motion-ease-out),
    opacity var(--it-motion-ui) ease;
}
body.teacher-dashboard-body .submission-tab.active::after {
  transform: scaleX(1);
  opacity: .72;
}
body.teacher-dashboard-body .submission-tab-content,
body.student-dashboard-body .quiz-result-card,
body.student-dashboard-body .enrolled-class-card {
  animation: itPanelIn 220ms var(--it-motion-ease-out) both;
}
@keyframes itPanelIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------
   Progress + analytics
   --------------------------------------------------------- */
body.student-dashboard-body [class*="progress"][class*="fill"],
body.student-dashboard-body [class*="progress-bar"],
body.teacher-dashboard-body [class*="progress"][class*="fill"],
body.teacher-dashboard-body [class*="progress-bar"],
body.teacher-dashboard-body .report-quiz-bar-fill {
  transition:
    width 580ms var(--it-motion-ease-soft),
    height 580ms var(--it-motion-ease-soft);
}

body.teacher-dashboard-body .report-quiz-bar-fill {
  transform-origin: bottom;
  animation: itBarGrow 520ms var(--it-motion-ease-out) both;
}
body.teacher-dashboard-body .report-quiz-bar-item:nth-child(2) .report-quiz-bar-fill { animation-delay: 35ms; }
body.teacher-dashboard-body .report-quiz-bar-item:nth-child(3) .report-quiz-bar-fill { animation-delay: 70ms; }
body.teacher-dashboard-body .report-quiz-bar-item:nth-child(4) .report-quiz-bar-fill { animation-delay: 105ms; }
body.teacher-dashboard-body .report-quiz-bar-item:nth-child(5) .report-quiz-bar-fill { animation-delay: 140ms; }
body.teacher-dashboard-body .report-quiz-bar-item:nth-child(n+6) .report-quiz-bar-fill { animation-delay: 175ms; }
@keyframes itBarGrow {
  from { opacity: .25; transform: scaleY(.05); }
  to { opacity: 1; transform: scaleY(1); }
}

body.teacher-dashboard-body .report-donut {
  animation: itDonutIn 420ms var(--it-motion-ease-out) both;
  transition: background 420ms var(--it-motion-ease-standard);
}
@keyframes itDonutIn {
  from { opacity: .45; transform: scale(.94) rotate(-4deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

/* ---------------------------------------------------------
   Status pills and stateful UI
   --------------------------------------------------------- */
body.student-dashboard-body :is(
  .enrolled-status-badge,
  .student-quiz-status-badge,
  .quiz-attempt-label,
  .achievement-status-label,
  .report-metric-pill
),
body.teacher-dashboard-body :is(
  .release-status,
  .reattempt-status-badge,
  .class-table-status,
  .report-metric-pill,
  .teacher-portal-table-badge,
  .quiz-status-badge
) {
  transition:
    background-color var(--it-motion-ui) var(--it-motion-ease-standard),
    color var(--it-motion-ui) var(--it-motion-ease-standard),
    border-color var(--it-motion-ui) var(--it-motion-ease-standard),
    box-shadow var(--it-motion-ui) var(--it-motion-ease-standard);
}

/* ---------------------------------------------------------
   Modals / dialogs. Existing layout/display rules remain authoritative.
   --------------------------------------------------------- */
body.student-dashboard-body .profile-modal-overlay.show,
body.student-dashboard-body .submission-details-overlay.is-open,
body.teacher-dashboard-body .teacher-modal-overlay.show,
body.teacher-dashboard-body .quiz-preview-modal.show,
body.teacher-dashboard-body .instructor-invite-modal:not([hidden]),
.indigi-message-overlay.active {
  animation: itBackdropIn 170ms ease both;
}

body.student-dashboard-body .profile-modal-overlay.show .profile-modal-card,
body.student-dashboard-body .submission-details-overlay.is-open .submission-details-modal,
body.teacher-dashboard-body .teacher-modal-overlay.show .teacher-modal-card,
body.teacher-dashboard-body .quiz-preview-modal.show .quiz-preview-card-modal,
body.teacher-dashboard-body .instructor-invite-modal:not([hidden]) .instructor-invite-dialog,
.indigi-message-overlay.active .indigi-message-card {
  transform-origin: center;
  animation: itDialogIn 210ms var(--it-motion-ease-out) both;
}

@keyframes itBackdropIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes itDialogIn {
  from { opacity: 0; transform: translateY(7px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Exit motion is opt-in through window.indigiAnimatePopupClose().
   Existing page scripts still decide when a popup is actually hidden. */
.it-popup-closing {
  pointer-events: none !important;
  animation: itBackdropOut 180ms ease both !important;
}

.it-popup-closing > [role="dialog"],
.it-popup-closing .indigi-message-card,
.it-popup-closing .profile-modal-card,
.it-popup-closing .submission-details-modal,
.it-popup-closing .teacher-modal-card,
.it-popup-closing .quiz-preview-dialog,
.it-popup-closing .instructor-invite-dialog {
  transform-origin: center;
  animation: itDialogOut 170ms cubic-bezier(.4, 0, 1, 1) both !important;
}

@keyframes itBackdropOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes itDialogOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(6px) scale(.985); }
}

/* ---------------------------------------------------------
   3D game page confirmation overlay.
   The game page intentionally does not load the full dashboard stylesheet,
   so provide the shared confirmation board styling here.
   --------------------------------------------------------- */
body.student-game-body .indigi-message-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(35, 24, 15, .56);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .22s ease, visibility .22s ease;
}
body.student-game-body .indigi-message-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
body.student-game-body .indigi-message-card {
  width: min(460px, 100%);
  box-sizing: border-box;
  padding: 34px 32px 30px;
  border: 1px solid rgba(203, 187, 164, .92);
  border-radius: 26px;
  background: rgba(255, 253, 249, .98);
  box-shadow: 0 24px 60px rgba(0,0,0,.28);
  text-align: center;
}
body.student-game-body .indigi-message-logo {
  width: 82px;
  height: 82px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f4eadb;
}
body.student-game-body .indigi-message-logo img { width: 100%; height: 100%; object-fit: contain; }
body.student-game-body .indigi-message-card h2 { margin: 0 0 10px; color: #2f6b3f; font-size: 28px; font-weight: 800; }
body.student-game-body .indigi-message-card p { margin: 0 auto 22px; max-width: 375px; color: #5b4632; font-size: 15px; line-height: 1.55; }
body.student-game-body .indigi-message-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
body.student-game-body .indigi-message-btn {
  min-width: 126px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 24px;
  border: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
body.student-game-body .indigi-message-btn.primary { background: linear-gradient(90deg, #8a5a00, #a8731c); color: #fffdf9; }
body.student-game-body .indigi-message-btn.secondary { background: #efe4d3; color: #5b4632; border: 1px solid #d1bfa7; }

/* ---------------------------------------------------------
   Loading/auth feedback
   --------------------------------------------------------- */
body.it-auth-page .it-auth-loading.active,
body.login-body .login-loading-overlay.active,
body.student-dashboard-body .login-loading-overlay.active,
body.teacher-dashboard-body .login-loading-overlay.active {
  animation: itBackdropIn 170ms ease both;
}

body.it-auth-page .it-auth-loading.active > *,
body.login-body .login-loading-overlay.active .login-loading-card,
body.student-dashboard-body .login-loading-overlay.active .login-loading-card,
body.teacher-dashboard-body .login-loading-overlay.active .login-loading-card {
  animation: itDialogIn 210ms var(--it-motion-ease-out) both;
}

.portal-loading-card,
.report-chart-empty {
  position: relative;
  overflow: hidden;
}
.portal-loading-card::after,
.report-chart-empty::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-110%);
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.42) 50%, transparent 80%);
  animation: itShimmer 1.35s ease-in-out infinite;
  pointer-events: none;
}
@keyframes itShimmer {
  to { transform: translateX(110%); }
}

/* ---------------------------------------------------------
   Learner Home primary adventure action
   --------------------------------------------------------- */
body.student-dashboard-body .hub-enter-btn {
  transition:
    box-shadow var(--it-motion-ui) ease,
    filter var(--it-motion-ui) ease,
    background-color var(--it-motion-ui) ease;
}
body.student-dashboard-body .hub-enter-btn:hover {
  box-shadow: 0 13px 28px rgba(6, 35, 16, .30);
}

.submission-tab-content.it-tab-replay {
  animation: itPanelIn 220ms var(--it-motion-ease-out) both;
}

/* ---------------------------------------------------------
   Accessibility: honor reduced-motion preference.
   --------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0ms !important;
  }
}


/* =========================================================
   Motion v8 — viewport-portaled dropdown menus
   ========================================================= */
.it-select-menu {
  position: fixed !important;
  margin: 0 !important;
  z-index: 2147483000 !important;
  isolation: isolate;
}

.it-select-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.it-select-menu.is-closing {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transform: translateY(-7px) scale(.98);
}

.it-select-menu.opens-upward {
  transform-origin: bottom center;
}

.it-select-menu.opens-upward:not(.is-open) {
  transform: translateY(7px) scale(.975);
}

.it-select-menu.opens-upward.is-closing {
  transform: translateY(7px) scale(.98);
}

.it-select-menu.is-open .it-select-option {
  animation: itCustomSelectOptionIn 170ms cubic-bezier(.2,.78,.25,1) both;
  animation-delay: calc(var(--it-select-index, 0) * 20ms);
}


/* =========================================================
   Motion v13.1 — custom select trigger isolation
   Prevent page-level CTA button rules from restyling the
   generated dropdown trigger (notably Quiz Builder's
   Update Portal row).
   ========================================================= */
body.student-dashboard-body .it-custom-select > .it-select-trigger,
body.teacher-dashboard-body .it-custom-select > .it-select-trigger {
  min-height: 48px;
  padding: 0 9px 0 14px;
  border: 1px solid rgba(132, 101, 67, .22);
  border-radius: 14px;
  background: #fffdf9;
  color: #30271f;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
  box-shadow: 0 4px 12px rgba(54, 39, 24, .04);
}

body.student-dashboard-body .it-custom-select > .it-select-trigger:hover:not(:disabled),
body.teacher-dashboard-body .it-custom-select > .it-select-trigger:hover:not(:disabled) {
  border-color: rgba(47, 107, 63, .46);
  background: #fffefb;
  color: #30271f;
  box-shadow: 0 7px 18px rgba(54, 39, 24, .07);
  transform: none;
}

body.student-dashboard-body .it-custom-select.is-open > .it-select-trigger,
body.teacher-dashboard-body .it-custom-select.is-open > .it-select-trigger {
  border-color: #2f6b3f;
  background: #fffefb;
  color: #30271f;
  box-shadow: 0 0 0 3px rgba(47, 107, 63, .11), 0 9px 22px rgba(54, 39, 24, .08);
  transform: none;
}

/* More legible arrow treatment on light dropdown triggers. */
body.student-dashboard-body .it-custom-select > .it-select-trigger .it-select-arrow,
body.teacher-dashboard-body .it-custom-select > .it-select-trigger .it-select-arrow {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-color: rgba(47, 107, 63, .22);
  background: rgba(47, 107, 63, .11);
}

body.student-dashboard-body .it-custom-select.is-open > .it-select-trigger .it-select-arrow,
body.teacher-dashboard-body .it-custom-select.is-open > .it-select-trigger .it-select-arrow {
  background: #2f6b3f;
  border-color: #2f6b3f;
  box-shadow: 0 5px 12px rgba(47, 107, 63, .20);
}
