:root {
  --auth-bg: #eef3f7;
  --auth-surface: #ffffff;
  --auth-surface-muted: #f6f8fb;
  --auth-text: #101828;
  --auth-muted: #526173;
  --auth-border: #d8e0ea;
  --auth-primary: #1464d2;
  --auth-primary-hover: #0f55b6;
  --auth-teal: #0f766e;
  --auth-amber: #b45309;
  --auth-danger: #b42318;
  --auth-success-bg: #e8f7ef;
  --auth-success-border: #b7e4ca;
  --auth-shadow: 0 24px 64px rgba(16, 24, 40, .14);
  --auth-radius: 8px;
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body.auth-page {
  min-height: 100dvh;
  margin: 0;
  color: var(--auth-text);
  background:
    linear-gradient(135deg, rgba(20, 100, 210, .08) 0 22%, transparent 22% 100%),
    linear-gradient(160deg, #fbfcfe 0%, var(--auth-bg) 68%, #e9f7f3 100%);
}

a {
  color: #0f55b6;
  font-weight: 700;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.auth-card {
  width: min(100%, 1040px);
  min-height: min(690px, calc(100dvh - 4rem));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr);
  overflow: hidden;
  background: var(--auth-surface);
  border: 1px solid rgba(216, 224, 234, .92);
  border-radius: var(--auth-radius);
  box-shadow: var(--auth-shadow);
}

.auth-panel {
  position: relative;
}

.auth-panel-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  width: fit-content;
  margin-bottom: 2.75rem;
}

.auth-brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: .18rem;
  padding: .42rem;
  border-radius: var(--auth-radius);
  color: #fff;
  background: #101828;
}

.auth-brand-mark span {
  display: block;
  border-radius: 2px;
  background: currentColor;
}

.auth-brand-mark span:nth-child(1) {
  height: 45%;
  color: #7dd3fc;
}

.auth-brand-mark span:nth-child(2) {
  height: 75%;
  color: #34d399;
}

.auth-brand-mark span:nth-child(3) {
  height: 58%;
  color: #f59e0b;
}

.auth-brand-name {
  font-size: 1.15rem;
  font-weight: 850;
}

.auth-copy {
  max-width: 35rem;
}

.auth-eyebrow {
  margin: 0 0 .65rem;
  color: var(--auth-teal);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-copy h1 {
  margin: 0;
  font-size: 3.4rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.auth-copy p:not(.auth-eyebrow) {
  max-width: 31rem;
  margin: 1rem 0 0;
  color: var(--auth-muted);
  font-size: 1.08rem;
  line-height: 1.58;
}

.auth-flashes {
  margin-top: 1.5rem;
}

.auth-flashes .mt-4 {
  margin-top: 0 !important;
}

.auth-flashes .alert {
  margin: 0;
  padding: .85rem 1rem;
  border: 1px solid var(--auth-border);
  border-radius: var(--auth-radius);
  font-size: .95rem;
  line-height: 1.4;
}

.auth-flashes .alert + .alert {
  margin-top: .75rem;
}

.auth-flashes .alert-success {
  color: #04613f;
  background: var(--auth-success-bg);
  border-color: var(--auth-success-border);
}

.auth-flashes .alert-danger,
.auth-flashes .alert-warning {
  color: var(--auth-danger);
  background: #fff4f2;
  border-color: #ffd5ce;
}

.auth-flashes .btn-close {
  display: none;
}

.auth-actions {
  display: grid;
  gap: .85rem;
  margin-top: 1.6rem;
}

.auth-denied-panel {
  display: grid;
  gap: .35rem;
  margin-top: 1.5rem;
  padding: 1rem;
  border: 1px solid #fecaca;
  border-left: 4px solid var(--auth-danger);
  border-radius: var(--auth-radius);
  background: #fff7f7;
}

.auth-denied-panel span {
  color: var(--auth-danger);
  font-size: .76rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-denied-panel strong {
  color: var(--auth-text);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.auth-button {
  min-height: 3.15rem;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  border: 1px solid transparent;
  border-radius: var(--auth-radius);
  padding: .8rem 1.1rem;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
  touch-action: manipulation;
}

.auth-button:hover:not(:disabled),
.auth-button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
}

.auth-button:focus-visible {
  outline: 3px solid rgba(20, 100, 210, .24);
  outline-offset: 3px;
}

.auth-button:active:not(:disabled) {
  transform: translateY(0);
}

.auth-button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.auth-button-primary {
  background: var(--auth-primary);
  border-color: var(--auth-primary);
  box-shadow: 0 14px 26px rgba(20, 100, 210, .22);
}

.auth-button-primary:hover:not(:disabled),
.auth-button-primary:focus-visible:not(:disabled) {
  background: var(--auth-primary-hover);
  border-color: var(--auth-primary-hover);
}

.auth-button-icon {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-grid;
  place-items: center;
}

.auth-button-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.auth-note {
  display: grid;
  gap: .25rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #dbeafe;
  border-left: 4px solid var(--auth-primary);
  border-radius: var(--auth-radius);
  color: var(--auth-muted);
  background: #f8fbff;
  font-size: .92rem;
  line-height: 1.45;
}

.auth-note strong {
  color: var(--auth-text);
}

.auth-footer {
  margin-top: auto;
  padding-top: 2rem;
  color: var(--auth-muted);
  font-size: .9rem;
}

.auth-panel-art {
  min-height: 100%;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(16, 24, 40, .94), rgba(15, 85, 182, .9)),
    #101828;
}

.auth-panel-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.85), rgba(0,0,0,.32));
}

.auth-art-grid {
  position: absolute;
  top: 4rem;
  right: 3rem;
  left: 3rem;
  display: grid;
  gap: .85rem;
}

.auth-art-grid span {
  display: block;
  height: .72rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .24);
}

.auth-art-grid span:nth-child(1) {
  width: 78%;
}

.auth-art-grid span:nth-child(2) {
  width: 92%;
  background: rgba(125, 211, 252, .38);
}

.auth-art-grid span:nth-child(3) {
  width: 64%;
  background: rgba(52, 211, 153, .36);
}

.auth-art-grid span:nth-child(4) {
  width: 86%;
  background: rgba(245, 158, 11, .34);
}

.auth-metric-stack {
  position: absolute;
  top: 12.5rem;
  right: 3rem;
  left: 3rem;
  display: grid;
  gap: .75rem;
}

.auth-metric-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .95rem 1rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: var(--auth-radius);
  color: rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .16);
}

.auth-metric-row strong {
  color: #fff;
}

.auth-art-copy {
  position: absolute;
  right: 2rem;
  bottom: 2rem;
  left: 2rem;
  display: grid;
  gap: .6rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--auth-radius);
  color: #fff;
  background: rgba(16, 24, 40, .48);
  backdrop-filter: blur(10px);
}

.auth-art-copy span {
  color: #93c5fd;
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.auth-art-copy strong {
  font-size: 1.65rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.auth-loading-dot {
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: auth-spin .7s linear infinite;
}

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

@media (max-width: 860px) {
  .auth-shell {
    display: block;
    padding: 0;
  }

  .auth-card {
    min-height: 100dvh;
    width: 100%;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
  }

  .auth-panel-form {
    min-height: 100dvh;
    padding: 2rem;
  }

  .auth-panel-art {
    display: none;
  }

  .auth-brand {
    margin-bottom: 2rem;
  }

  .auth-copy h1 {
    font-size: 2.55rem;
  }
}

@media (max-width: 520px) {
  .auth-panel-form {
    padding: 1.4rem;
  }

  .auth-copy h1 {
    font-size: 2.15rem;
  }
}

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