/* Customer login / registration portal adapted from the supplied auth reference.
   The visual language stays native to Blackroot while the animated UnicornStudio scene is preserved. */

.br-auth-unicorn-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: #09090b;
}

.br-auth-unicorn-background__scene {
  position: absolute;
  inset: -2%;
  width: 104%;
  height: 104%;
  opacity: 0;
  filter: saturate(0) brightness(0.5);
  transform: scale(1.015);
  transition: opacity 500ms ease-out;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 2%, #000 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 2%, #000 80%, transparent 100%);
}

.br-auth-unicorn-background[data-unicorn-background-state="ready"] .br-auth-unicorn-background__scene {
  opacity: 0.92;
}

.br-auth-unicorn-background__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 43%, rgba(9, 9, 11, 0.02) 0%, rgba(9, 9, 11, 0.12) 46%, rgba(9, 9, 11, 0.7) 100%),
    linear-gradient(180deg, rgba(9, 9, 11, 0.1) 0%, rgba(9, 9, 11, 0.02) 52%, rgba(9, 9, 11, 0.56) 100%);
}


.br-auth-portal {
  position: relative;
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding: 2.25rem 1rem;
  isolation: isolate;
}

.br-auth-portal::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 8% 20% 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 34%, rgba(70, 70, 70, 0.10), transparent 62%);
  filter: blur(22px);
  pointer-events: none;
}

.br-auth-portal-card {
  position: relative;
  width: min(100%, 29rem);
  margin-inline: auto;
  padding: 2rem 2rem 1.65rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 1.6rem;
  background:
    linear-gradient(180deg, rgba(31, 31, 34, 0.92) 0%, rgba(23, 23, 26, 0.94) 55%, rgba(27, 27, 30, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 28px 70px -30px rgba(0, 0, 0, 0.92),
    0 14px 32px -24px rgba(70, 70, 70, 0.16);
  backdrop-filter: blur(22px) saturate(125%);
  -webkit-backdrop-filter: blur(22px) saturate(125%);
  animation: br-auth-portal-materialize 280ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.br-auth-portal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent 8%, rgba(255, 255, 255, 0.12), transparent 92%);
  pointer-events: none;
}

.br-auth-portal-card__rail {
  position: absolute;
  top: 1.15rem;
  height: 0.32rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  pointer-events: none;
}

.br-auth-portal-card__rail--left {
  left: 2rem;
  width: 3.7rem;
}

.br-auth-portal-card__rail--right {
  right: 2rem;
  width: 2.35rem;
  opacity: 0.46;
}

.br-auth-portal-card__mark {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto;
}

.br-auth-portal-card__brand-icon {
  display: block;
  width: 4rem;
  height: 4rem;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.28));
}

.br-auth-portal-card__heading {
  margin-top: 1.35rem;
  text-align: center;
}

.br-auth-portal-card__title {
  margin: 0;
  color: var(--br-text-primary);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-size: clamp(1.32rem, 3vw, 1.48rem);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
}

.br-auth-portal-card__lede {
  max-width: 24rem;
  margin: 0.55rem auto 0;
  color: var(--br-text-secondary);
  font-size: 0.875rem;
  line-height: 1.55;
}

.br-auth-portal-card__switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.28rem;
  margin: 0.55rem 0 0;
  color: var(--br-text-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.br-auth-portal-card__switch-link {
  color: var(--br-text-body);
  font-weight: 650;
  text-decoration: none;
  transition: color 120ms ease-out, opacity 120ms ease-out;
}

.br-auth-portal-card__switch-link:hover,
.br-auth-portal-card__switch-link:focus-visible {
  color: var(--br-text-primary);
}

.br-auth-portal-card__switch-link:active {
  opacity: 0.72;
}

.br-auth-portal-card__body {
  margin-top: 1.75rem;
}

.br-auth-portal-form {
  gap: 1.05rem;
}

.br-auth-portal .br-field {
  gap: 0.46rem;
}

.br-auth-portal .br-field__label {
  color: rgba(212, 212, 216, 0.72);
  font-family: var(--br-font-mono);
  font-size: 0.66rem;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.br-auth-portal .br-field__control {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 2.9rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 0.82rem;
  background: rgba(6, 7, 8, 0.66);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.018);
  transition:
    border-color 120ms ease-out,
    background-color 120ms ease-out,
    box-shadow 120ms ease-out;
}

.br-auth-portal .br-field__control:focus-within {
  border-color: rgba(95, 95, 95, 0.72);
  background: rgba(6, 8, 8, 0.82);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.34),
    0 0 0 3px rgba(70, 70, 70, 0.09);
}

.br-auth-portal .br-field--invalid .br-field__control {
  border-color: rgba(251, 113, 133, 0.62);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.075);
}

