:root {
  --auth-canvas: #eef5f9;
  --auth-surface: #ffffff;
  --auth-surface-soft: #f7fbfd;
  --auth-ink: #142334;
  --auth-muted: #617487;
  --auth-line: #d6e3eb;
  --auth-blue: #1675ba;
  --auth-blue-dark: #0f486f;
  --auth-cyan: #1da3b5;
  --auth-green: #218b70;
  --auth-green-soft: #e5f6ee;
  --auth-amber: #8b5b0b;
  --auth-amber-soft: #fff5d8;
  --auth-danger: #9b2441;
  --auth-danger-soft: #fff0f3;
  --auth-shadow: 0 18px 42px rgba(20, 64, 91, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--auth-canvas);
  color: var(--auth-ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--auth-canvas);
}

button,
input {
  font: inherit;
}

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

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-shell {
  display: grid;
  width: min(1240px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 30px 0;
}

.auth-layout {
  display: grid;
  min-height: 620px;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.78fr);
  gap: clamp(24px, 4vw, 62px);
  align-items: stretch;
}

.auth-brand {
  display: grid;
  min-width: 0;
  align-content: space-between;
  gap: 36px;
  padding: 26px clamp(10px, 4vw, 54px) 32px 18px;
}

.auth-brand__topline {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.auth-brand__logo {
  display: inline-flex;
  min-width: 130px;
  min-height: 60px;
  align-items: center;
  padding: 8px 13px;
  border-radius: 8px;
  background: #123d5a;
}

.auth-brand__logo img {
  display: block;
  width: 130px;
  height: 60px;
  max-width: 100%;
  object-fit: contain;
}

.auth-brand__tag,
.session-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.auth-brand__tag {
  padding: 7px 9px;
  border: 1px solid #c9dee9;
  color: #275b78;
  background: #f8fcfe;
  white-space: nowrap;
}

.auth-brand__copy {
  display: grid;
  max-width: 650px;
  gap: 16px;
}

.auth-brand h1 {
  max-width: 600px;
  margin: 0;
  color: #10263a;
  font-size: clamp(42px, 5vw, 68px);
  font-weight: 780;
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.auth-brand__copy p {
  max-width: 540px;
  margin: 0;
  color: var(--auth-muted);
  font-size: 18px;
  line-height: 1.55;
}

.auth-products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.auth-product {
  display: grid;
  min-height: 92px;
  min-width: 0;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 10px 8px;
  border: 1px solid #d4e4ed;
  border-radius: 8px;
  color: #385a71;
  background: rgba(255, 255, 255, 0.56);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
}

.auth-product img {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.auth-panel {
  display: grid;
  min-width: 0;
  align-content: center;
}

.auth-card {
  display: grid;
  gap: 24px;
  width: 100%;
  padding: clamp(24px, 4vw, 42px);
  border-radius: 8px;
  background: var(--auth-surface);
  box-shadow: var(--auth-shadow);
}

.auth-card__heading {
  display: grid;
  gap: 16px;
}

.auth-card h1,
.auth-card h2 {
  margin: 0;
  color: #162b3f;
  font-size: 30px;
  font-weight: 780;
  line-height: 1.12;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

.auth-card p {
  max-width: 50ch;
  margin: 8px 0 0;
  color: var(--auth-muted);
  font-size: 15px;
  line-height: 1.5;
}

.session-badge {
  min-height: 31px;
  padding: 6px 9px;
  border: 1px solid #c9e8dc;
  color: #1e705c;
  background: #effaf5;
}

.session-badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fa67f;
}

.session-badge--inactive {
  border-color: #d4e0e7;
  color: #405468;
  background: #eef3f6;
}

.session-badge--warning {
  border-color: #ecd390;
  color: var(--auth-amber);
  background: var(--auth-amber-soft);
}

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

.field {
  display: grid;
  gap: 8px;
  color: #39546a;
  font-size: 14px;
  font-weight: 750;
}

.field__control {
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid #cbdde7;
  border-radius: 8px;
  background: #fff;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.field__control:focus-within {
  border-color: #4b9ac8;
  box-shadow: 0 0 0 3px rgba(29, 163, 181, 0.17);
}

.field__control svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #477e9d;
}

.field__control input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--auth-ink);
  background: transparent;
  font-size: 16px;
}

