:root {
  color-scheme: dark;
  --background: #07111f;
  --surface: #0e1927;
  --surface-2: #132132;
  --line: #26384d;
  --text: #f5f8fc;
  --muted: #8195ad;
  --accent: #4f8cff;
  --mint: #35d6a0;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  position: relative;
  background:
    radial-gradient(circle at 18% 18%, rgba(52, 126, 255, .17), transparent 33%),
    radial-gradient(circle at 82% 76%, rgba(53, 214, 160, .08), transparent 30%),
    var(--background);
  color: var(--text);
  overflow: hidden;
}

button,
input { font: inherit; }

.login-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-aurora {
  position: absolute;
  inset: -25%;
  opacity: .48;
  background:
    radial-gradient(ellipse at 22% 25%, rgba(53, 214, 160, .18), transparent 34%),
    radial-gradient(ellipse at 68% 15%, rgba(79, 140, 255, .22), transparent 36%),
    radial-gradient(ellipse at 54% 76%, rgba(51, 117, 217, .11), transparent 32%);
  filter: blur(36px) saturate(1.12);
  animation: login-aurora-drift 18s ease-in-out infinite alternate;
}

.login-leaves {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: .56;
}

.login-leaf {
  position: absolute;
  top: -9vh;
  left: var(--leaf-left);
  width: var(--leaf-size);
  height: calc(var(--leaf-size) * .55);
  border-radius: 92% 8% 82% 18%;
  background: linear-gradient(140deg, rgba(105, 186, 145, .72), rgba(35, 97, 86, .22));
  box-shadow: inset 0 -1px rgba(207, 245, 224, .18), 0 5px 15px rgba(0, 0, 0, .12);
  transform: rotate(var(--leaf-rotation));
  transform-origin: 70% 55%;
  animation: login-leaf-fall var(--leaf-duration) linear var(--leaf-delay) infinite;
  will-change: transform;
}

.login-leaf::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 7%;
  top: 50%;
  height: 1px;
  background: rgba(196, 233, 213, .27);
  transform: rotate(-6deg);
  transform-origin: right;
}

.login-leaf-2 {
  opacity: .56;
  background: linear-gradient(140deg, rgba(97, 154, 132, .64), rgba(28, 74, 70, .18));
}

.login-leaf-3 {
  opacity: .42;
  filter: blur(.35px);
  background: linear-gradient(140deg, rgba(131, 175, 116, .58), rgba(51, 95, 70, .18));
}

@keyframes login-aurora-drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1); }
  to { transform: translate3d(2.5%, 1.5%, 0) scale(1.05); }
}

@keyframes login-leaf-fall {
  0% {
    transform: translate3d(0, -12vh, 0) rotate(var(--leaf-rotation));
  }
  45% {
    transform: translate3d(var(--leaf-drift), 48vh, 0) rotate(calc(var(--leaf-rotation) + 155deg));
  }
  100% {
    transform: translate3d(calc(var(--leaf-drift) * -.45), 116vh, 0) rotate(calc(var(--leaf-rotation) + 350deg));
  }
}

.login-layout {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(500px, 1.1fr);
}

.login-presentation {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(28px, 4vw, 60px);
  border-right: 1px solid rgba(116, 151, 193, .16);
  background:
    linear-gradient(145deg, rgba(15, 36, 61, .86), rgba(7, 17, 31, .96)),
    repeating-linear-gradient(45deg, transparent 0 35px, rgba(79, 140, 255, .03) 36px 37px);
}

.login-presentation::after {
  content: "";
  position: absolute;
  width: min(52vw, 650px);
  height: min(52vw, 650px);
  right: -42%;
  bottom: -30%;
  border: 1px solid rgba(79, 140, 255, .18);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(79, 140, 255, .025),
    0 0 0 140px rgba(79, 140, 255, .018);
}

.login-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.login-brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--accent);
  box-shadow: 0 12px 32px rgba(79, 140, 255, .3);
}

.login-brand-mark svg {
  width: 25px;
  fill: none;
  stroke: white;
  stroke-width: 1.7;
}

.login-brand strong {
  font-size: 22px;
  letter-spacing: -.02em;
}

.presentation-copy {
  position: relative;
  z-index: 1;
  max-width: 580px;
  margin: auto 0;
}

.login-eyebrow {
  color: #82adff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .16em;
}

.presentation-copy h1 {
  margin: 18px 0;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.02;
  letter-spacing: -.055em;
}

