:root {
  --sefar-auth-ink: #093649;
  --sefar-auth-blue: #093649;
  --sefar-auth-blue-soft: #0d5d78;
  --sefar-auth-gold: #dbba72;
  --sefar-auth-muted: #6b7f89;
  --sefar-auth-line: rgba(219, 234, 242, 0.18);
}

body:has(.sefar-login-shell) {
  min-width: 0;
  background: var(--sefar-auth-ink);
}

.sefar-login-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background-color: #093649;
  background:
    linear-gradient(90deg, rgba(9, 54, 73, 0.18) 0%, rgba(9, 54, 73, 0.22) 45%, rgba(9, 54, 73, 0.72) 100%),
    linear-gradient(110deg, rgba(9, 54, 73, 0.92) 0%, rgba(9, 54, 73, 0.76) 45%, rgba(9, 54, 73, 0.5) 100%),
    url("../img/bglogin.png") center / cover no-repeat;
  color: #ffffff;
  isolation: isolate;
}

.sefar-login-canvas,
.sefar-login-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sefar-login-canvas {
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.96;
}

.sefar-login-three-canvas {
  opacity: 0;
  filter: saturate(1.34) brightness(1.12);
}

.sefar-login-shell[data-sefar-auth-renderer="three"] .sefar-login-three-canvas {
  opacity: 1;
}

.sefar-login-shell[data-sefar-auth-renderer="three-tree"] .sefar-login-three-canvas {
  opacity: 0.88;
}

.sefar-login-overlay {
  z-index: 1;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(9, 54, 73, 0.72) 0%, rgba(9, 54, 73, 0.56) 34%, rgba(9, 54, 73, 0.2) 58%, rgba(9, 54, 73, 0.48) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 24%),
    linear-gradient(90deg, rgba(219, 186, 114, 0.11), transparent 42%),
    linear-gradient(135deg, transparent 0%, rgba(13, 93, 120, 0.16) 52%, transparent 100%);
}

.sefar-login-overlay::before,
.sefar-login-overlay::after {
  content: '';
  position: absolute;
  pointer-events: none;
  will-change: transform, opacity;
}

.sefar-login-overlay::before {
  inset: -24% -46%;
  background:
    linear-gradient(104deg, transparent 0%, transparent 39%, rgba(143, 216, 255, 0.14) 46%, rgba(219, 186, 114, 0.13) 50%, rgba(255, 255, 255, 0.08) 53%, transparent 61%, transparent 100%);
  opacity: 0.82;
  transform: translate3d(-34%, 0, 0);
  animation: sefarLoginSweep 6.4s linear infinite;
}

.sefar-login-overlay::after {
  right: -18%;
  bottom: 13%;
  left: -18%;
  height: 28%;
  background:
    linear-gradient(90deg, transparent 0%, rgba(143, 216, 255, 0.12) 35%, rgba(219, 186, 114, 0.1) 50%, rgba(143, 216, 255, 0.12) 65%, transparent 100%);
  opacity: 0.5;
  transform: translate3d(-7%, 0, 0) skewY(-5deg);
  animation: sefarLoginHorizon 8.4s ease-in-out infinite alternate;
}

.sefar-login-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: clamp(1.25rem, 4vw, 3.8rem);
  align-items: center;
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3rem);
}

.sefar-login-hero {
  max-width: 680px;
  will-change: transform, opacity;
}

.sefar-login-hero-logo {
  display: block;
  width: clamp(82px, 9vw, 122px);
  height: auto;
  margin-bottom: clamp(1.25rem, 3vw, 2.1rem);
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.32));
}

.sefar-login-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  margin: 0 0 0.75rem;
  border: 1px solid rgba(219, 186, 114, 0.38);
  border-radius: 8px;
  padding: 0.36rem 0.65rem;
  background: rgba(9, 54, 73, 0.64);
  color: var(--sefar-auth-gold);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sefar-login-hero h1 {
  max-width: 760px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.35rem, 6vw, 4.9rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0;
  text-shadow:
    0 16px 38px rgba(9, 54, 73, 0.96),
    0 4px 10px rgba(9, 54, 73, 0.82),
    0 1px 2px rgba(0, 20, 31, 0.7);
}

.sefar-login-copy {
  max-width: 600px;
  margin: 1rem 0 0;
  color: rgba(242, 248, 250, 0.9);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.55;
  text-shadow: 0 10px 26px rgba(9, 54, 73, 0.9);
}

.sefar-login-pulse {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.4rem;
}

