/* React Bits BorderGlow adapted for the Blade login text fields. */
.border-glow-card {
  --edge-proximity: 0;
  --cursor-angle: 45deg;
  --edge-sensitivity: 0;
  --color-sensitivity: 0;
  --border-radius: 25px;
  --glow-padding: 24px;
  --cone-spread: 39;
  --fill-opacity: .48;

  --glow-color: hsl(42deg 96% 56% / 100%);
  --glow-color-60: hsl(42deg 96% 56% / 86%);
  --glow-color-50: hsl(42deg 96% 56% / 72%);
  --glow-color-40: hsl(42deg 96% 56% / 58%);
  --glow-color-30: hsl(42deg 96% 56% / 44%);
  --glow-color-20: hsl(42deg 96% 56% / 30%);
  --glow-color-10: hsl(42deg 96% 56% / 18%);

  --gradient-one: radial-gradient(at 80% 55%, #c084fc 0px, transparent 50%);
  --gradient-two: radial-gradient(at 69% 34%, #f472b6 0px, transparent 50%);
  --gradient-three: radial-gradient(at 8% 6%, #38bdf8 0px, transparent 50%);
  --gradient-four: radial-gradient(at 41% 38%, #c084fc 0px, transparent 50%);
  --gradient-five: radial-gradient(at 86% 85%, #f472b6 0px, transparent 50%);
  --gradient-six: radial-gradient(at 82% 18%, #38bdf8 0px, transparent 50%);
  --gradient-seven: radial-gradient(at 51% 4%, #f472b6 0px, transparent 50%);
  --gradient-base: linear-gradient(#c084fc 0 100%);

  position: relative;
  border-radius: var(--border-radius);
  isolation: isolate;
  transform: translate3d(0, 0, 0.01px);
  display: grid;
  border: 1px solid #ccc;
  background: var(--card-bg, #fafafa);
  overflow: visible;
  box-shadow: none;
}

.border-glow-card::before,
.border-glow-card::after,
.border-glow-card > .edge-light {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transition: opacity .2s ease-out;
  pointer-events: none;
}

.border-glow-card:not(:hover):not(:focus-within):not(.sweep-active)::before,
.border-glow-card:not(:hover):not(:focus-within):not(.sweep-active)::after,
.border-glow-card:not(:hover):not(:focus-within):not(.sweep-active) > .edge-light {
  opacity: 0;
  transition: opacity .55s ease-in-out;
}

/* Animated multicolor edge. It is always BEHIND the field content. */
.border-glow-card::before {
  z-index: 1;
  inset: -1px;
  border: 2px solid transparent;
  background:
    var(--gradient-one) border-box,
    var(--gradient-two) border-box,
    var(--gradient-three) border-box,
    var(--gradient-four) border-box,
    var(--gradient-five) border-box,
    var(--gradient-six) border-box,
    var(--gradient-seven) border-box,
    var(--gradient-base) border-box;
  opacity: clamp(0, calc(var(--edge-proximity) / 62), 1);
  filter: saturate(1.45) brightness(1.12);
  mask-image:
    conic-gradient(
      from var(--cursor-angle) at center,
      black calc(var(--cone-spread) * 1%),
      transparent calc((var(--cone-spread) + 12) * 1%),
      transparent calc((100 - var(--cone-spread) - 12) * 1%),
      black calc((100 - var(--cone-spread)) * 1%)
    );
}

/* Soft color remains behind the input only; it can never cover typed text. */
.border-glow-card::after {
  z-index: 0;
  inset: 2px;
  background:
    radial-gradient(circle at 80% 55%, rgba(192,132,252,.34) 0, transparent 42%),
    radial-gradient(circle at 69% 34%, rgba(244,114,182,.30) 0, transparent 44%),
    radial-gradient(circle at 8% 6%, rgba(56,189,248,.28) 0, transparent 44%),
    radial-gradient(circle at 52% 100%, rgba(250,204,21,.22) 0, transparent 52%);
  opacity: clamp(0, calc(var(--fill-opacity) * var(--edge-proximity) / 62), .62);
  filter: blur(9px) saturate(1.25);
}

/* Golden halo stays behind the field. */
.border-glow-card > .edge-light {
  inset: calc(var(--glow-padding) * -1);
  z-index: 0;
  opacity: clamp(0, calc(var(--edge-proximity) / 62), 1);
  mix-blend-mode: normal;
  filter: blur(5px);
  mask-image:
    conic-gradient(
      from var(--cursor-angle) at center,
      black 2%,
      transparent 13%,
      transparent 87%,
      black 98%
    );
}

.border-glow-card > .edge-light::before {
  content: "";
  position: absolute;
  inset: var(--glow-padding);
  border-radius: inherit;
  box-shadow:
    0 0 4px 1px var(--glow-color-60),
    0 0 10px 2px var(--glow-color-50),
    0 0 18px 4px var(--glow-color-40),
    0 0 30px 7px var(--glow-color-30),
    0 0 44px 10px var(--glow-color-20);
}

.border-glow-inner {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  z-index: 2;
  border-radius: inherit;
  background: #fafafa;
}

.login-text-glow {
  --card-bg: #fafafa;
  width: 100%;
  margin-bottom: 15px;
}

.login-text-glow:hover::before,
.login-text-glow:focus-within::before,
.login-text-glow.sweep-active::before {
  filter: saturate(1.65) brightness(1.18);
}

.login-text-glow:hover > .edge-light,
.login-text-glow:focus-within > .edge-light,
.login-text-glow.sweep-active > .edge-light {
  filter: blur(6px) brightness(1.16) saturate(1.25);
}

.login-text-glow .login-input-shell {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  min-height: 50px;
  border-radius: inherit;
  overflow: hidden;
  background: #fafafa;
  border: 1px solid #ccc;
}

.login-text-glow:focus-within .login-input-shell {
  background: #fafafa;
  border-color: transparent;
}

.enhanced-card .login-text-glow .form-control {
  position: relative;
  z-index: 4;
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
  height: 50px;
  margin: 0;
  padding: 12px 14px;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0;
  color: #1f2937 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

.enhanced-card .login-text-glow .form-control::placeholder {
  color: #6b7280;
  opacity: 1;
}

.login-input-icon {
  position: relative;
  z-index: 4;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin-inline-start: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: #6c63ff;
  background: rgba(108, 99, 255, .08);
}

.login-text-glow.has-error .login-input-shell,
.login-text-glow:has(.is-invalid) .login-input-shell {
  border-color: #dc3545;
}

.login-role-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 7px;
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  background: rgba(108, 99, 255, .08);
}

.login-role-icon i {
  margin: 0 !important;
}

.user-card.active-role .login-role-icon {
  background: rgba(255, 255, 255, .16);
}

.user-card.active-role .login-role-icon i {
  color: #fff;
}

@media (hover: none), (pointer: coarse) {
  .border-glow-card::before,
  .border-glow-card::after,
  .border-glow-card > .edge-light {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .border-glow-card,
  .border-glow-card::before,
  .border-glow-card::after,
  .border-glow-card > .edge-light {
    transition: none !important;
  }
}
