@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=Playfair+Display:wght@400;500&display=swap");

:root {
  color-scheme: light;
  --background: hsl(40 10% 96%);
  --foreground: hsl(0 0% 12%);
  --card: hsl(0 0% 100%);
  --secondary: hsl(40 20% 96%);
  --muted: hsl(0 0% 42%);
  --border: hsl(0 0% 82%);
  --brand-gold: hsl(40 50% 53%);
  --brand-orange: hsl(27 85% 61%);
  --success: hsl(130 70% 82%);
  --warning: hsl(42 100% 71%);
  --incident: hsl(9 100% 83%);
  --radius: 10px;
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
  font-size: 16px;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  grid-template-rows: 100px 1fr auto;
  color: var(--foreground);
  background: var(--background);
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
}

p {
  margin: 0;
}

.site-header {
  height: 100px;
  padding: 0 24px;
  background: var(--foreground);
}

.header-inner,
.footer-inner {
  width: min(1152px, 100%);
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand img {
  width: auto;
  height: 50px;
  display: block;
}

.header-label {
  color: rgb(255 255 255 / 60%);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

main {
  min-width: 0;
  display: grid;
}

.portal-shell {
  width: min(1152px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0;
}

.login-layout {
  min-height: calc(100vh - 100px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: center;
  gap: 24px;
}

.login-intro {
  display: grid;
  gap: 20px;
}

.section-kicker,
.panel-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.section-kicker {
  margin-bottom: 8px;
  color: var(--brand-gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-intro h1,
.page-heading h1,
.message-panel h1 {
  font-size: clamp(34px, 4vw, 42px);
  line-height: 1.15;
}

.page-description {
  max-width: 640px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.sie-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
}

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

.feature-card {
  min-height: 142px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.feature-number {
  margin-bottom: auto;
  color: var(--brand-gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.feature-card strong {
  margin-top: 22px;
  font-size: 14px;
  font-weight: 600;
}

.feature-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.login-panel {
  padding: 20px;
}

.panel-heading,
.section-heading,
.application-title-row,
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2,
.section-heading h2 {
  margin-top: 2px;
  font-size: 22px;
  line-height: 1.25;
}

.badge,
.count-badge {
  min-height: 24px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  color: var(--foreground);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.badge-success {
  background: var(--success);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--foreground);
}

.login-content {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 16px;
}

.login-content > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.button-primary {
  color: #fff;
  background: var(--foreground);
}

.button-primary:hover {
  background: hsl(0 0% 20%);
}

.button-outline {
  border-color: var(--border);
  color: var(--foreground);
  background: var(--card);
}

.button-outline:hover {
  border-color: var(--brand-orange);
  background: var(--secondary);
}

.button-muted {
  border-color: hsl(0 0% 90%);
  color: var(--muted);
  background: hsl(0 0% 96%);
  cursor: default;
}

.button-full {
  width: 100%;
}

.button:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 3px;
}

.microsoft-mark {
  width: 16px;
  height: 16px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
}

.microsoft-mark i {
  display: block;
  background: #fff;
}

.security-message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 7px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--secondary);
}

.security-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--success);
  font-size: 12px;
  font-weight: 700;
}

.security-message p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.security-message strong {
  color: var(--foreground);
  font-size: 12px;
}

.dashboard-shell {
  display: grid;
  align-content: start;
  gap: 28px;
}

.page-heading {
  align-items: center;
}

.account-chip {
  max-width: 340px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
}

.account-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--foreground);
  font-size: 14px;
  font-weight: 700;
}

.account-chip strong,
.account-chip small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip strong {
  font-size: 13px;
}

.account-chip small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.session-panel {
  padding: 20px;
}

.session-details {
  margin: 20px 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.session-details > div {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.session-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.session-details dd {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.applications-section {
  min-width: 0;
}

.section-heading {
  margin-bottom: 12px;
  align-items: center;
}

.count-badge {
  min-width: 28px;
  background: hsl(0 0% 93%);
}

.applications-grid {
  display: grid;
  gap: 12px;
}

.application-card {
  padding: 16px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.application-mark {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 24px;
}

.application-mark-ecompass {
  background: hsl(40 50% 89%);
}

.application-mark-sie {
  background: hsl(27 85% 89%);
}

.application-title-row {
  align-items: center;
}

.application-title-row h3,
.empty-state h3 {
  font-size: 19px;
}

.application-copy > p,
.empty-state p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.group-reference {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.group-reference span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.group-reference code {
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--secondary);
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.empty-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--warning);
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 20px;
}

.message-layout {
  min-height: calc(100vh - 100px);
  display: grid;
  place-items: center;
}

.message-panel {
  width: min(620px, 100%);
  padding: clamp(28px, 6vw, 48px);
}

.message-panel .section-kicker {
  margin-top: 20px;
}

.message-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
}

.message-icon-success {
  background: var(--success);
}

.message-icon-error {
  background: var(--incident);
}

.message-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

footer {
  min-height: 54px;
  padding: 0 24px;
  border-top: 1px solid hsl(0 0% 90%);
  color: var(--muted);
  background: var(--background);
  font-size: 11px;
}

.security-note {
  text-align: right;
}

@media (max-width: 900px) {
  .login-layout {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 48px;
    padding-bottom: 48px;
  }

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

  .session-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 20px;
  }

  .session-panel .panel-heading,
  .session-panel .session-details {
    grid-column: 1 / -1;
  }

  .session-panel .button {
    grid-column: 2;
  }
}

@media (max-width: 680px) {
  body {
    grid-template-rows: 84px 1fr auto;
  }

  .site-header {
    height: 84px;
    padding: 0 20px;
  }

  .brand img {
    height: 44px;
  }

  .header-label {
    display: none;
  }

  .portal-shell {
    width: min(100% - 32px, 1152px);
    padding: 24px 0;
  }

  .login-layout,
  .message-layout {
    min-height: auto;
  }

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

  .feature-card {
    min-height: 112px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .account-chip {
    max-width: none;
  }

  .application-card {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
  }

  .application-mark {
    width: 44px;
    height: 44px;
  }

  .application-card > .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .application-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .session-panel {
    display: block;
  }

  footer {
    padding: 16px 20px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .security-note {
    text-align: left;
  }
}

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