@font-face {
  font-family: 'Geist';
  src: url('/auth-static/fonts/geist-sans-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/auth-static/fonts/geist-mono-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root,
html {
  color-scheme: dark;
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --r-card: 30px;
  --r-btn: 9999px;
  --r-input: 18px;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: #000000;
  color: #ffffff;
  font-family: var(--font-sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Wordmark locked to dark theme */
.haureola-icon-dark {
  display: block;
}
.haureola-icon-light {
  display: none;
}

.login-portal {
  position: relative;
  min-height: 100vh;
  width: 100%;
  background-color: #000000;
  color: #ffffff;
  font-family: var(--font-sans);
  overflow-x: hidden;

  --card-bg: rgba(0, 0, 0, 0.85);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-text: #ffffff;
  --card-sub: #888888;
  --label-text: #ededed;
  --input-bg: #000000;
  --input-border: #2e2e2e;
  --input-border-hover: #444444;
  --input-border-focus: #ffffff;
  --input-focus-ring: rgba(255, 255, 255, 0.12);
  --input-text: #ffffff;
  --input-placeholder: #666666;
  --eye-icon: #888888;
  --eye-icon-hover: #ffffff;
  --btn-bg: #ffffff;
  --btn-text: #000000;
  --btn-bg-hover: #e5e5e5;
  --btn-border: #ffffff;
  --spinner-track: rgba(0, 0, 0, 0.2);
  --spinner-head: #000000;
  --error-bg: #111111;
  --error-border: #2e2e2e;
  --error-text: #ededed;
  --success-bg: #0e0e0e;
  --success-border: #3a3a3a;
  --success-text: #ffffff;
  --link-text: #888888;
  --link-hover: #ffffff;
  --card-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.9);
  --eclipse-rim: rgba(255, 255, 255, 0.9);
  --eclipse-glow: radial-gradient(circle at center, #fff 0%, #fff 62%, rgba(255, 255, 255, 0.4) 82%, transparent 100%);
  --eclipse-glow-opacity: 0.09;
}

.login-portal #gateway-canvas,
.login-portal .gateway-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: auto;
  display: block;
  background-color: #000000;
}

.login-portal .login-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  pointer-events: none;
}

.login-portal .login-card {
  position: relative;
  pointer-events: auto;
  width: 440px;
  height: 440px;
  max-width: calc(100vw - 32px);
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  border: none;
  border-radius: 50%;
  box-shadow: var(--card-shadow);
  padding: 70px 76px 46px 76px;
  color: var(--card-text);
  transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.login-portal .login-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border-top: 4px solid var(--eclipse-rim);
  -webkit-mask-image: linear-gradient(to right, transparent 15%, rgba(0, 0, 0, 0.45) 38%, black 58%, black 66%, rgba(0, 0, 0, 0.45) 82%, transparent 95%);
  mask-image: linear-gradient(to right, transparent 15%, rgba(0, 0, 0, 0.45) 38%, black 58%, black 66%, rgba(0, 0, 0, 0.45) 82%, transparent 95%);
  pointer-events: none;
  z-index: 2;
}

.login-portal .login-card::after {
  content: '';
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: var(--eclipse-glow);
  filter: blur(22px);
  opacity: var(--eclipse-glow-opacity);
  pointer-events: none;
  z-index: -1;
}

.login-portal .auth-view-host {
  width: 100%;
  max-width: 284px;
}

.login-portal .auth-view {
  width: 100%;
}

.login-portal .auth-view.is-entering {
  animation: auth-view-enter 200ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes auth-view-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-portal .login-card form {
  width: 100%;
  max-width: 284px;
}

.login-portal .card-header {
  text-align: center;
  margin-bottom: 20px;
}

.login-portal .haureola-login-wordmark {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.login-portal .haureola-wordmark-img {
  height: 24px;
  width: auto;
  max-width: 196px;
  object-fit: contain;
}

.login-portal .card-sub {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--card-sub);
  line-height: 1.4;
  text-align: center;
  margin: 8px 0 0 0;
}

.login-portal .auth-view .card-sub {
  margin: -12px 0 16px 0;
}

.login-portal .field {
  margin-bottom: 12px;
  text-align: left;
}

.login-portal input[type="text"],
.login-portal input[type="email"],
.login-portal input[type="password"] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 14px;
  border: 1px solid var(--input-border);
  border-radius: var(--r-input);
  outline: none;
  background: var(--input-bg);
  color: var(--input-text);
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.login-portal input[type="text"]::placeholder,
.login-portal input[type="email"]::placeholder,
.login-portal input[type="password"]::placeholder {
  color: var(--input-placeholder);
}

.login-portal input[type="text"]:hover:not(:focus),
.login-portal input[type="email"]:hover:not(:focus),
.login-portal input[type="password"]:hover:not(:focus) {
  border-color: var(--input-border-hover);
}

.login-portal input[type="text"]:focus,
.login-portal input[type="email"]:focus,
.login-portal input[type="password"]:focus {
  border-color: var(--input-border-focus);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.login-portal input.code-input {
  font-family: var(--font-mono);
  letter-spacing: 0.25em;
  text-align: center;
  font-size: 16px;
}

.login-portal .pw-wrapper {
  position: relative;
}

.login-portal .pw-wrapper input {
  padding-right: 48px;
}

.login-portal .toggle-pw {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: 0;
  color: var(--eye-icon);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-btn);
  transition: color 0.15s ease;
}

.login-portal .toggle-pw:hover {
  color: var(--eye-icon-hover);
}

.login-portal .toggle-pw:focus {
  outline: none;
}

.login-portal .toggle-pw:focus-visible {
  outline: 2px solid var(--input-border-focus);
}

.login-portal .toggle-pw svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.login-portal .toggle-pw .eye-off {
  display: none;
}

.login-portal .toggle-pw.is-visible .eye-open {
  display: none;
}

.login-portal .toggle-pw.is-visible .eye-off {
  display: block;
}

.login-portal .btn-submit {
  width: 100%;
  height: 46px;
  margin-top: 6px;
  padding: 0 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--btn-text);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-btn);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.login-portal .btn-submit:hover:not(:disabled) {
  background: var(--btn-bg-hover);
}

.login-portal .btn-submit:focus {
  outline: none;
}

.login-portal .btn-submit:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.login-portal .btn-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

.login-portal .btn-secondary {
  width: 100%;
  height: 38px;
  margin-top: 8px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--card-text);
  background: transparent;
  border: 1px solid var(--input-border);
  border-radius: var(--r-btn);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.login-portal .btn-secondary:hover:not(:disabled) {
  border-color: var(--input-border-focus);
}

.login-portal .btn-secondary:focus {
  outline: none;
}

.login-portal .btn-secondary:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.login-portal .btn-secondary:disabled {
  opacity: 0.5;
  cursor: wait;
}

.login-portal .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--spinner-track);
  border-top-color: var(--spinner-head);
  border-radius: 50%;
  animation: login-spin 0.7s linear infinite;
  display: none;
}

