* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    linear-gradient(135deg, rgba(11, 31, 58, 0.98), rgba(18, 42, 77, 0.92)),
    var(--navy);
  color: var(--text);
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
}

.portal {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 20px 16px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.78);
}

.footer.fixed-screen-footer {
  border-top: 1px solid rgba(214, 162, 30, 0.42);
  background: rgba(11, 31, 58, 0.94);
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
  box-shadow: 0 -10px 28px rgba(4, 13, 27, 0.16);
}

.portal-card {
  width: min(920px, 100%);
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid rgba(214, 162, 30, 0.32);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  padding: 56px;
  position: relative;
  overflow: hidden;
}

.portal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--gold);
}

.portal-link {
  display: inline-flex;
  margin-bottom: 24px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.portal-link:hover {
  color: var(--gold-2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 40px;
}

.brand-mark {
  width: 76px;
  height: 76px;
  border-radius: 16px;
  background: var(--white);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

h1 {
  margin: 0;
  color: var(--navy);
  font-size: 2rem;
  line-height: 1.25;
}

p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.entry {
  min-height: 190px;
  border: 1px solid rgba(214, 162, 30, 0.32);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  background: var(--white);
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.entry:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 12px 30px rgba(11, 31, 58, 0.18);
}

.entry-kicker {
  color: var(--gold-2);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.entry strong {
  color: var(--navy);
  font-size: 1.45rem;
}

.entry span:last-child {
  color: var(--muted);
  font-size: 1rem;
}

.entry-student {
  background: linear-gradient(180deg, #fffdf7, var(--white));
  border-left: 5px solid var(--gold);
}

.entry-staff {
  background: linear-gradient(180deg, #f8fbff, var(--white));
  border-left: 5px solid #2563eb;
}

.entry-class-teacher {
  background: linear-gradient(180deg, #f7fff9, var(--white));
  border-left: 5px solid #6d5bd0;
}

.entry-student .entry-kicker { color: var(--gold-2); }
.entry-staff .entry-kicker { color: #2563eb; }
.entry-class-teacher .entry-kicker { color: #6d5bd0; }

@media (max-width: 700px) {
  body {
    background:
      linear-gradient(180deg, var(--navy) 0 210px, var(--bg) 210px 100%);
    color: var(--text);
  }

  .portal {
    align-items: stretch;
    justify-content: flex-start;
    padding: calc(18px + env(safe-area-inset-top)) 14px calc(22px + env(safe-area-inset-bottom));
  }

  .portal-card {
    min-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 22px 16px;
    border-radius: 22px 22px 18px 18px;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 42px rgba(4, 13, 27, 0.22);
  }

  .portal-card::before {
    height: 4px;
  }

  .brand {
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 28px;
  }

  .brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    font-size: 1.55rem;
    flex: 0 0 auto;
  }

  h1 {
    font-size: 1.3rem;
  }

  p {
    font-size: 0.9rem;
  }

  .entry-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .entry {
    min-height: 112px;
    padding: 18px;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(11, 31, 58, 0.08);
  }

  .entry strong {
    font-size: 1.2rem;
  }

  .footer {
    display: flex;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
    font-size: 0.74rem;
    line-height: 1.45;
  }
}
