:root {
  --bg: #eef4f7;
  --surface: #ffffff;
  --border: #d7e2ea;
  --text: #14313f;
  --muted: #58707f;
  --primary: #0f766e;
  --primary-strong: #115e59;
  --accent-warm: #ff5f2e;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;
  --shadow: 0 18px 45px rgba(20, 49, 63, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 32%),
    linear-gradient(180deg, #f4f8fb 0%, #ebf2f6 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(1600px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

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

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar h1,
.hero h2,
.section-head h3,
.portal-card h4,
.login-panel h1,
.login-card h2,
.empty-state h4 {
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo,
.login-logo {
  display: block;
  object-fit: contain;
}

.brand-logo {
  width: 64px;
  height: 64px;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--muted);
}

.lede {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 28px;
  margin-bottom: 28px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}

.portal-card {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.portal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 50px rgba(20, 49, 63, 0.14);
  border-color: rgba(15, 118, 110, 0.25);
}

.portal-badge {
  width: 54px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: color-mix(in srgb, var(--portal-accent), white 84%);
  color: var(--portal-accent);
  font-weight: 700;
}

.portal-card p,
.empty-state p,
.feature-list {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.portal-link,
.primary-link,
.ghost-link,
.ghost-button,
.primary-button {
  font-weight: 600;
}

.portal-link {
  color: var(--primary-strong);
}

.section-head {
  margin-bottom: 16px;
}

.empty-state {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.empty-state-minimal {
  min-height: clamp(220px, 42vh, 420px);
  align-items: center;
  justify-content: center;
  text-align: center;
}

.primary-link,
.primary-button,
.ghost-button {
  border-radius: 999px;
  padding: 12px 18px;
  border: 0;
  cursor: pointer;
}

.primary-link,
.primary-button {
  background: var(--primary);
  color: white;
}

.primary-link:hover,
.primary-button:hover {
  background: var(--primary-strong);
}

.ghost-link,
.ghost-button {
  background: transparent;
  color: var(--text);
}

.ghost-button {
  border: 1px solid var(--border);
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}

.message {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background:
    radial-gradient(circle at top center, rgba(255, 95, 46, 0.08), transparent 22%),
    radial-gradient(circle at bottom left, rgba(15, 118, 110, 0.12), transparent 30%),
    linear-gradient(180deg, #f6fafc 0%, #edf4f8 100%);
}

.login-shell {
  width: min(620px, 100%);
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.login-logo-frame {
  position: relative;
  width: min(250px, 60vw);
  padding: 10px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.46));
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: 0 18px 42px rgba(20, 49, 63, 0.14);
  backdrop-filter: blur(10px);
}

.login-logo-frame::after {
  content: "";
  position: absolute;
  inset: auto 14% -12px;
  height: 22px;
  border-radius: 999px;
  background: rgba(20, 49, 63, 0.14);
  filter: blur(16px);
  z-index: 0;
}

.login-logo {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 140px;
  border-radius: 22px;
  box-shadow: 0 14px 34px rgba(12, 30, 55, 0.22);
}

.login-title {
  text-align: center;
  max-width: none;
  font-size: clamp(2.2rem, 4.2vw, 3.3rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.login-card {
  padding: 28px;
  width: min(430px, 100%);
}

.login-card-compact {
  padding: 30px 28px 28px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(215, 226, 234, 0.9);
  box-shadow: 0 26px 60px rgba(20, 49, 63, 0.14);
  backdrop-filter: blur(10px);
}

.login-card-compact .primary-button {
  width: 100%;
  min-height: 54px;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.stack-md {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label,
.checkbox-row {
  font-size: 0.95rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-control {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 15px 16px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.98);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.form-control:focus {
  outline: 0;
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
  transform: translateY(-1px);
}

.form-control::placeholder {
  color: #6a8391;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.alert.error {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

@media (max-width: 800px) {
  .page-shell {
    width: calc(100% - 24px);
    padding: 18px 0 28px;
  }

  .topbar,
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar {
    gap: 14px;
    margin-bottom: 18px;
  }

  .brand-lockup {
    gap: 12px;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .ghost-button {
    padding: 11px 16px;
  }

  .portal-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .empty-state-minimal {
    min-height: 180px;
    padding: 22px;
  }
}

@media (max-width: 520px) {
  .topbar h1 {
    font-size: 2rem;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  .topbar-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .ghost-link,
  .ghost-button {
    width: 100%;
    text-align: center;
  }

  .login-shell {
    gap: 18px;
  }

  .login-card,
  .login-card-compact {
    padding: 22px 18px;
  }

  .login-logo-frame {
    width: min(210px, 62vw);
    padding: 8px;
    border-radius: 24px;
  }

  .login-logo {
    max-height: 118px;
    border-radius: 16px;
  }

  .login-title {
    font-size: clamp(1.65rem, 6.6vw, 2.45rem);
  }
}