.login-portal .btn-submit.loading .spinner {
  display: inline-block;
}

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

.login-portal .auth-links {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
}

.login-portal .auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--link-text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.login-portal .auth-link:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.login-portal .auth-link:focus {
  outline: none;
}

.login-portal .auth-link:focus-visible {
  color: var(--link-hover);
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.login-portal .auth-link-sep {
  color: var(--input-border);
  font-size: 11px;
  user-select: none;
}

/* Dark-gray veil for smooth fade-in when returning from Forgot Password to Login */
.login-portal .login-reveal-veil {
  position: fixed;
  inset: 0;
  z-index: 50;
  background-color: #0e0e0e;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.login-portal .login-reveal-veil[hidden] {
  display: none;
}

/* Fullscreen pure-black circular reveal overlay for Forgot Password */
.login-portal .forgot-stage {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  pointer-events: auto;
  will-change: clip-path, opacity;
}

.login-portal .forgot-stage[hidden] {
  display: none;
}

.login-portal .forgot-stage-inner {
  width: 100%;
  max-width: 284px;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: opacity, transform;
}

.login-portal .forgot-stage-inner .card-header {
  margin-bottom: 24px;
}

.login-portal .forgot-stage-inner form {
  width: 100%;
}

.login-portal[data-stage="forgot-password"]:not(.is-transitioning) .gateway-canvas,
.login-portal[data-stage="forgot-password"]:not(.is-transitioning) .login-wrapper {
  visibility: hidden;
  pointer-events: none;
}

/* Reusable top-center toast notification */
.haureola-toast-region {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}

.haureola-toast {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100vw - 32px));
  min-height: 40px;
  padding: 9px 10px 9px 14px;
  border-radius: 10px;
  border: 1px solid #2e2e2e;
  background-color: #0a0a0a;
  color: #ededed;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.005em;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(-100%);
  transition: transform 280ms ease-out, opacity 280ms ease-out;
  will-change: transform, opacity;
}