.sefar-login-pulse span {
  display: block;
  width: clamp(34px, 7vw, 74px);
  height: 4px;
  border-radius: 8px;
  background: rgba(219, 186, 114, 0.78);
  box-shadow: 0 0 18px rgba(219, 186, 114, 0.28);
  animation: sefarLoginPulse 1.85s ease-in-out infinite alternate;
  transform-origin: left center;
}

.sefar-login-pulse span:nth-child(2) {
  width: clamp(22px, 5vw, 48px);
  background: rgba(143, 216, 255, 0.62);
  animation-delay: 0.18s;
}

.sefar-login-pulse span:nth-child(3) {
  width: clamp(14px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.52);
  animation-delay: 0.36s;
}

.sefar-login-card {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: clamp(1.1rem, 3vw, 1.45rem);
  background: rgba(255, 255, 255, 0.92);
  color: var(--sefar-auth-blue);
  box-shadow: 0 24px 58px rgba(0, 27, 39, 0.34);
  backdrop-filter: blur(18px);
  will-change: transform, opacity;
}

.sefar-login-shell.sefar-auth-native-motion .sefar-login-hero-logo,
.sefar-login-shell.sefar-auth-native-motion .sefar-login-kicker,
.sefar-login-shell.sefar-auth-native-motion .sefar-login-hero h1,
.sefar-login-shell.sefar-auth-native-motion .sefar-login-copy,
.sefar-login-shell.sefar-auth-native-motion .sefar-login-pulse,
.sefar-login-shell.sefar-auth-native-motion .sefar-login-card {
  animation: sefarLoginEnter 0.78s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sefar-login-shell.sefar-auth-native-motion .sefar-login-kicker {
  animation-delay: 0.05s;
}

.sefar-login-shell.sefar-auth-native-motion .sefar-login-hero h1 {
  animation-delay: 0.1s;
}

.sefar-login-shell.sefar-auth-native-motion .sefar-login-copy {
  animation-delay: 0.15s;
}

.sefar-login-shell.sefar-auth-native-motion .sefar-login-pulse {
  animation-delay: 0.2s;
}

.sefar-login-shell.sefar-auth-native-motion .sefar-login-card {
  animation-delay: 0.16s;
}

.sefar-login-shell[data-sefar-auth-motion="gsap"] .sefar-login-hero-logo,
.sefar-login-shell[data-sefar-auth-motion="gsap"] .sefar-login-kicker,
.sefar-login-shell[data-sefar-auth-motion="gsap"] .sefar-login-hero h1,
.sefar-login-shell[data-sefar-auth-motion="gsap"] .sefar-login-copy,
.sefar-login-shell[data-sefar-auth-motion="gsap"] .sefar-login-pulse,
.sefar-login-shell[data-sefar-auth-motion="gsap"] .sefar-login-card,
.sefar-login-shell[data-sefar-auth-motion="gsap"] .sefar-login-pulse span {
  animation: none;
}

.sefar-login-card-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(9, 49, 67, 0.12);
}

.sefar-login-card-head img {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  object-fit: contain;
}

.sefar-login-card-head p {
  margin: 0 0 0.12rem;
  color: var(--sefar-auth-muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sefar-login-card-head h2 {
  margin: 0;
  color: var(--sefar-auth-blue);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.05;
}

.sefar-login-errors {
  margin-bottom: 1rem;
}

.sefar-login-status {
  margin-bottom: 1rem;
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  background: #ecfdf5;
  color: #065f46;
  font-weight: 800;
}

.sefar-login-form {
  display: grid;
  gap: 0.9rem;
}

.sefar-login-field {
  display: grid;
  gap: 0.38rem;
  margin: 0;
}

.sefar-login-field span {
  color: var(--sefar-auth-blue);
  font-size: 0.82rem;
  font-weight: 900;
}

.sefar-login-field input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid rgba(9, 49, 67, 0.16);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  background: #ffffff;
  color: var(--sefar-auth-blue);
  font-size: 0.98rem;
  font-weight: 700;
  outline: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sefar-login-field input:focus {
  border-color: rgba(161, 127, 72, 0.74);
  box-shadow: 0 0 0 0.2rem rgba(219, 186, 114, 0.22);
}

.sefar-login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.1rem;
}

.sefar-login-check {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  margin: 0;
  color: var(--sefar-auth-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.sefar-login-check input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  accent-color: var(--sefar-auth-blue);
}

.sefar-login-options a,
.sefar-login-register a,
.sefar-login-link-button {
  color: var(--sefar-auth-blue-soft);
  font-weight: 900;
  text-decoration: none;
}

.sefar-login-options a:hover,
.sefar-login-register a:hover,
.sefar-login-link-button:hover {
  color: var(--sefar-auth-blue);
  text-decoration: underline;
}

.sefar-login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 3.05rem;
  border: 0;
  border-radius: 8px;
  padding: 0.78rem 1rem;
  background:
    linear-gradient(135deg, var(--sefar-auth-blue-soft), var(--sefar-auth-blue));
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(9, 49, 67, 0.24);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sefar-login-button svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 1.05rem;
}

.sefar-login-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(9, 49, 67, 0.3);
}

