/* Sprint 10.5B — authenticated student application shell */
.amp-side-nav,
.amp-mobile-nav {
  display: none;
}

.haiedu-public-brand {
  display: inline-flex;
  align-items: center;
  width: min(210px, 48vw);
  margin: 0 0 var(--amp-space-3);
  text-decoration: none;
}
.haiedu-public-brand img {
  display: block;
  width: 100%;
  height: auto;
}
body.amp-student-shell-active .haiedu-public-brand {
  display: none;
}

.pre-auth-layout {
  margin: var(--amp-space-5) 0 0;
  display: grid;
  grid-template-columns: minmax(340px, .9fr) minmax(0, 1.25fr);
  gap: var(--amp-space-5);
  align-items: stretch;
}
.pre-auth-layout > .auth-card,
.pre-auth-layout > .role-access-panel {
  margin: 0;
  min-width: 0;
  height: 100%;
}
.pre-auth-layout > .auth-card {
  align-self: stretch;
}

.role-access-panel {
  padding: var(--amp-space-5);
  border-color: #c9d9eb;
  background: linear-gradient(135deg, #ffffff 0%, #f7faff 100%);
}
.role-access-heading h2 {
  margin: .25rem 0 .35rem;
}
.role-access-grid {
  margin-top: var(--amp-space-4);
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: var(--amp-space-3);
}
.role-access-card {
  min-width: 0;
  min-height: 96px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) auto;
  gap: var(--amp-space-3);
  align-items: center;
  padding: var(--amp-space-4);
  border: 1px solid var(--amp-color-border);
  border-radius: var(--amp-radius-md);
  background: #fff;
  color: var(--amp-color-text);
  text-decoration: none;
  box-shadow: var(--amp-shadow-low);
}
.role-access-card:hover {
  border-color: #9bbbd9;
  box-shadow: var(--amp-shadow-medium);
  transform: translateY(-1px);
}
.role-access-card:focus-visible {
  outline: 3px solid var(--amp-color-focus);
  outline-offset: 3px;
}
.role-access-card .role-access-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--amp-color-primary-soft);
  color: var(--amp-color-primary);
  font-weight: 900;
  font-size: 1.15rem;
}
.role-access-card strong,
.role-access-card small {
  display: block;
}
.role-access-card small {
  margin-top: 4px;
  color: var(--amp-color-text-muted);
  line-height: 1.35;
}
.role-access-card b {
  color: var(--amp-color-primary);
  font-size: 1.2rem;
}
.role-access-note {
  margin: var(--amp-space-4) 0 0;
  padding-top: var(--amp-space-3);
  border-top: 1px solid var(--amp-color-border);
  color: var(--amp-color-text-muted);
  font-size: var(--amp-font-size-sm);
  line-height: 1.45;
}

body.amp-student-shell-active {
  background: var(--amp-color-bg);
}

body.amp-student-shell-active .amp-side-nav {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--amp-nav-width);
  display: flex;
  flex-direction: column;
  gap: var(--amp-space-4);
  padding: var(--amp-space-5) var(--amp-space-4);
  background: #10253f;
  color: #fff;
  border-right: 1px solid rgba(255,255,255,.08);
}

