:root {
  --bg: #0b0b10;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.62);
  --accent-1: rgba(132, 90, 255, 0.30);
  --accent-2: rgba(255, 153, 102, 0.24);
  --accent-3: rgba(88, 166, 255, 0.16);
  --card: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.10);
  --field: rgba(255, 255, 255, 0.04);
  --field-border: rgba(255, 255, 255, 0.12);
  --button: rgba(132, 90, 255, 0.52);
  --button-hover: rgba(132, 90, 255, 0.64);
  --success: #7ef7a6;
  --error: #ff9f9f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 30%, var(--accent-1), transparent 40%),
    radial-gradient(circle at 80% 70%, var(--accent-2), transparent 40%),
    var(--bg);
  color: var(--text);
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  min-height: 100dvh;
  overflow: hidden;
}

.page {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 28px 20px 24px;
}

.content {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 0;
}

.footer {
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

.footer a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer a:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.auth-page .brand {
  text-align: center;
  margin-top: 4px;
}

.auth-page .brand-title {
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
}

.auth-page .brand-subtitle {
  margin-top: 6px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.50);
  letter-spacing: 0.06em;
}

.auth-page .content {
  animation: fade 0.9s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

.auth-page .card {
  width: 100%;
  max-width: 560px;
  padding: 28px 24px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.auth-page h1 {
  margin: 0 0 12px 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.auth-page .sub {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
}

.confirm-page .sub {
  margin-top: 14px;
}

.confirm-page .spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 20px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.92);
  animation: spin 0.9s linear infinite;
}

.confirm-page .success .spinner,
.confirm-page .error .spinner {
  display: none;
}

.reset-password-page .sub,
.reset-success-page .sub {
  margin-bottom: 22px;
}

.reset-password-page form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
  text-align: left;
}

.reset-password-page .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reset-password-page .field label {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.84);
}

.reset-password-page .password-row {
  position: relative;
}

.reset-password-page .field input {
  width: 100%;
  padding: 13px 48px 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--field-border);
  background: var(--field);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.reset-password-page .field input::placeholder {
  color: rgba(255, 255, 255, 0.34);
}

.reset-password-page .field input:focus {
  border-color: rgba(132, 90, 255, 0.58);
  box-shadow: 0 0 0 4px rgba(132, 90, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
}

.reset-password-page .field input:disabled {
  opacity: 0.55;
  cursor: default;
}

.reset-password-page .toggle-password {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  margin: 0;
  border-radius: 8px;
}

.reset-password-page .toggle-password:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.reset-password-page .toggle-password:disabled {
  opacity: 0.45;
  cursor: default;
}

.reset-password-page button[type="submit"],
.reset-success-page .button {
  display: inline-block;
  padding: 13px 18px;
  border: none;
  border-radius: 12px;
  background: var(--button);
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 160ms ease, opacity 160ms ease, transform 120ms ease;
}

.reset-password-page button[type="submit"] {
  margin-top: 10px;
  padding: 13px 14px;
  cursor: pointer;
}

.reset-password-page button[type="submit"]:hover:not(:disabled),
.reset-success-page .button:hover {
  background: var(--button-hover);
}

.reset-password-page button[type="submit"]:active:not(:disabled),
.reset-success-page .button:active {
  transform: translateY(1px);
}

.reset-password-page button[type="submit"]:disabled {
  background: rgba(255, 255, 255, 0.2);
  cursor: default;
}

.reset-password-page .message {
  margin-top: 16px;
  min-height: 22px;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

.reset-password-page .message.error {
  color: var(--error);
}

.reset-password-page .message.success {
  color: var(--success);
}

.reset-password-page .validation-status {
  display: none;
  margin-bottom: 20px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.98rem;
  line-height: 1.5;
}

.reset-password-page .card.validating .validation-status {
  display: flex;
}

.reset-password-page .validation-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: rgba(255, 255, 255, 0.94);
  animation: spin 0.9s linear infinite;
  flex: 0 0 auto;
}

.reset-password-page .card.invalid-link,
.reset-password-page .card.validating {
  padding-bottom: 24px;
}

.reset-password-page .card.invalid-link .sub,
.reset-password-page .card.validating .sub {
  margin-bottom: 0;
}

.reset-password-page .card.invalid-link .message,
.reset-password-page .card.validating .message,
.reset-password-page .card.invalid-link form,
.reset-password-page .card.validating form {
  display: none;
}

.reset-success-page .button-wrap {
  margin-top: 10px;
}

.reset-success-page .button {
  min-width: 220px;
}

.landing-page {
  position: relative;
}

.landing-page .page {
  position: relative;
  z-index: 1;
}

.landing-page .brand {
  text-align: center;
  margin-top: 4px;
  animation: fadeUp 0.9s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

.landing-page .brand-title {
  font-size: clamp(1.05rem, 1.8vw, 1.4rem);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
}

.landing-page .brand-subtitle {
  margin-top: 6px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.50);
  letter-spacing: 0.06em;
}

.landing-page .content {
  animation: fadeUp 1s ease forwards;
  animation-delay: 0.12s;
  opacity: 0;
  transform: translateY(12px);
}

.landing-page .inner {
  width: 100%;
  max-width: 560px;
  padding: 28px 24px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.landing-page h1 {
  margin: 0 0 12px 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.landing-page .sub {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  animation: fadeUp 1s ease forwards;
  animation-delay: 0.22s;
  opacity: 0;
  transform: translateY(10px);
}

.landing-page .footer {
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  animation: fadeUp 1s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
  transform: translateY(10px);
}

.landing-page .footer a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.landing-page .footer a:hover {
  border-color: rgba(255, 255, 255, 0.5);
}

.landing-page .orb {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(28px);
  opacity: 0.8;
  animation: drift 16s ease-in-out infinite;
}

.landing-page .orb-1 {
  width: 220px;
  height: 220px;
  top: 10%;
  left: -70px;
  background: rgba(132, 90, 255, 0.16);
}

.landing-page .orb-2 {
  width: 260px;
  height: 260px;
  right: -90px;
  bottom: 12%;
  background: rgba(255, 153, 102, 0.13);
  animation-delay: -6s;
}

.landing-page .orb-3 {
  width: 180px;
  height: 180px;
  left: 55%;
  bottom: 20%;
  background: var(--accent-3);
  animation-delay: -10s;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -18px, 0) scale(1.05);
  }
}

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

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

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .landing-page .orb {
    animation: none;
  }
}