.sefar-login-button--compact {
  width: auto;
  min-width: 11rem;
  padding-right: 1.2rem;
  padding-left: 1.2rem;
}

.sefar-login-text {
  margin: 0 0 1rem;
  color: var(--sefar-auth-muted);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.55;
}

.sefar-login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin-top: 0.2rem;
}

.sefar-login-actions--split {
  align-items: stretch;
  margin-top: 1.15rem;
}

.sefar-login-actions--split form {
  display: flex;
  min-width: 0;
}

.sefar-login-actions--split .sefar-login-button {
  width: auto;
}

.sefar-login-link-button {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.sefar-login-register {
  margin: 0.1rem 0 0;
  color: var(--sefar-auth-muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .sefar-login-canvas {
    opacity: 0.42;
  }

  .sefar-login-shell.sefar-auth-native-motion .sefar-login-hero-logo,
  .sefar-login-shell.sefar-auth-native-motion .sefar-login-kicker,
  .sefar-login-shell.sefar-auth-native-motion .sefar-login-hero h1,
  .sefar-login-shell.sefar-auth-native-motion .sefar-login-copy,
  .sefar-login-shell.sefar-auth-native-motion .sefar-login-pulse,
  .sefar-login-shell.sefar-auth-native-motion .sefar-login-card {
    animation: none;
  }

  .sefar-login-pulse span {
    animation-duration: 4.8s;
  }

  .sefar-login-overlay::before {
    opacity: 0.44;
    animation-duration: 18s;
  }

  .sefar-login-overlay::after {
    opacity: 0.32;
    animation-duration: 24s;
  }

  .sefar-login-button,
  .sefar-login-field input {
    transition: none;
  }
}

@keyframes sefarLoginEnter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sefarLoginPulse {
  from {
    transform: scaleX(1);
    opacity: 0.72;
  }

  to {
    transform: scaleX(0.58);
    opacity: 1;
  }
}

@keyframes sefarLoginSweep {
  from {
    transform: translate3d(-34%, 0, 0);
  }

  to {
    transform: translate3d(34%, 0, 0);
  }
}

@keyframes sefarLoginHorizon {
  from {
    opacity: 0.36;
    transform: translate3d(-7%, 0, 0) skewY(-5deg);
  }

  to {
    opacity: 0.62;
    transform: translate3d(7%, -5%, 0) skewY(-5deg);
  }
}

@media (max-width: 900px) {
  .sefar-login-layout {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 1.5rem;
  }

  .sefar-login-hero {
    max-width: 560px;
  }

  .sefar-login-hero-logo {
    width: 84px;
    margin-bottom: 1rem;
  }

  .sefar-login-copy {
    max-width: 520px;
  }

  .sefar-login-card {
    max-width: 460px;
  }
}

@media (max-width: 575.98px) {
  .sefar-login-shell {
    min-height: 100svh;
  }

  .sefar-login-shell[data-sefar-auth-renderer="three-tree"] .sefar-login-three-canvas {
    opacity: 0.68;
    filter: saturate(1.24) brightness(1.06);
  }

  .sefar-login-layout {
    min-height: 100svh;
    padding: 1rem;
  }

  .sefar-login-hero h1 {
    font-size: 2.15rem;
  }

  .sefar-login-copy {
    font-size: 0.95rem;
  }

  .sefar-login-card {
    padding: 1rem;
  }

  .sefar-login-card-head {
    align-items: flex-start;
  }

  .sefar-login-options {
    align-items: flex-start;
    flex-direction: column;
  }

  .sefar-login-actions,
  .sefar-login-actions--split {
    align-items: stretch;
    flex-direction: column;
  }

  .sefar-login-button--compact,
  .sefar-login-actions--split .sefar-login-button {
    width: 100%;
  }
}