.amp-nav-brand {
  display: grid;
  gap: 0.45rem;
  padding: 0 var(--amp-space-2) var(--amp-space-4);
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.amp-brand-link {
  display: block;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.amp-brand-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.amp-brand-link img {
  display: block;
  width: 100%;
  height: auto;
}
.amp-nav-brand span {
  color: #b8c6d8;
  font-size: var(--amp-font-size-xs);
  line-height: 1.35;
}

.amp-nav-list {
  display: grid;
  gap: 0.35rem;
}
.amp-nav-link {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--amp-radius-sm);
  color: #dfe8f3;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.25;
}
.amp-nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.09);
}
.amp-nav-link[aria-current="page"] {
  color: #fff;
  background: rgba(118, 172, 231, .2);
  box-shadow: inset 3px 0 0 #8fc0f3;
}
.amp-nav-disabled {
  cursor: default;
  opacity: 0.48;
  user-select: none;
}
.amp-nav-disabled:hover { background: transparent; color: #dfe8f3; }
.amp-nav-icon {
  width: 1.2rem;
  flex: 0 0 1.2rem;
  text-align: center;
  font-size: 0.95rem;
}

.amp-nav-utility {
  margin-top: auto;
  padding-top: var(--amp-space-3);
  border-top: 1px solid rgba(255,255,255,.12);
  display: grid;
  gap: .55rem;
}
.amp-nav-utility a {
  color: #c7d5e6;
  font-size: var(--amp-font-size-sm);
}

body.amp-student-shell-active > main.shell {
  width: auto;
  max-width: var(--amp-content-max);
  margin-left: calc(var(--amp-nav-width) + max(20px, calc((100vw - var(--amp-nav-width) - var(--amp-content-max)) / 2)));
  margin-right: auto;
  padding-top: var(--amp-space-5);
}

body.amp-student-shell-active .topbar {
  min-height: var(--amp-header-height);
  margin-bottom: var(--amp-space-4);
  padding-bottom: var(--amp-space-3);
  border-bottom: 1px solid var(--amp-color-border);
}

body.amp-student-shell-active .topbar h1 {
  margin-top: 0.1rem;
  margin-bottom: 0.15rem;
  font-size: var(--amp-font-size-2xl);
}
body.amp-student-shell-active .topbar .eyebrow {
  color: var(--amp-color-primary);
}

body.amp-student-shell-active .card {
  box-shadow: var(--amp-shadow-low);
}
body.amp-student-shell-active .recommendation-card {
  border-color: #b8cee5;
  box-shadow: var(--amp-shadow-medium);
}
body.amp-student-shell-active .question-card {
  box-shadow: var(--amp-shadow-medium);
}

/* Focused practice/assessment pages suppress browsing navigation. */
body.amp-student-shell-active.amp-focused-task .amp-side-nav,
body.amp-student-shell-active.amp-focused-task .amp-mobile-nav {
  display: none !important;
}
body.amp-student-shell-active.amp-focused-task > main.shell {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1080px) {
  .pre-auth-layout {
    grid-template-columns: 1fr;
  }
  body.amp-student-shell-active > main.shell {
    margin-left: calc(var(--amp-nav-width) + 14px);
    margin-right: 14px;
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 820px) {
  .role-access-grid { grid-template-columns: 1fr; }
  body.amp-student-shell-active .amp-side-nav { display: none; }

  body.amp-student-shell-active > main.shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: var(--amp-space-4) var(--amp-space-4) calc(var(--amp-mobile-nav-height) + var(--amp-space-5));
  }

  body.amp-student-shell-active .amp-mobile-nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 50;
    min-height: var(--amp-mobile-nav-height);
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    background: rgba(255,255,255,.97);
    border-top: 1px solid var(--amp-color-border);
    box-shadow: 0 -8px 24px rgba(22,34,51,.08);
    backdrop-filter: blur(12px);
  }

  .amp-mobile-link {
    min-width: 0;
    min-height: var(--amp-mobile-nav-height);
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.15rem;
    padding: 0.35rem 0.2rem;
    color: var(--amp-color-text-muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
  }
  .amp-mobile-link .amp-nav-icon { width: auto; flex: none; font-size: 1rem; }
  .amp-mobile-link[aria-current="page"] {
    color: var(--amp-color-primary);
    background: var(--amp-color-primary-soft);
  }
  .amp-mobile-link.amp-nav-disabled {
    opacity: 0.42;
    background: transparent;
    color: var(--amp-color-text-muted);
  }

  body.amp-student-shell-active.amp-focused-task > main.shell {
    padding-bottom: var(--amp-space-5);
  }
}

@media (max-width: 520px) {
  .haiedu-public-brand { width: min(180px, 58vw); }
  .pre-auth-layout { gap: var(--amp-space-3); }
  .role-access-panel { padding: var(--amp-space-4); }
  .role-access-card { grid-template-columns: 38px minmax(0,1fr) auto; padding: var(--amp-space-3); }
  .role-access-card .role-access-icon { width: 38px; height: 38px; }
  body.amp-student-shell-active > main.shell {
    padding-left: var(--amp-space-3);
    padding-right: var(--amp-space-3);
  }
  .amp-mobile-link { font-size: 0.64rem; }
}

@media (prefers-reduced-motion: reduce) {
  .role-access-card:hover { transform: none; }
}
