:root {
  color-scheme: light;
  --teal: #00b8a9;
  --teal-dark: #078f85;
  --teal-light: #e6f8f6;
  --orange: #ff6f59;
  --yellow: #ffc93c;
  --cream: #fffdf9;
  --ink: #2d3748;
  --muted: #64748b;
  --line: #e7edf0;
  --surface: #fff;
  font-family: "Nunito", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 24px 16px;
  background: #eef3f6;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.portal-shell {
  width: min(100%, 520px);
  min-height: calc(100vh - 48px);
  margin: 0 auto;
  padding: 24px;
  border: 1px solid #e4eaee;
  border-radius: 28px;
  background: var(--cream);
  box-shadow: 0 18px 48px rgb(45 55 72 / 10%);
}

.portal-shell--login {
  display: grid;
  place-items: center;
}

.login-card {
  width: min(100%, 390px);
  padding: 20px 0;
}

.login-branding {
  margin: 0 0 24px;
}

.login-banner {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.brand-mark {
  display: block;
  width: 76px;
  height: 76px;
  margin: 12px auto 0;
  border: 4px solid var(--cream);
  border-radius: 50%;
  background: white;
  box-shadow: 0 4px 12px rgb(45 55 72 / 16%);
  object-fit: contain;
}

.login-card h1,
.portal-header h1,
.welcome-card h2,
.student-card h2,
.empty-card h2 {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  letter-spacing: -0.025em;
}

.login-card h1 {
  font-size: 1.8rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.intro {
  margin: 9px 0 24px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: center;
}

.login-form {
  display: grid;
  gap: 9px;
}

.login-form label {
  margin-top: 8px;
  font-size: 0.88rem;
  font-weight: 800;
}

.login-form input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 1px solid #d5e0e4;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.login-form input:focus {
  border-color: var(--teal);
  outline: 3px solid rgb(0 184 169 / 16%);
}

.button {
  min-height: 42px;
  padding: 9px 15px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
}

.button:focus-visible,
.student-option:focus-visible {
  outline: 3px solid rgb(0 184 169 / 35%);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button--primary {
  min-height: 50px;
  margin-top: 12px;
  background: linear-gradient(110deg, var(--teal), #23c89c);
  color: white;
  box-shadow: 0 9px 20px rgb(0 184 169 / 20%);
}

.button--quiet {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.button--install {
  margin-top: 16px;
  border: 1px solid #a9e3dc;
  background: var(--teal-light);
  color: var(--teal-dark);
}

.login-card > .button--install {
  display: block;
  width: 100%;
}

.install-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.help-text,
.portal-footer {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  text-align: center;
}

.help-text {
  margin: 22px 0 0;
}

.alert {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid #ffd1c9;
  border-radius: 12px;
  background: #fff1ee;
  color: #9c3425;
  font-size: 0.9rem;
  line-height: 1.45;
}

.portal-header,
.header-brand,
.student-card__top {
  display: flex;
  align-items: center;
}

.portal-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.portal-header form {
  margin: 0;
}

.header-brand {
  gap: 11px;
}

.student-initial,
.student-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.header-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  object-fit: contain;
}

.portal-header .eyebrow {
  margin-bottom: 3px;
  text-align: left;
}

.portal-header h1 {
  font-size: 1.05rem;
}

.welcome-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px;
  border-radius: 21px;
  background: linear-gradient(115deg, #00a99b, #30c995);
  color: white;
  box-shadow: 0 12px 24px rgb(0 184 169 / 18%);
}

.welcome-card .eyebrow {
  color: #ddfffa;
  text-align: left;
}

.welcome-card h2 {
  overflow-wrap: anywhere;
  font-size: 1.35rem;
}

.welcome-card p:last-child {
  margin: 7px 0 0;
  color: #eafffb;
  font-size: 0.86rem;
  line-height: 1.45;
}

.welcome-icon {
  color: rgb(255 255 255 / 55%);
  font-size: 2.8rem;
}

.student-picker,
.student-card,
.empty-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 7px 20px rgb(45 55 72 / 5%);
}

.offline-card {
  margin-top: 0;
}

body[data-pwa-offline-page] .portal-shell {
  display: grid;
  place-items: center;
}

.offline-card h1 {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.25rem;
  letter-spacing: -0.025em;
}

.offline-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.pwa-offline-screen {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eef3f6;
}

.pwa-offline-card {
  width: min(100%, 440px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgb(45 55 72 / 10%);
  text-align: center;
}

.pwa-offline-card h1 {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.25rem;
}

.pwa-offline-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.student-picker h2 {
  margin: 0 0 12px;
  font-size: 0.92rem;
}

.student-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.student-option--selected {
  border-color: #9ae5dc;
  background: var(--teal-light);
  color: var(--teal-dark);
}

.student-initial {
  width: 28px;
  height: 28px;
  background: white;
  color: var(--teal-dark);
}

.student-option__photo {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

.student-card__top {
  gap: 13px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.student-avatar {
  width: 58px;
  height: 58px;
  background: #fff1e8;
  color: #bd583f;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.45rem;
}

.student-avatar--photo {
  display: block;
  background: var(--line);
  object-fit: cover;
}

.student-card .eyebrow {
  text-align: left;
}

.student-card h2 {
  font-size: 1.23rem;
}

.class-chip {
  display: inline-block;
  margin: 8px 0 0;
  padding: 4px 10px;
  border: 1px solid #c8efea;
  border-radius: 999px;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 0.76rem;
  font-weight: 800;
}

.student-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
  margin: 0;
  padding-top: 16px;
}

.student-details div {
  min-width: 0;
}

.student-details dt {
  color: var(--muted);
  font-size: 0.76rem;
}

.student-details dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 0.92rem;
  font-weight: 800;
}

.empty-card h2 {
  font-size: 1.1rem;
}

.empty-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.portal-footer {
  margin-top: 24px;
}

.portal-footer p {
  margin: 0;
}

.portal-footer .button--install {
  margin-top: 14px;
}

@media (max-width: 480px) {
  body {
    padding: 0;
    background: var(--cream);
  }

  .portal-shell {
    min-height: 100vh;
    padding: 22px 18px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
}