.haureola-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.haureola-toast.is-leaving {
  opacity: 0;
  transform: translateY(-100%);
  transition: transform 260ms ease-in, opacity 260ms ease-in;
}

.haureola-toast--error {
  border-color: rgba(229, 72, 77, 0.45);
  background-color: #120809;
  --toast-accent: #ff6166;
}

.haureola-toast--warning {
  border-color: rgba(255, 178, 36, 0.45);
  background-color: #120e07;
  --toast-accent: #ffb224;
}

.haureola-toast--success {
  border-color: rgba(70, 167, 88, 0.45);
  background-color: #08110a;
  --toast-accent: #46a758;
}

.haureola-toast-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--toast-accent, #ededed);
}

.haureola-toast-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.haureola-toast-message {
  flex: 1 1 auto;
  min-width: 0;
  color: #ededed;
  word-break: break-word;
}

.haureola-toast-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-left: 2px;
  padding: 0;
  border: 0;
  border-radius: var(--r-btn);
  background: transparent;
  color: #888888;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.haureola-toast-close:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.haureola-toast-close:focus {
  outline: none;
}

.haureola-toast-close:focus-visible {
  color: #ffffff;
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

.haureola-toast-close svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

@media (max-width: 480px) {
  .login-portal .login-wrapper {
    padding: 12px;
  }
  .login-portal .login-card {
    width: min(352px, calc(100vw - 24px));
    height: min(352px, calc(100vw - 24px));
    max-width: none;
    aspect-ratio: 1 / 1;
    padding: 36px 48px;
    border-radius: 50%;
  }
  .login-portal .auth-view-host,
  .login-portal .login-card form {
    max-width: 244px;
  }
  .login-portal .card-header {
    margin-bottom: 14px;
  }
  .login-portal .haureola-wordmark-img {
    height: 20px;
    max-width: 164px;
  }
  .login-portal .card-sub {
    font-size: 11.5px;
    margin-top: 6px;
  }
  .login-portal .auth-view .card-sub {
    margin: -8px 0 12px 0;
  }
  .login-portal .field {
    margin-bottom: 9px;
  }
  .login-portal input[type="text"],
  .login-portal input[type="email"],
  .login-portal input[type="password"] {
    height: 42px;
    font-size: 14px;
  }
  .login-portal .btn-submit {
    height: 42px;
    margin-top: 4px;
    font-size: 12.5px;
  }
  .login-portal .auth-links {
    margin-top: 2px;
    gap: 2px;
  }
  .login-portal .auth-link {
    min-height: 44px;
    padding: 0 10px;
    font-size: 12px;
  }
  .haureola-toast-region {
    top: 14px;
    padding: 0 12px;
  }
  .haureola-toast {
    font-size: 12.5px;
  }
}

@media (max-width: 359px), (max-height: 440px) {
  .login-portal .login-card {
    width: 100%;
    max-width: 340px;
    height: auto;
    aspect-ratio: auto;
    border-radius: var(--r-card);
    padding: 28px 20px 24px;
  }
  .login-portal .login-card::before,
  .login-portal .login-card::after {
    border-radius: var(--r-card);
  }
  .login-portal .auth-view-host,
  .login-portal .login-card form {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-portal *,
  .login-portal *::before,
  .login-portal *::after,
  .haureola-toast,
  .haureola-toast * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