.presentation-copy p {
  max-width: 490px;
  margin: 0;
  color: #9cafc4;
  font-size: clamp(14px, 1.3vw, 18px);
  line-height: 1.65;
}

.presentation-status {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.presentation-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(53, 214, 160, .09);
}

.presentation-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.login-sound-toggle {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid rgba(116, 151, 193, .22);
  border-radius: 9px;
  background: rgba(10, 24, 38, .7);
  color: #8fa4bb;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}

.login-sound-toggle:hover {
  color: #dbe8f5;
  border-color: rgba(79, 140, 255, .44);
  background: rgba(17, 37, 58, .9);
  transform: translateY(-1px);
}

.login-sound-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.login-sound-toggle:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.login-sound-toggle svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-sound-toggle .sound-on-icon,
.login-sound-toggle.is-playing .sound-off-icon { display: none; }
.login-sound-toggle.is-playing .sound-on-icon { display: block; }

.login-sound-toggle.is-playing {
  color: #62e1b5;
  border-color: rgba(53, 214, 160, .36);
  background: rgba(21, 74, 62, .28);
}

.login-panel {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 20px;
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid rgba(99, 130, 168, .3);
  border-radius: 20px;
  background: rgba(14, 25, 39, .93);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .35);
  backdrop-filter: blur(18px);
}

.login-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 4px;
}

.login-lock {
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(79, 140, 255, .12);
  color: #82adff;
}

.login-lock svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-card-heading h2 {
  margin: 5px 0 6px;
  font-size: 24px;
  letter-spacing: -.025em;
}

.login-card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.login-alert {
  padding: 11px 13px;
  border: 1px solid rgba(239, 102, 116, .3);
  border-radius: 9px;
  background: rgba(239, 102, 116, .08);
  color: #ff9dab;
  font-size: 10px;
  line-height: 1.45;
}

.login-alert.warning {
  border-color: rgba(242, 173, 79, .3);
  background: rgba(242, 173, 79, .08);
  color: #f5c47f;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field > span {
  color: #a9b8ca;
  font-size: 10px;
  font-weight: 700;
}

.login-field > div {
  height: 48px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a1420;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.login-field > div:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .1);
}

.login-field svg {
  width: 18px;
  fill: none;
  stroke: #71869e;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.login-field input::placeholder { color: #54677e; }

.login-submit {
  height: 49px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 3px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(79, 140, 255, .22);
}

.login-submit:hover { background: #6198ff; }
.login-submit:disabled { background: #34455b; color: #8191a4; cursor: not-allowed; box-shadow: none; }
.login-submit span { font-size: 18px; }
.login-card.is-submitting .login-submit {
  pointer-events: none;
  opacity: .72;
}

.login-security {
  margin: -5px 0 0;
  color: #62758d;
  font-size: 9px;
  text-align: center;
}

@media (max-width: 820px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-presentation {
    display: block;
    height: 220px;
    min-height: 220px;
    padding: 24px;
    border-right: 0;
    border-bottom: 1px solid rgba(116, 151, 193, .16);
  }
  .login-brand { position: absolute; top: 24px; left: 24px; }
  .presentation-copy { position: absolute; top: 88px; left: 24px; right: 24px; margin: 0; }
  .presentation-copy h1 { margin: 10px 0; font-size: 32px; }
  .presentation-copy h1 br { display: none; }
  .presentation-copy p { font-size: 12px; }
  .presentation-footer { position: absolute; top: 24px; right: 24px; }
  .presentation-status { display: none; }
  .login-sound-toggle span { display: none; }
  .login-sound-toggle { width: 36px; padding: 0; justify-content: center; }
  .login-panel { min-height: auto; padding: 18px 12px 30px; }
  .login-card { padding: 24px 20px; border-radius: 16px; }
}

@media (max-width: 420px) {
  .login-presentation { height: 190px; min-height: 190px; padding: 20px; }
  .login-brand { top: 20px; left: 20px; }
  .presentation-footer { top: 20px; right: 20px; }
  .login-brand-mark { width: 40px; height: 40px; }
  .login-brand strong { font-size: 19px; }
  .presentation-copy { top: 79px; left: 20px; right: 20px; }
  .presentation-copy h1 { font-size: 27px; }
  .presentation-copy p { display: none; }
  .login-card-heading h2 { font-size: 21px; }
}

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