@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;600;700;800&display=swap");

:root {
  --login-bg: #06110d;
  --login-surface: rgba(10, 19, 15, 0.92);
  --login-surface-strong: rgba(18, 31, 24, 0.96);
  --login-border: rgba(119, 255, 159, 0.18);
  --login-text: #f5fff7;
  --login-muted: #9ab6a3;
  --login-accent: #67f58d;
  --login-accent-strong: #2fdd73;
  --login-accent-soft: rgba(103, 245, 141, 0.18);
  --login-warm: #9dffbd;
  --login-danger: #ff7f7f;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
}

.login-body {
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(72, 197, 113, 0.18), transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(93, 223, 135, 0.12), transparent 24%),
    linear-gradient(160deg, #07110d 0%, #0a1712 38%, #050a08 100%);
  color: var(--login-text);
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
}

.login-body::before,
.login-body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.login-body::before {
  background:
    radial-gradient(circle at 15% 18%, rgba(65, 224, 120, 0.22) 0%, transparent 18%),
    radial-gradient(circle at 82% 12%, rgba(122, 255, 165, 0.16) 0%, transparent 14%),
    radial-gradient(circle at 50% 100%, rgba(38, 111, 68, 0.25) 0%, transparent 30%);
  filter: blur(36px);
  opacity: 0.95;
}

.login-body::after {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.07;
}

.login-root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.login-card {
  position: relative;
  width: min(100%, 460px);
  padding: 32px;
  border-radius: 30px;
  background: linear-gradient(180deg, var(--login-surface-strong) 0%, var(--login-surface) 100%);
  border: 1px solid var(--login-border);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--login-accent), var(--login-accent-strong));
}

.login-card::after {
  content: "";
  position: absolute;
  right: -56px;
  bottom: -72px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(103, 245, 141, 0.22) 0%, rgba(103, 245, 141, 0) 72%);
}

.login-card-header {
  position: relative;
  z-index: 1;
}

.login-logo {
  display: block;
  width: 84px;
  margin: 4px auto 18px;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.34));
}

.login-title {
  margin: 0;
  color: var(--login-text);
  font-size: clamp(1.5rem, 3.6vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

#login-form {
  position: relative;
  z-index: 1;
  margin-top: 28px;
}

.input-group {
  margin: 14px 0;
  position: relative;
}

.input-group input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(155, 203, 172, 0.18);
  background: rgba(6, 11, 8, 0.78);
  color: var(--login-text);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
}

.input-group input::placeholder {
  color: rgba(223, 244, 230, 0.55);
}

.input-group input:focus {
  border-color: rgba(103, 245, 141, 0.92);
  background: rgba(9, 17, 13, 0.94);
  box-shadow:
    0 0 0 4px rgba(103, 245, 141, 0.14),
    0 14px 26px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.input-group input:-webkit-autofill,
.input-group input:-webkit-autofill:hover,
.input-group input:-webkit-autofill:focus,
.input-group input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--login-text) !important;
  box-shadow: 0 0 0 1000px rgba(9, 17, 13, 0.94) inset;
  transition: background-color 5000s ease-in-out 0s;
  caret-color: var(--login-text);
}

.password-group input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.password-toggle:hover {
  background: rgba(103, 245, 141, 0.1);
  border-color: rgba(103, 245, 141, 0.25);
  transform: translateY(calc(-50% - 1px));
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  fill: #dff4e6;
}

.icon-eye.is-hidden {
  display: none;
}

.login-button {
  width: 100%;
  min-height: 58px;
  margin-top: 10px;
  border: none;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #8dffb7 0%, #46ea7b 52%, #2fdd73 100%);
  color: #08210f;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow:
    0 18px 36px rgba(70, 234, 123, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease, opacity 0.2s ease;
}

.login-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow:
    0 22px 40px rgba(70, 234, 123, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.login-button:disabled {
  cursor: not-allowed;
  opacity: 0.84;
}

.login-button.is-loading {
  filter: saturate(0.9);
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(8, 33, 15, 0.2);
  border-top-color: #08210f;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

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

.reset-link {
  margin-top: 16px;
  text-align: center;
}

.reset-link a {
  color: #d7ffe1;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.reset-link a:hover {
  color: #ffffff;
}

.login-slider {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.slider-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: rgba(164, 190, 172, 0.2);
  border: 1px solid rgba(164, 190, 172, 0.2);
  transition: width 0.2s ease, background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.slider-dot.active {
  width: 30px;
  background: linear-gradient(90deg, #8dffb7 0%, #46ea7b 100%);
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(103, 245, 141, 0.12);
}

.login-terms {
  position: relative;
  z-index: 1;
  margin: 20px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #89a391;
  font-size: 12px;
  line-height: 1.65;
}

.login-terms a {
  color: var(--login-warm);
  text-decoration: none;
  font-weight: 800;
}

.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: min(100%, calc(100vw - 24px));
}

.toast {
  --toast-duration: 4000ms;
  --toast-accent: var(--login-accent);
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(420px, 100%);
  padding: 13px 16px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: rgba(9, 16, 12, 0.95);
  color: var(--login-text);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  animation: toast-life var(--toast-duration) ease forwards;
}

.toast.success {
  border-color: rgba(103, 245, 141, 0.34);
  color: #d9ffe1;
  --toast-accent: var(--login-accent);
}

.toast.info {
  border-color: rgba(122, 196, 255, 0.34);
  color: #d7edff;
  --toast-accent: #88cfff;
}

.toast.error {
  border-color: rgba(255, 127, 127, 0.34);
  color: #ffd4d4;
  --toast-accent: var(--login-danger);
}

.toast-progress {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.toast-progress svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
}

.toast-spinner-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 3;
}

.toast-spinner-bar {
  fill: none;
  stroke: var(--toast-accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  animation: toast-progress var(--toast-duration) linear forwards;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

@keyframes toast-progress {
  to {
    stroke-dashoffset: 100;
  }
}

@keyframes toast-life {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  12% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  86% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
}

@media (max-width: 640px) {
  .login-root {
    padding: 20px 14px;
  }

  .login-card {
    padding: 26px 20px 22px;
    border-radius: 24px;
  }

  .login-title {
    font-size: 1.42rem;
  }

  .login-copy {
    font-size: 0.92rem;
  }

  .login-button,
  .input-group input {
    min-height: 54px;
    border-radius: 16px;
  }

  .toast-container {
    top: 14px;
  }
}
