/* هدف · navy, gold and softly raised surfaces from the design lab. */
:root {
  color-scheme: light;
  --brand-navy: #101b39;
  --brand-green: #2e9e72;
  --brand-gold: #f5b928;
  --neutral-50: #f7f5ef;
  --neutral-100: #f2f0e9;
  --neutral-200: #e8e3d6;
  --neutral-300: #d8d2c4;
  --neutral-400: #b9b4aa;
  --neutral-500: #878696;
  --neutral-600: #707789;
  --neutral-700: #4a5870;
  --neutral-800: #2d3952;
  --neutral-900: #1c2941;
  --neutral-950: #101b39;
  --color-text-primary: #101b39;
  --color-text-secondary: #4a5870;
  --color-text-muted: #707789;
  --color-background: #f7f5ef;
  --color-border: #e8e3d6;
}

html { background: var(--neutral-50); }
body {
  background: var(--neutral-50);
  color: var(--neutral-900);
  font-size: 16px;
}

.topbar {
  background: rgba(247, 245, 239, .96);
  border-bottom: 1px solid rgba(216, 210, 196, .75);
  box-shadow: 0 4px 14px rgba(16, 27, 57, .045);
}
.brand-mark {
  background: linear-gradient(150deg, #233b68, #0b1732);
  border-color: #395781;
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 4px 0 #071126;
}
.brand-mark img { filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); }
.brand-copy strong, .breadcrumbs strong { color: var(--navy-950); }
.brand-copy small { color: var(--neutral-600); }
.nav-link { color: var(--neutral-700); font-size: 15px; }
.nav-link:hover, .nav-link.active { color: var(--navy-950); }
.nav-link.active::after { height: 4px; background: var(--gold-500); }
.nav-link { white-space: nowrap; word-break: keep-all; }
.icon-button, .more-button, .menu-toggle {
  background: linear-gradient(180deg, #fffefa, #f5f0e4);
  border: 1px solid var(--neutral-200);
  box-shadow: 0 3px 0 #e1dacb, inset 0 1px rgba(255,255,255,.9);
}
.icon-button:hover, .more-button:hover, .menu-toggle:hover {
  background: linear-gradient(180deg, #fff8de, #f4e9bd);
  color: var(--navy-950);
  transform: translateY(-1px);
}
.header-login, .portal-role-switcher .role-switch[aria-pressed="true"] {
  background: linear-gradient(180deg, #203b68, #13264b);
  color: #fff;
  box-shadow: 0 4px 0 #0a1731, inset 0 1px rgba(255,255,255,.16);
}

/* Chunky game-like buttons with a clear pressed state. */
.button {
  min-height: 48px;
  border-radius: 14px;
  font-size: clamp(14px, 1.2vw + 2px, 16px);
  white-space: nowrap;
  word-break: keep-all;
  flex-shrink: 0;
  transition: transform .16s ease, filter .16s ease, box-shadow .16s ease;
}
.button:hover { transform: translateY(-2px); filter: brightness(1.035); }
.button:active { transform: translateY(2px); }
.button-primary {
  color: #483006;
  background: linear-gradient(180deg, #ffe47a 0%, #ffca42 54%, #eda916 100%);
  border: 1px solid #ffea94;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.68), 0 4px 0 #a5680b, 0 8px 14px rgba(4,10,24,.14);
}
.button-primary:hover { background: linear-gradient(180deg, #ffeb91 0%, #ffd257 54%, #f0b020 100%); }
.button-primary:active { box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 1px 0 #a5680b; }
.button-outline {
  color: var(--navy-950);
  background: linear-gradient(180deg, #fffefa, #f7f1e2);
  border: 1px solid #e5cf8b;
  box-shadow: inset 0 1px rgba(255,255,255,.92), 0 3px 0 #dfd3b3;
}
.button-outline:hover { background: linear-gradient(180deg, #fff7d8, #f4e7b8); border-color: #d8b44c; }
.button-soft, .button-light {
  color: #684900;
  background: linear-gradient(180deg, #fff2c7, #f4dc8d);
  border: 1px solid #f1d47b;
  box-shadow: inset 0 1px rgba(255,255,255,.86), 0 3px 0 #d6bd72;
}
.button-quiet { color: var(--neutral-800); }
.button-quiet:hover { color: var(--navy-950); background: rgba(245,185,40,.13); }

/* The welcome panel carries the same trophy-stage navy as the prototype. */
#view-home .hero {
  position: relative;
  min-height: 430px;
  margin: 22px auto 48px;
  padding: 42px clamp(24px, 5vw, 56px);
  overflow: hidden;
  border: 1px solid #314a73;
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(ellipse at 78% 54%, #243f6e 0%, #182c53 34%, #101b39 72%);
  box-shadow: 0 12px 0 #09152d, 0 22px 38px rgba(11,24,49,.17);
}
#view-home .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,215,93,.11), transparent 24%),
    linear-gradient(112deg, transparent 49.8%, rgba(255,255,255,.035) 50%, transparent 50.4%);
}
#view-home .hero-copy, #view-home .hero-visual { position: relative; z-index: 1; }
#view-home .hero h1 { color: #fff; }
#view-home .hero h1 em { color: #ffd155; text-shadow: 0 2px 0 #a76d13; }
#view-home .hero .eyebrow {
  color: #e4e9f2;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.13);
}
#view-home .eyebrow-dot { background: #ffd75d; box-shadow: 0 0 0 4px rgba(255,211,79,.16); }
#view-home .hero-lead { color: #d0d8e6; font-size: 16px; }
#view-home .hero .button-quiet { color: #f7f2e6; }
#view-home .hero .play-icon { color: #ffe078; background: rgba(255,255,255,.14); }
#view-home .hero-proof strong { color: #f3f5f9; }
#view-home .hero-proof small { color: #c1cde0; }
#view-home .hero-proof .avatar-stack span { border-color: #1c3158; }

/* Dashboard, course and onboarding surfaces. */
.dashboard-view, .course-view, .onboarding-view { background: var(--neutral-50); }
.dashboard-layout { background: var(--neutral-50); }
.sidebar {
  color: #eef2f8;
  background: linear-gradient(180deg, #182950, #101b39 76%, #0c1730);
  border-color: #263d64;
  box-shadow: inset -1px 0 rgba(255,255,255,.035);
}
.sidebar-profile, .sidebar-brand { border-color: rgba(255,255,255,.12); }
.sidebar-profile strong, .sidebar-brand .brand-copy strong { color: #fff; }
.sidebar-profile small, .sidebar-brand .brand-copy small, .sidebar-label { color: #b7c4d9; }
.advisor-layout .sidebar {
  color: #eef2f8;
  background: linear-gradient(180deg, #182950, #101b39 76%, #0c1730);
  border-color: #263d64;
}
.advisor-layout .sidebar .sidebar-label { color: #b7c4d9; }
.advisor-layout .sidebar .side-link { color: #d5deec; }
.advisor-layout .sidebar .side-link:hover { color: #fff; background: rgba(255,255,255,.09); }
.advisor-layout .sidebar .side-link.active {
  color: #493306;
  background: linear-gradient(180deg, #ffe47a, #efb32a);
  border-color: #ffeb9d;
  box-shadow: inset 0 1px rgba(255,255,255,.68), 0 3px 0 #a5680b;
}
.advisor-layout .sidebar .side-link.active svg { color: #614507; }
.dashboard-layout .sidebar {
  color: #eef2f8;
  background: linear-gradient(180deg, #182950, #101b39 76%, #0c1730);
  border-color: #263d64;
}
.dashboard-layout .sidebar .sidebar-label { color: #b7c4d9; }
.dashboard-layout .sidebar .sidebar-profile strong,
.dashboard-layout .sidebar .brand-copy strong { color: #fff; }
.dashboard-layout .sidebar .sidebar-profile small,
.dashboard-layout .sidebar .brand-copy small { color: #b7c4d9; }
.dashboard-layout .sidebar .side-link { color: #d5deec; }
.dashboard-layout .sidebar .side-link:hover { color: #fff; background: rgba(255,255,255,.09); }
.dashboard-layout .sidebar .side-link.active {
  color: #493306;
  background: linear-gradient(180deg, #ffe47a, #efb32a);
  border-color: #ffeb9d;
  box-shadow: inset 0 1px rgba(255,255,255,.68), 0 3px 0 #a5680b;
}
.dashboard-layout .sidebar .side-link.active svg { color: #614507; }
.side-link {
  min-height: 46px;
  color: #d5deec;
  border: 1px solid transparent;
  border-radius: 13px;
  white-space: nowrap;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.side-link:hover { color: #fff; background: rgba(255,255,255,.09); transform: translateY(-1px); }
.side-link.active {
  color: #493306;
  background: linear-gradient(180deg, #ffe47a, #efb32a);
  border-color: #ffeb9d;
  box-shadow: inset 0 1px rgba(255,255,255,.68), 0 3px 0 #a5680b;
}
.side-link.active svg { color: #614507; }
.side-count { color: #493306; background: #ffdc70; border: 1px solid rgba(255,255,255,.5); }
.dashboard-main, .parent-main { color: var(--neutral-900); }
.dashboard-topline { color: var(--neutral-700); }
.breadcrumbs button { color: var(--navy-900); font-weight: 800; }
.soft-label { color: var(--neutral-700); background: #fffdf7; border: 1px solid var(--neutral-200); border-radius: 999px; padding: 7px 12px; }
.panel-card, .course-card, .stat-card, .parent-overview, .parent-empty-state,
.parent-activity-card, .advisor-card, .onboarding-admin-card, .onboarding-assessment-card,
.course-player-card, .course-about-card, .course-files-card, .course-quiz-card,
.view.active [class$="-card"]:not(.course-hero-card):not(.course-art-card) {
  border-color: var(--neutral-200);
  border-radius: 18px;
  background: linear-gradient(155deg, #fffefa, #fffdf7);
  box-shadow: inset 0 1px rgba(255,255,255,.9), 0 4px 0 #e8e0cc, 0 11px 22px rgba(16,27,57,.055);
}
.course-card:hover, .view.active [class$="-card"]:not(.course-hero-card):not(.course-art-card):hover {
  box-shadow: inset 0 1px rgba(255,255,255,.9), 0 5px 0 #e4d8bb, 0 15px 26px rgba(16,27,57,.09);
}
.course-hero-card, .auth-story {
  color: #fff;
  background: radial-gradient(ellipse at 78% 45%, #263f6b, #182c53 42%, #101b39 78%);
  border: 1px solid #354f78;
  box-shadow: 0 8px 0 #09152d, 0 18px 35px rgba(11,24,49,.16);
}
#view-course .course-hero-card.math-course-hero {
  background-color: #101b39;
  background-image: linear-gradient(90deg, rgba(16,27,57,.27), rgba(16,27,57,.78) 58%, rgba(16,27,57,.94)), url("./assets/math-course-header.png");
  background-position: center 34%;
  background-repeat: no-repeat;
  background-size: cover;
}
#view-course .math-course-hero .course-hero-copy { text-shadow: none; }
#view-course .math-course-hero .course-hero-copy h1 { color: #fff; text-shadow: 0 2px 0 rgba(4,10,24,.28); }
#view-course .math-course-hero .course-hero-copy > p { color: #d0d8e6; text-shadow: none; }
.course-hero-copy h1, .auth-story-copy h2 { color: #fff; }
.course-hero-copy > p, .auth-story-copy > p { color: #d0d8e6; }
.course-hero-copy h1 em, .auth-story-copy h2 em { color: #ffd155; }
.course-subject-chip, .course-hero-tags span { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.1); color: #f5f2e8; }
.course-art-card { box-shadow: 0 8px 0 rgba(7,17,38,.34), 0 16px 28px rgba(0,0,0,.18); }
.student-summary {
  color: #fff;
  background: radial-gradient(ellipse at 78% 45%, #243f6e, #182c53 42%, #101b39 78%);
  border: 1px solid #354f78;
  box-shadow: 0 5px 0 #09152d, 0 13px 25px rgba(11,24,49,.13);
}
.summary-label { color: #f3d779; }
.summary-icon { color: #ffdc68; background: rgba(255,215,93,.14); }
.summary-progress span { background: linear-gradient(90deg, #f4b92c, #ffda68); }
.summary-footer, .summary-side-item small, .positive-change small { color: #c1cde0; }
.summary-side-item .side-icon { background: rgba(255,255,255,.11); }
.progress-track, .mini-progress { background: #e7dfcd; border: 1px solid #ddd3be; }
.progress-track > span, .mini-progress > span { background: linear-gradient(90deg, #f4b92c, #ffda68); }
.task-check, .step-check { color: #684900; background: #fff0bd; border-color: #e8c65c; }

/* Dialogs and forms. */
.modal-card, .auth-main {
  color: var(--neutral-900);
  background: linear-gradient(155deg, #fffefa, #f9f5e9);
  border: 1px solid var(--neutral-200);
  box-shadow: 0 8px 0 rgba(16,27,57,.1), 0 26px 72px rgba(16,27,57,.25);
}
.modal-symbol, .auth-story-mark { color: #684900; background: linear-gradient(145deg, #ffe47a, #eda916); box-shadow: inset 0 1px rgba(255,255,255,.7), 0 3px 0 #a5680b; }
.form-field input, .form-field select, .form-field textarea,
.auth-main input, .auth-main select {
  min-height: 46px;
  color: var(--neutral-900);
  background: #fffefa;
  border: 1px solid #dcd5c6;
  border-radius: 12px;
  box-shadow: inset 0 2px 4px rgba(16,27,57,.035);
  font-size: 15px;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus,
.auth-main input:focus, .auth-main select:focus { outline: 3px solid rgba(245,185,40,.24); border-color: #d8aa32; }
.site-footer { color: #e7ecf4; background: linear-gradient(145deg, #182950, #101b39); border-top: 4px solid #e9ae25; }
.site-footer .brand-copy strong { color: #fff; }
.site-footer .brand-copy small, .site-footer p, .footer-bottom { color: #bdc8da; }

/* Raise the smallest student-facing text to a comfortable reading size. */
.view.active small, .modal-card small, .auth-card small { font-size: max(12px, 1em) !important; }
.view.active :is(.eyebrow, .section-kicker, .sidebar-label, .breadcrumbs, .soft-label,
  .side-link, .nav-link, .course-subject-chip, .course-hero-tags span,
  [class*="badge"], [class*="status"], [class*="hint"], [class*="meta"],
  [class*="label"], [class*="foot"], [class*="note"], [class*="legend"]) {
  font-size: max(12px, 1em);
}
.view.active :is(.hero-lead, .course-card p, .panel-card p, .parent-welcome p,
  .parent-empty-state p, .modal-description, .auth-intro, .course-hero-copy > p) {
  font-size: max(14px, 1em);
  line-height: 1.9;
}
input, select, textarea { font-size: 15px; }

@media (max-width: 760px) {
  #view-home .hero {
    min-height: 0;
    margin: 14px auto 36px;
    padding: 30px 22px 28px;
    border-radius: 22px;
    box-shadow: 0 8px 0 #09152d, 0 16px 28px rgba(11,24,49,.15);
  }
  #view-home .hero h1 { letter-spacing: -.8px; }
  #view-home .hero-proof { margin-top: 24px; }
  .dashboard-main, .parent-main { background: var(--neutral-50); }
  .modal-card { border-radius: 19px; }
  .button { min-height: 46px; }
}

@media (max-width: 1024px) {
  .student-summary { grid-template-columns: 1fr; gap: 12px; }
  .summary-main { padding-inline: 0; border-left: 0; }
  .summary-side {
    grid-template-columns: repeat(2, minmax(0,1fr));
    padding: 12px 0 0;
    border-top: 1px solid rgba(255,255,255,.15);
  }
  .summary-side-item { min-width: 0; }
  .summary-side-item strong, .summary-side-item small { white-space: normal; }
}

@media (max-width: 1100px) and (min-width: 761px) {
  .topbar { gap: 14px; }
  .main-nav { gap: 14px; margin-inline-end: 14px; }
  .nav-link { white-space: nowrap; font-size: 14px; }
  .header-login { flex: 0 0 auto; min-width: max-content; padding-inline: 12px; white-space: nowrap; font-size: 14px; }
}

/* The dashboard keeps its controls on one line and uses full-width cards before text gets cramped. */
.view.active button, .view.active [role="button"], .view.active a.button,
.portal-role-switcher .role-switch, .header-login {
  white-space: nowrap;
  word-break: keep-all;
}
.portal-role-switcher .role-switch { flex: 0 0 auto; }
.view.active .breadcrumbs { display: flex; flex-wrap: nowrap; white-space: nowrap; }
.view.active :is(.soft-label, .course-subject-chip, .course-hero-tags span,
  [class*="badge"], [class*="status"]) { white-space: nowrap; word-break: keep-all; }
.parent-ring-legend { flex-wrap: wrap; justify-content: center; gap: 8px 10px; }
.parent-ring-legend span { flex: 0 0 auto; white-space: nowrap; word-break: keep-all; }
.student-analytics-grid .panel-heading,
.student-analytics-grid .panel-heading > div,
.student-analytics-grid .panel-heading h2 { min-width: 0; }
.student-analytics-grid .panel-heading h2 { line-height: 1.55; word-break: normal; }

@media (max-width: 1100px) {
  .today-dashboard-grid,
  .student-analytics-grid,
  .student-overview-top-grid { grid-template-columns: minmax(0, 1fr); }
  .student-overview-top-grid > .student-summary,
  .student-overview-top-grid > .advisor-overview-feature { grid-column: 1; grid-row: auto; }
}

@media (max-width: 760px) {
  .portal-role-switcher { gap: 5px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .portal-role-switcher::-webkit-scrollbar { display: none; }
  .portal-role-switcher .role-switch { padding-inline: 9px; font-size: 12px; }
  .main-nav.open .nav-link { white-space: nowrap; }
  .view.active button, .view.active [role="button"], .view.active a.button { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .button, .side-link, .course-card { transition-duration: .01ms; }
}