.br-auth-portal .br-field__icon {
  left: 0.9rem;
  z-index: 2;
  color: rgba(161, 161, 170, 0.58);
  transition: color 120ms ease-out;
}

.br-auth-portal .br-field__control:focus-within .br-field__icon {
  color: rgba(212, 212, 212, 0.84);
}

.br-auth-portal .br-field__control .br-input {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.72rem 0.9rem;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--br-text-primary);
  box-shadow: none;
  font-size: 0.875rem;
}

.br-auth-portal .br-field__control .br-input--icon {
  padding-left: 2.65rem;
}

.br-auth-portal .br-field__control .br-input--revealable {
  padding-right: 4.65rem;
}

.br-auth-portal .br-input::placeholder {
  color: rgba(113, 113, 122, 0.72);
}

.br-auth-portal .br-field__reveal {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 0.48rem;
  transform: translateY(-50%);
  min-width: 3.45rem;
  padding: 0.36rem 0.62rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(161, 161, 170, 0.82);
  font: inherit;
  font-size: 0.69rem;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 110ms ease-out, color 110ms ease-out, transform 90ms ease-out;
}

.br-auth-portal .br-field__reveal:hover,
.br-auth-portal .br-field__reveal:focus-visible {
  background: rgba(255, 255, 255, 0.065);
  color: var(--br-text-primary);
}

.br-auth-portal .br-field__reveal:active {
  transform: translateY(-50%) scale(0.96);
}

.br-auth-portal .br-field__hint,
.br-auth-portal .br-field__error {
  font-size: 0.72rem;
  line-height: 1.45;
}

.br-auth-portal-form__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: -0.12rem;
}

.br-auth-portal .br-check {
  gap: 0.5rem;
}

.br-auth-portal .br-check__input {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
}

.br-auth-portal .br-check__label,
.br-auth-portal .br-auth-inline-link {
  font-size: 0.75rem;
}

.br-auth-portal .br-auth-inline-link {
  color: rgba(161, 161, 170, 0.84);
}

.br-auth-portal .br-auth-inline-link:hover,
.br-auth-portal .br-auth-inline-link:focus-visible {
  color: var(--br-text-primary);
}

.br-auth-portal .br-form__actions {
  margin-top: 0.18rem;
}

.br-auth-portal .br-form__actions .br-button {
  min-height: 2.85rem;
  border-radius: 999px;
  border-color: rgba(95, 95, 95, 0.78);
  background: linear-gradient(180deg, var(--br-glow-mid), var(--br-graphite));
  color: #fafafa;
  font-weight: 720;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 15px 34px -18px rgba(70, 70, 70, 0.78);
  transition:
    transform 95ms ease-out,
    filter 120ms ease-out,
    box-shadow 120ms ease-out;
}

.br-auth-portal .br-form__actions .br-button:hover {
  background: linear-gradient(180deg, var(--br-wave-highlight-strong), var(--br-gray-dark));
  border-color: var(--br-wave-highlight-strong);
  filter: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 18px 38px -18px rgba(70, 70, 70, 0.9);
}

.br-auth-portal .br-form__actions .br-button:active {
  background: linear-gradient(180deg, var(--br-gray-dark), var(--br-graphite-deep));
  transform: scale(0.985);
}

.br-auth-portal .br-form__actions .br-button:disabled,
.br-auth-portal .br-form__actions .br-button.is-loading {
  position: relative;
  cursor: wait;
  filter: saturate(0.7) brightness(0.88);
  box-shadow: none;
}

.br-auth-portal .br-form__actions .br-button.is-loading > * {
  visibility: hidden;
}

.br-auth-portal .br-form__actions .br-button.is-loading::after {
  content: "";
  position: absolute;
  width: 0.95rem;
  height: 0.95rem;
  border: 2px solid rgba(4, 17, 12, 0.28);
  border-top-color: #fafafa;
  border-radius: 50%;
  animation: br-auth-submit-spin 650ms linear infinite;
}

.br-auth-portal-card .br-flashes,
.br-auth-portal-card .br-form-errors {
  margin-top: 1.15rem;
  margin-bottom: 0;
}

.br-auth-portal-card__footer {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.065);
  text-align: center;
}

.br-auth-portal-card__footer .br-auth-links p {
  margin: 0;
  font-size: 0.75rem;
}

.br-auth-portal-card__footer .br-auth-links a {
  color: rgba(161, 161, 170, 0.88);
  text-decoration: none;
}

.br-auth-portal-card__footer .br-auth-links a:hover,
.br-auth-portal-card__footer .br-auth-links a:focus-visible {
  color: #5f5f5f;
}

/* Peripheral circuit motif from the supplied reference, restrained to desktop. */
.br-auth-portal__circuit {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.br-auth-portal-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.48rem;
  color: rgba(82, 82, 91, 0.72);
}