.field__control input::placeholder {
  color: #728797;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.form-actions a {
  min-height: 32px;
  padding: 6px 0;
  color: var(--auth-blue-dark);
  font-size: 14px;
  font-weight: 800;
}

.form-actions a:hover,
.form-actions a:focus-visible {
  color: var(--auth-blue);
  text-decoration: underline;
  outline: none;
}

.form-error {
  display: none;
  margin: -2px 0 0;
  padding: 11px 12px;
  border: 1px solid #efbac7;
  border-radius: 8px;
  color: var(--auth-danger);
  background: var(--auth-danger-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.form-error.is-visible {
  display: block;
}

.button,
.continue-link {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.button {
  width: 100%;
  border: 1px solid transparent;
}

.button svg,
.continue-link svg {
  width: 18px;
  height: 18px;
}

.button--primary {
  border-color: var(--auth-blue);
  color: #fff;
  background: var(--auth-blue);
}

.button--primary:hover,
.button--primary:focus-visible {
  border-color: var(--auth-blue-dark);
  background: var(--auth-blue-dark);
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 72, 111, 0.2);
}

.button:disabled,
.button.is-loading {
  cursor: wait;
  opacity: 0.8;
  transform: none;
  box-shadow: none;
}

.button__loader {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 800ms linear infinite;
}

.button.is-loading .button__loader {
  display: block;
}

.button.is-loading .button__icon {
  display: none;
}

.continue-link {
  width: 100%;
  border: 1px solid #bbd8e7;
  color: #245b7d;
  background: #f6fbfe;
}

.continue-link:hover,
.continue-link:focus-visible {
  border-color: #6fa8c9;
  color: var(--auth-blue-dark);
  background: #eaf6fb;
  outline: none;
}

.auth-card--logout,
.auth-card--portal,
.auth-card--continuation {
  gap: 22px;
}

.auth-progress {
  width: 48px;
  height: 48px;
  border: 4px solid #d5e7f1;
  border-top-color: var(--auth-blue);
  border-radius: 50%;
  animation: auth-spin 900ms linear infinite;
}

.auth-continuation__form {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.auth-noscript {
  display: block;
  padding: 11px 12px;
  border: 1px solid #efbac7;
  border-radius: 8px;
  color: var(--auth-danger);
  background: var(--auth-danger-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 980px) {
  .auth-layout {
    grid-template-columns: minmax(0, 1fr) minmax(350px, 0.88fr);
    gap: 24px;
  }

  .auth-brand {
    padding-right: 18px;
  }

  .auth-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 360px;
  }
}

@media (max-width: 760px) {
  .auth-shell {
    width: min(100% - 24px, 560px);
    padding: 12px 0 20px;
  }

  .auth-layout {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .auth-brand {
    gap: 0;
    padding: 4px;
  }

  .auth-brand__topline {
    align-items: center;
  }

  .auth-brand__logo {
    min-width: 104px;
    min-height: 48px;
    padding: 6px 10px;
  }

  .auth-brand__logo img {
    width: 104px;
    height: 48px;
  }

  .auth-brand__tag {
    max-width: 152px;
    white-space: normal;
  }

  .auth-brand__copy,
  .auth-products {
    display: none;
  }

  .auth-card {
    gap: 22px;
    padding: 24px 18px;
  }

  .auth-card h1,
  .auth-card h2 {
    font-size: 26px;
  }

  .button,
  .continue-link {
    min-height: 52px;
  }
}

@media (max-width: 380px) {
  .auth-brand__topline {
    display: grid;
    justify-items: start;
  }

  .auth-brand__tag {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
