:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e1ec;
  --bg: #eef3f8;
  --panel: #ffffff;
  --blue: #1f5eff;
  --green: #16856a;
  --gold: #a56a1a;
  --slate: #526174;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #f6f9fc 0%, #e6edf5 48%, #f8fafc 100%);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: 28px;
  align-items: center;
  padding: 38px 0;
}

.brand-panel,
.auth-panel,
.portal-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(31, 45, 68, 0.12);
}

.brand-panel {
  min-height: 520px;
  padding: 46px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.brand-mark {
  width: 190px;
  height: 48px;
  display: flex;
  align-items: center;
  margin-bottom: auto;
}

.brand-mark img {
  width: 100%;
  height: auto;
  max-height: 38px;
  object-fit: contain;
  object-position: left center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1.04;
  letter-spacing: 0;
}

.lead {
  max-width: 440px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.auth-panel,
.portal-panel {
  padding: 36px;
}

.panel-head h2,
.portal-top h2 {
  margin-bottom: 10px;
  font-size: 30px;
  letter-spacing: 0;
}

.panel-head p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

label {
  display: grid;
  gap: 8px;
  color: #334155;
  font-weight: 700;
}

input {
  width: 100%;
  height: 48px;
  border: 1px solid #cbd5e1;
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.12);
}

.primary-button,
.ghost-button {
  height: 46px;
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  margin-top: 4px;
  background: var(--blue);
  color: #fff;
}

.primary-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.ghost-button {
  padding: 0 18px;
  background: #eef3f8;
  color: #24324a;
}

.message {
  min-height: 22px;
  margin: 0;
  color: #c2410c;
  font-weight: 700;
}

.portal-panel {
  grid-column: 1 / -1;
}

.portal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-weight: 700;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.portal-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.portal-card[href]:hover {
  transform: translateY(-3px);
  border-color: #9bb6e8;
  box-shadow: 0 16px 34px rgba(31, 45, 68, 0.12);
}

.card-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
}

.blue .card-icon {
  background: var(--blue);
}

.green .card-icon {
  background: var(--green);
}

.gold .card-icon {
  background: var(--gold);
}

.slate .card-icon {
  background: var(--slate);
}

.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title-row h3 {
  margin-bottom: 12px;
  font-size: 22px;
  letter-spacing: 0;
}

.card-title-row span {
  white-space: nowrap;
  padding: 5px 8px;
  background: #eef3f8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.portal-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

[hidden] {
  display: none !important;
}

@media (max-width: 920px) {
  .shell {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .brand-panel {
    min-height: 360px;
  }

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

@media (max-width: 620px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 10px 0;
  }

  .brand-panel,
  .auth-panel,
  .portal-panel {
    padding: 24px;
  }

  .brand-mark {
    width: 170px;
    height: 42px;
  }

  .brand-mark img {
    max-height: 34px;
  }

  .portal-top,
  .user-box {
    align-items: flex-start;
    flex-direction: column;
  }

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