.br-auth-portal-node--left-top { left: 2.5rem; top: 26%; }
.br-auth-portal-node--left-bottom { left: 4.5rem; bottom: 15%; }
.br-auth-portal-node--right-top { right: 2.5rem; top: 21%; }
.br-auth-portal-node--right-bottom { right: 4rem; bottom: 18%; }

.br-auth-portal-node__line,
.br-auth-portal-node__link {
  display: block;
  width: 3.7rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(82, 82, 91, 0.62));
}

.br-auth-portal-node__link {
  width: 2.7rem;
  background: rgba(82, 82, 91, 0.52);
}

.br-auth-portal-node--right-top .br-auth-portal-node__line,
.br-auth-portal-node--right-bottom .br-auth-portal-node__line {
  background: linear-gradient(90deg, rgba(82, 82, 91, 0.62), transparent);
}

.br-auth-portal-node__chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 4.3rem;
  height: 2.05rem;
  border: 1px solid rgba(82, 82, 91, 0.48);
  border-radius: 0.7rem;
  background: rgba(24, 24, 27, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.br-auth-portal-node__bar {
  width: 2.2rem;
  height: 0.22rem;
  border-radius: 999px;
  background: rgba(113, 113, 122, 0.72);
}

.br-auth-portal-node__bar.is-accent {
  width: 2.35rem;
  background: rgba(95, 95, 95, 0.86);
  box-shadow: 0 0 14px rgba(95, 95, 95, 0.22);
}

.br-auth-portal-node__bar.is-short {
  width: 1.75rem;
}

.br-auth-portal-node__segments {
  display: flex;
  gap: 0.22rem;
}

.br-auth-portal-node__segments i {
  display: block;
  width: 0.55rem;
  height: 0.2rem;
  border-radius: 999px;
  background: rgba(113, 113, 122, 0.65);
}

.br-auth-portal-node__segments i:nth-child(2) { opacity: 0.62; }
.br-auth-portal-node__segments i:nth-child(3) { opacity: 0.36; }

.br-auth-portal-node__pulse {
  position: absolute;
  top: 50%;
  width: 0.3rem;
  height: 0.3rem;
  border-radius: 50%;
  background: #5f5f5f;
  box-shadow: 0 0 12px rgba(95, 95, 95, 0.55);
  transform: translateY(-50%);
  animation: br-auth-node-pulse 1.9s ease-in-out infinite;
}

.br-auth-portal-node--left-top .br-auth-portal-node__pulse,
.br-auth-portal-node--left-bottom .br-auth-portal-node__pulse { left: -0.18rem; }

.br-auth-portal-node--right-top .br-auth-portal-node__pulse,
.br-auth-portal-node--right-bottom .br-auth-portal-node__pulse { right: -0.18rem; }

@keyframes br-auth-portal-materialize {
  from {
    opacity: 0;
    transform: translateY(5px) scale(0.992);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes br-auth-node-pulse {
  0%, 100% { opacity: 0.42; transform: translateY(-50%) scale(0.86); }
  50% { opacity: 1; transform: translateY(-50%) scale(1); }
}

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

@media (max-width: 767px) {
  .br-auth-portal {
    padding: 0.7rem 0 1.5rem;
  }

  .br-auth-portal__circuit {
    display: none;
  }

  .br-auth-portal-card {
    padding: 1.75rem 1.15rem 1.35rem;
    border-radius: 1.35rem;
  }

  .br-auth-portal-card__rail {
    display: none;
  }

  .br-auth-portal-card__body {
    margin-top: 1.45rem;
  }

  .br-auth-portal .br-input {
    font-size: 1rem;
  }
}

@media (max-width: 420px) {
  .br-auth-portal-form__meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .br-auth-portal-card,
  .br-auth-portal-node__pulse {
    animation: none !important;
  }

  .br-auth-portal .br-form__actions .br-button,
  .br-auth-portal .br-field__reveal {
    transition: opacity 120ms ease-out, background-color 120ms ease-out, color 120ms ease-out !important;
  }

  .br-auth-portal .br-form__actions .br-button:active,
  .br-auth-portal .br-field__reveal:active {
    transform: none;
  }

  .br-auth-portal .br-form__actions .br-button.is-loading::after {
    animation: none;
    opacity: 0.72;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .br-auth-portal-card {
    background: #18181b;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .br-auth-portal .br-field__control {
    background: #09090b;
  }
}

@media (prefers-contrast: more) {
  .br-auth-portal-card,
  .br-auth-portal .br-field__control {
    border-color: rgba(255, 255, 255, 0.28);
  }

  .br-auth-portal-card__lede,
  .br-auth-portal-card__switch,
  .br-auth-portal .br-field__label {
    color: rgba(244, 244, 245, 0.88);
  }
}
