:root {
  --portal-ink: #17231d;
  --portal-muted: #647168;
  --portal-green: #146b47;
  --portal-green-dark: #0e5035;
  --portal-gold: #c69a38;
  --portal-paper: #f3f5f0;
  --portal-line: rgba(23, 35, 29, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.portal-body {
  min-height: 100dvh;
  margin: 0;
  color: var(--portal-ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(198, 154, 56, 0.13), transparent 28rem),
    radial-gradient(circle at 92% 85%, rgba(20, 107, 71, 0.12), transparent 32rem),
    var(--portal-paper);
  font-family: "Source Sans 3", system-ui, sans-serif;
}

.skip-link {
  position: fixed;
  top: -5rem;
  left: 1rem;
  z-index: 10;
  padding: .75rem 1rem;
  color: #fff;
  background: var(--portal-green-dark);
  border-radius: .4rem;
}

.skip-link:focus { top: 1rem; }

.portal-shell {
  width: min(100% - 2rem, 1180px);
  min-height: 100dvh;
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--portal-line);
}

.portal-brand { display: flex; align-items: center; gap: .9rem; }
.portal-brand img { width: 46px; height: 56px; object-fit: contain; }
.portal-brand strong { display: block; font-size: 1rem; letter-spacing: -.01em; }
.portal-brand span { color: var(--portal-muted); font-size: .82rem; }
.period-badge { color: var(--portal-green-dark); font-size: .88rem; font-weight: 600; }

.portal-main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr);
  align-items: center;
  gap: clamp(3rem, 8vw, 7rem);
  padding: 5rem 0 6rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--portal-green);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.portal-copy h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(3rem, 7vw, 5.8rem);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: .94;
  text-wrap: balance;
}

.portal-copy > p:last-child {
  max-width: 55ch;
  margin: 1.8rem 0 0;
  color: var(--portal-muted);
  font-size: 1.1rem;
  line-height: 1.65;
}

.role-panel { position: relative; padding-top: 1rem; }
.role-panel::before {
  content: "";
  position: absolute;
  inset: -1rem -1rem auto auto;
  width: 5rem;
  height: 5rem;
  border-top: 2px solid var(--portal-gold);
  border-right: 2px solid var(--portal-gold);
  opacity: .65;
}

.role-title { margin: 0 0 1.25rem; font-size: 1.05rem; font-weight: 600; }
.role-list { display: grid; gap: .75rem; }

.role-link {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  color: inherit;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: .75rem;
  box-shadow: 0 10px 35px rgba(31, 61, 45, .07);
  text-decoration: none;
  transition: transform .22s ease, background-color .22s ease, box-shadow .22s ease;
}

.role-link:hover {
  color: var(--portal-green-dark);
  background: #fff;
  box-shadow: 0 16px 40px rgba(31, 61, 45, .12);
  transform: translateY(-2px);
}

.role-link:active { transform: translateY(0) scale(.99); }
.role-link:focus-visible { outline: 3px solid rgba(20, 107, 71, .3); outline-offset: 3px; }
.role-icon { display: grid; place-items: center; width: 3rem; height: 3rem; color: #fff; background: var(--portal-green); border-radius: .55rem; font-size: 1.2rem; }
.role-label strong, .role-label span { display: block; }
.role-label strong { font-size: 1rem; }
.role-label span { color: var(--portal-muted); font-size: .85rem; }
.role-arrow { color: var(--portal-green); font-size: 1.2rem; }

.portal-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0 1.5rem;
  color: var(--portal-muted);
  border-top: 1px solid var(--portal-line);
  font-size: .82rem;
}

.login-main { grid-template-columns: minmax(0, 1fr) minmax(350px, .72fr); }
.login-card {
  padding: clamp(1.5rem, 4vw, 2.4rem);
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 1rem;
  box-shadow: 0 22px 65px rgba(31, 61, 45, .12);
}
.login-card h2 { margin: 0 0 .35rem; font-size: 1.65rem; letter-spacing: -.025em; }
.login-card > p { margin: 0 0 1.7rem; color: var(--portal-muted); }
.form-label { color: var(--portal-ink); font-size: .88rem; font-weight: 600; }
.form-control { min-height: 3rem; border-color: var(--portal-line); }
.form-control:focus { border-color: var(--portal-green); box-shadow: 0 0 0 .25rem rgba(20, 107, 71, .12); }
.btn-portal { min-height: 3rem; color: #fff; background: var(--portal-green); border: 0; font-weight: 600; }
.btn-portal:hover, .btn-portal:focus { color: #fff; background: var(--portal-green-dark); }
.back-link { color: var(--portal-green-dark); font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

@media (max-width: 800px) {
  .portal-main, .login-main { grid-template-columns: 1fr; gap: 3rem; padding: 3.5rem 0 4rem; }
  .portal-copy h1 { max-width: 11ch; }
}

@media (max-width: 520px) {
  .portal-shell { width: min(100% - 1.25rem, 1180px); }
  .portal-header { align-items: flex-start; }
  .period-badge { display: none; }
  .portal-main { padding-top: 2.75rem; }
  .portal-footer { display: block; }
  .portal-footer span { display: block; margin-top: .3rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
