:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #f1f7fa;
  background: #0b1724;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  min-width: 0;
  min-height: 100svh;
  margin: 0;
  display: grid;
  align-items: center;
  background: radial-gradient(ellipse at 74% 4%, #17414c 0%, transparent 58%), #0b1724;
}

.shell {
  width: min(100% - 2.5rem, 62rem);
  margin-inline: auto;
  padding-block: clamp(2.5rem, 8vw, 5rem);
}


.school { display: flex; align-items: center; gap: 1.1rem; margin-bottom: clamp(1.4rem, 4vw, 2.2rem); }
.logo { flex: 0 0 4rem; width: 4rem; height: 4rem; display: grid; place-items: center; border-radius: 1.1rem; background: #174047; border: 1px solid #2f6d6f; overflow: hidden; }
.logo img { width: 2.4rem; height: 2.4rem; display: block; }
.logo.photo { border-radius: 50%; background: #fff; border-color: #fff3; box-shadow: 0 0 0 4px #86e6d633; }
.logo.photo img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { margin: 0 0 .2rem; color: #85e4d5; font-size: .8rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.6rem, 4.6vw, 2.5rem); line-height: 1.15; letter-spacing: -.03em; }

.layout { display: grid; grid-template-columns: minmax(0, 21rem) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.panel { border: 1px solid #375064; border-radius: 1.1rem; background: #122232; padding: 1.4rem; }
.auth { display: grid; gap: .9rem; }
.auth[hidden], [hidden] { display: none !important; }
.auth h2 { margin: 0; font-size: 1.25rem; }
.hint { margin: 0; color: #bed0de; font-size: .88rem; line-height: 1.55; }
label { display: grid; gap: .35rem; font-size: .82rem; font-weight: 600; color: #d3e1ea; }
input { width: 100%; height: 2.7rem; padding: 0 .8rem; border: 1px solid #3d566b; border-radius: .7rem; background: #0b1724; color: inherit; font: inherit; font-weight: 400; }
input:focus-visible { outline: 3px solid #a1efe5; outline-offset: 1px; border-color: #86e6d6; }
.pw { position: relative; display: block; }
.pw input { padding-right: 4rem; }
.pw button { position: absolute; right: .35rem; top: .35rem; height: 2rem; padding: 0 .65rem; border: 0; border-radius: .5rem; background: transparent; color: #a7dfda; font: inherit; font-size: .8rem; cursor: pointer; }
.pw button:hover { background: #1c3347; }
.error { margin: 0; padding: .6rem .75rem; border: 1px solid #7d3a49; border-radius: .6rem; background: #3a1c27; color: #ffc9d3; font-size: .85rem; line-height: 1.5; }
.primary, .ghost { height: 2.8rem; border-radius: .75rem; font: inherit; font-weight: 650; cursor: pointer; }
.primary { border: 0; background: #2bb5a0; color: #04201c; }
.primary:hover { background: #4cd0bb; }
.ghost { border: 1px solid #4a6479; background: transparent; color: #e4eef4; }
.ghost:hover { background: #1c3347; }
button:disabled { opacity: .6; cursor: progress; }
button:focus-visible { outline: 3px solid #a1efe5; outline-offset: 3px; }

.apps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app {
  display: flex;
  align-items: center;
  gap: .9rem;
  min-height: 7rem;
  height: 100%;
  padding: 1.1rem 1.2rem;
  border: 1px solid #375064;
  border-radius: 1rem;
  background: #16293a;
  color: inherit;
  text-decoration: none;
}

.app:hover { border-color: var(--accent); background: #1c3347; }
.app:active { background: #253e51; }

.app-icon {
  flex: 0 0 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: .7rem;
  color: var(--accent);
  background: var(--icon-bg);
}

.app-school { --accent: #86e6d6; --icon-bg: #174047; }
.app-doan { --accent: #a8d2ff; --icon-bg: #213c58; }
.app-library { --accent: #f6ce8f; --icon-bg: #453a30; }
.app-dashboard { --accent: #d8c6ff; --icon-bg: #38334e; }

.app-icon { position: relative; flex-basis: 3.4rem; height: 3.4rem; border-radius: 50%; overflow: visible; }
.app-logo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; display: none; }
.app-icon.photo .app-logo { display: block; }
.app-icon.photo { border: 0; background: none; }
.app-icon.photo svg { position: absolute; right: -.35rem; bottom: -.35rem; box-sizing: content-box; width: .95rem; height: .95rem; padding: .25rem; border-radius: 50%; background: var(--icon-bg); border: 2px solid #16293a; color: var(--accent); }
.app-icon:not(.photo) svg {
  width: 1.45rem;
  height: 1.45rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-copy { display: grid; gap: .2rem; }
.app-copy strong { font-size: 1.13rem; line-height: 1.3; }
.app-copy > span { color: #bed0de; font-size: .95rem; line-height: 1.5; }

.footer { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; color: #9fb4c3; font-size: .88rem; border-top: 1px solid #314759; margin-top: 1.6rem; padding-top: 1rem; }
.footer a { color: #a7dfda; text-underline-offset: .2em; }
.footer a:hover { color: #e4fffc; }
a:focus-visible { outline: 3px solid #a1efe5; outline-offset: 4px; }

@media (max-width: 60rem) { .layout { grid-template-columns: minmax(0, 1fr); } .shell { width: min(100% - 2rem, 40rem); } }
@media (max-width: 40rem) {
  .apps { grid-template-columns: minmax(0, 1fr); }
  .app { min-height: 5.25rem; padding: .8rem .9rem; }
}

.me { display: flex; align-items: center; gap: .85rem; padding: .85rem; border: 1px solid #2f4a5f; border-radius: .85rem; background: #0b1724; }
.avatar { flex: 0 0 2.8rem; height: 2.8rem; display: grid; place-items: center; border-radius: 50%; background: #2bb5a0; color: #04201c; font-weight: 750; font-size: 1.15rem; }
.me-copy { display: grid; min-width: 0; gap: .15rem; }
.me-copy strong { overflow-wrap: anywhere; font-size: .98rem; }
.me-copy span { color: #9fd9d0; font-size: .82rem; }
.me-copy small { color: #9fb4c3; font-size: .8rem; overflow-wrap: anywhere; }
.layout { align-items: stretch; }
nav[aria-label] { display: flex; }
.apps { flex: 1; grid-auto-rows: 1fr; align-content: stretch; }
.panel { display: flex; flex-direction: column; justify-content: center; }
