:root {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 95% 0%, rgb(55 112 255 / 12%), transparent 32rem),
    var(--tc-color-background, #f4f7fb);
  color: var(--tc-color-text, #152238);
  font-family: var(--tc-font-family-sans, Inter, system-ui, sans-serif);
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: #fff;
  box-shadow: 0 0.25rem 1rem rgb(9 20 42 / 18%);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.portal-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  min-height: 4.75rem;
  padding: 0.75rem clamp(1rem, 4vw, 4rem);
  border-bottom: 1px solid rgb(111 133 170 / 22%);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(1rem);
}

.brand {
  display: inline-flex;
  gap: 0.75rem;
  align-items: center;
  text-decoration: none;
}

.brand span {
  display: grid;
  line-height: 1.05;
}

.brand strong {
  color: #09142a;
  font-size: 1.05rem;
}

.brand small {
  margin-top: 0.2rem;
  color: #52627a;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-nav {
  display: flex;
  gap: 0.35rem;
  justify-content: center;
}

.tc-nav-link {
  padding: 0.65rem 0.8rem;
  border-radius: 0.6rem;
  color: #44536c;
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.tc-nav-link:hover,
.tc-nav-link:focus-visible,
.tc-nav-link.is-active {
  background: #eaf0ff;
  color: #1747b0;
}

.account-state {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: #6a4f08;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #d49500;
  box-shadow: 0 0 0 0.25rem rgb(212 149 0 / 16%);
}

.menu-button {
  display: none;
}

.portal-main {
  width: min(74rem, calc(100% - 2rem));
  min-height: calc(100vh - 10rem);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0;
}

.hero-panel,
.page-heading {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
}

.hero-panel h1,
.page-heading h1,
.error-panel h1 {
  max-width: 18ch;
  margin: 0;
  color: #09142a;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.page-heading h1,
.error-panel h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: #275dcc;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero-copy {
  max-width: 47rem;
  margin: 1.5rem 0 0;
  color: #52627a;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.7;
}

.state-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}

.state-card,
.empty-panel,
.error-panel {
  border: 1px solid rgb(111 133 170 / 24%);
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 0.75rem 2rem rgb(22 40 75 / 7%);
}

.state-card {
  display: grid;
  min-height: 10rem;
  padding: 1.25rem;
}

.state-card span {
  color: #697892;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
}

.state-card strong {
  margin-top: 0.8rem;
  color: #122b5d;
  font-size: 1.4rem;
}

.state-card p {
  align-self: end;
  margin: 0.8rem 0 0;
  color: #607089;
  font-size: 0.88rem;
  line-height: 1.5;
}

.empty-panel {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 2rem;
  padding: clamp(1.4rem, 4vw, 2.5rem);
}

.empty-icon {
  display: grid;
  flex: 0 0 3rem;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border-radius: 0.8rem;
  background: #eaf0ff;
  color: #275dcc;
  font-size: 1.5rem;
}

.empty-panel h2 {
  margin: 0;
  color: #122b5d;
  font-size: 1.15rem;
}

.empty-panel p {
  margin: 0.45rem 0 0;
  color: #607089;
  line-height: 1.6;
}

.error-panel {
  max-width: 45rem;
  margin: 2rem auto;
  padding: clamp(1.5rem, 6vw, 4rem);
  text-align: center;
}

.error-panel h1 {
  margin-inline: auto;
}

.error-panel > p:not(.error-code, .correlation) {
  color: #607089;
  font-size: 1.05rem;
  line-height: 1.7;
}

.error-code {
  margin: 0 0 0.75rem;
  color: #275dcc;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.error-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 2rem;
}

.tc-button {
  display: inline-flex;
  min-height: 2.75rem;
  padding: 0.7rem 1rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  background: #1747b0;
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.tc-button--secondary {
  background: #eaf0ff;
  color: #1747b0;
}

.correlation {
  margin-top: 2rem;
  color: #7b8799;
  font-size: 0.75rem;
}

.portal-footer {
  display: flex;
  gap: 1rem 2rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem clamp(1rem, 4vw, 4rem);
  border-top: 1px solid rgb(111 133 170 / 20%);
  color: #697892;
  font-size: 0.78rem;
}

.portal-footer a {
  color: #1747b0;
  font-weight: 700;
}

@media (max-width: 62rem) {
  .portal-header {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .menu-button {
    display: inline-flex;
    min-height: 2.5rem;
    padding: 0.5rem 0.8rem;
    align-items: center;
    border: 1px solid #c8d4e8;
    border-radius: 0.6rem;
    background: #fff;
    color: #17315e;
    font: inherit;
    font-weight: 700;
  }

  .portal-nav {
    display: none;
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
  }

  .portal-nav.is-open {
    display: flex;
  }

  .account-state {
    display: none;
  }

  .state-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 38rem) {
  .portal-main {
    width: min(100% - 1.25rem, 74rem);
    padding-top: 2rem;
  }

  .hero-panel,
  .page-heading,
  .portal-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .state-grid {
    grid-template-columns: 1fr;
  }

  .error-actions {
    flex-direction: column;
  }
}

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