/*
 * Physics SciEd Student Portal Theme
 * Shared learner shell v1.0
 */

:root {
  --student-navy: #10233f;
  --student-navy-soft: #18365f;
  --student-gold: #f3c632;
  --student-gold-hover: #dfaf1f;
  --student-cream: #fffdf0;
  --student-soft: #fff9c4;
  --student-white: #ffffff;
  --student-border: #e9e2c8;
  --student-border-strong: #d8cfae;
  --student-muted: #667085;
  --student-blue: #174ea6;
  --student-success: #176b4d;
  --student-warning: #9a3412;
  --student-danger: #b42318;
}

html {
  min-height: 100%;
  background: var(--student-cream);
}

body.psc-student-portal {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--student-navy) !important;
  background: var(--student-cream) !important;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.psc-student-portal *,
body.psc-student-portal *::before,
body.psc-student-portal *::after {
  box-sizing: border-box;
}

body.psc-student-portal img {
  max-width: 100%;
}

.student-portal-skip-link {
  position: fixed;
  top: -72px;
  left: 12px;
  z-index: 2100;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  color: var(--student-navy);
  background: var(--student-gold);
  border: 2px solid white;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  transition: top 0.16s ease;
}

.student-portal-skip-link:focus,
.student-portal-skip-link:focus-visible {
  top: 10px;
}

/* Shared navy learner header */
body.psc-student-portal .student-portal-navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  min-height: 68px;
  padding: 0.58rem clamp(0.75rem, 2vw, 1.35rem);
  color: white !important;
  background: var(--student-navy) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.17) !important;
}

.student-portal-navbar-inner {
  width: min(1400px, 100%);
  margin-inline: auto;
  padding-inline: 0 !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.student-portal-brand {
  min-width: 0;
  display: inline-flex !important;
  align-items: center;
  gap: 11px;
  color: white !important;
  text-decoration: none;
}

.student-portal-emblem {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: white;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 14px;
}

.student-portal-emblem img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.student-portal-brand-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1.15;
}

body.psc-student-portal .student-portal-brand-copy strong {
  color: white !important;
  -webkit-text-fill-color: white !important;
  font-family: Inter, system-ui, sans-serif !important;
  font-size: 1rem;
  font-weight: 800 !important;
  white-space: nowrap;
}

body.psc-student-portal .student-portal-brand-copy small {
  color: rgba(255, 255, 255, 0.74) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.74) !important;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.student-portal-user {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.student-portal-user-photo {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: cover;
  background: white;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px !important;
}

body.psc-student-portal .student-portal-navbar .navbar-text {
  max-width: min(32vw, 390px);
  color: white !important;
  -webkit-text-fill-color: white !important;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.psc-student-portal .student-portal-logout {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-inline: 0.78rem;
  color: white !important;
  -webkit-text-fill-color: white !important;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.48) !important;
  border-radius: 999px !important;
  font-size: 0.76rem;
  font-weight: 800;
}

body.psc-student-portal .student-portal-logout:hover,
body.psc-student-portal .student-portal-logout:focus {
  color: var(--student-navy) !important;
  -webkit-text-fill-color: var(--student-navy) !important;
  background: white !important;
  border-color: white !important;
}

/* Shared learner actions */
body.psc-student-portal .btn-primary,
body.psc-student-portal .student-primary-action {
  color: var(--student-navy) !important;
  -webkit-text-fill-color: var(--student-navy) !important;
  background: var(--student-gold) !important;
  border-color: var(--student-gold) !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}

body.psc-student-portal .btn-primary:hover,
body.psc-student-portal .btn-primary:focus,
body.psc-student-portal .student-primary-action:hover,
body.psc-student-portal .student-primary-action:focus {
  color: var(--student-navy) !important;
  -webkit-text-fill-color: var(--student-navy) !important;
  background: var(--student-gold-hover) !important;
  border-color: var(--student-gold-hover) !important;
}

body.psc-student-portal .btn-outline-primary {
  color: var(--student-blue) !important;
  background: white !important;
  border-color: rgba(23, 78, 166, 0.42) !important;
  border-radius: 999px !important;
  font-weight: 750;
  box-shadow: none !important;
}

body.psc-student-portal .btn-outline-primary:hover,
body.psc-student-portal .btn-outline-primary:focus {
  color: white !important;
  background: var(--student-blue) !important;
  border-color: var(--student-blue) !important;
}

body.psc-student-portal .btn-outline-secondary {
  color: var(--student-navy) !important;
  background: white !important;
  border-color: var(--student-border-strong) !important;
  border-radius: 999px !important;
  font-weight: 750;
  box-shadow: none !important;
}

body.psc-student-portal .btn-outline-secondary:hover,
body.psc-student-portal .btn-outline-secondary:focus {
  color: var(--student-navy) !important;
  background: var(--student-soft) !important;
  border-color: var(--student-gold) !important;
}

/* Shared fields, modals, toasts */
body.psc-student-portal .modal-content {
  overflow: hidden;
  background: white !important;
  border: 1px solid var(--student-border) !important;
  border-radius: 20px !important;
  box-shadow: none !important;
}

body.psc-student-portal .modal-header,
body.psc-student-portal .modal-footer {
  border-color: var(--student-border) !important;
}

body.psc-student-portal .form-control,
body.psc-student-portal .form-select {
  min-height: 44px;
  color: var(--student-navy);
  background: white;
  border: 1px solid var(--student-border) !important;
  border-radius: 12px !important;
}

body.psc-student-portal .form-control:focus,
body.psc-student-portal .form-select:focus {
  border-color: var(--student-blue) !important;
  box-shadow: 0 0 0 0.18rem rgba(23, 78, 166, 0.14) !important;
}

body.psc-student-portal .toast {
  border-radius: 14px !important;
  box-shadow: none !important;
}

/* Accessible focus */
body.psc-student-portal a:focus-visible,
body.psc-student-portal button:focus-visible,
body.psc-student-portal input:focus-visible,
body.psc-student-portal select:focus-visible,
body.psc-student-portal textarea:focus-visible,
body.psc-student-portal [tabindex]:focus-visible {
  outline: 3px solid rgba(23, 78, 166, 0.25) !important;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  body.psc-student-portal .student-portal-navbar {
    min-height: 62px;
  }

  .student-portal-emblem {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  body.psc-student-portal .student-portal-brand-copy strong {
    font-size: 0.9rem;
  }

  body.psc-student-portal .student-portal-brand-copy small {
    font-size: 0.63rem;
  }

  body.psc-student-portal .student-portal-navbar .navbar-text {
    display: none !important;
  }

  .student-portal-logout {
    width: 38px;
    padding: 0 !important;
    justify-content: center;
  }

  .student-portal-logout span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .student-portal-skip-link,
  body.psc-student-portal *,
  body.psc-student-portal *::before,
  body.psc-student-portal *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
