.auth {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + var(--space-8)) var(--space-5) calc(env(safe-area-inset-bottom, 0px) + var(--space-6));
  background: var(--bg);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--type-body);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2);
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  padding: var(--space-8) 0;
}

.login-title {
  margin: 0;
  font-size: var(--type-title);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.login-subtitle {
  margin: 0 0 var(--space-4);
  font-size: var(--type-body);
  line-height: 1.6;
  color: var(--gray-500);
}

.login-subtitle strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field span {
  font-size: var(--type-caption);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
  width: 100%;
  min-height: 54px;
  padding: 0 var(--space-4);
  border: 1px solid var(--gray-800);
  border-radius: var(--radius-lg);
  background: var(--gray-900);
  color: var(--text);
  font: inherit;
  font-size: var(--type-input);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.auth-form input::placeholder {
  color: var(--gray-600);
}

.auth-email {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 54px;
  padding: 0 var(--space-2) 0 var(--space-4);
  border: 1px dashed var(--gray-800);
  border-radius: var(--radius-lg);
  background: transparent;
}

.auth-email-lock {
  flex-shrink: 0;
  color: var(--gray-600);
}

.auth-form .auth-email input[type="email"] {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--gray-500);
  text-overflow: ellipsis;
  pointer-events: none;
}

.auth-form .auth-email input:focus {
  box-shadow: none;
}

.auth-email-change {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--type-label);
  font-weight: 600;
  text-decoration: none;
}

.auth-alt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 48px;
  margin-top: var(--space-1);
  padding: 0 var(--space-4);
  border: none;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--gray-400);
  font: inherit;
  font-size: var(--type-label);
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.auth-alt svg {
  width: 18px;
  height: 18px;
  color: var(--gray-500);
}

.auth-alt:hover,
.auth-alt:hover svg {
  color: var(--text);
}

.login-submit {
  width: 100%;
  min-height: 54px;
  margin-top: var(--space-2);
  padding: 0 var(--space-6);
  border: none;
  border-radius: var(--radius-lg);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font: inherit;
  font-size: var(--type-body);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.login-submit:active {
  transform: scale(0.98);
}

.auth-hint {
  margin: var(--space-2) 0 0;
  font-size: var(--type-label);
  line-height: 1.5;
  color: var(--gray-500);
  text-align: center;
}

.auth-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
}

.auth-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-3);
  color: var(--gray-500);
  font-size: var(--type-label);
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover {
  color: var(--text);
}

.auth-mail-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  order: -1;
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-4);
  border-radius: 20px;
  background: var(--gray-900);
  color: var(--text);
}

.auth .weight-entry-errors {
  margin: 0 0 var(--space-2);
}

.hero-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  padding: var(--space-4);
  overscroll-behavior: none;
  touch-action: none;
}

.hero-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-icon {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto var(--space-5);
  border-radius: 22px;
  box-shadow: 0 12px 32px color-mix(in srgb, var(--text) 18%, transparent);
  opacity: 0;
  animation: fadeInUp 1s ease-out forwards;
}

.hero-title {
  font-size: var(--type-display);
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  opacity: 0;
  animation: fadeInUp 1.2s ease-out forwards;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: min(100%, 320px);
  margin-top: 2rem;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.8s forwards;
}

.hero-tagline {
  max-width: 320px;
  margin: var(--space-3) 0 0;
  font-size: var(--type-body);
  line-height: 1.6;
  color: var(--gray-500);
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.5s forwards;
}

.hero-signup-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-800);
  background: var(--gray-900);
  color: var(--text);
  font-size: var(--type-body);
  font-weight: 600;
  text-decoration: none;
}

.hero-signin-button {
  margin-top: 0;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-lg);
  font-size: var(--type-body);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .hero-signin-button:hover {
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-300) 100%);
    color: var(--btn-primary-text);
    transform: translateY(-1px) scale(1.05);
  }

  .hero-signin-button:active {
    transform: translateY(0) scale(0.98);
  }
}

.hero-description {
  max-width: 500px;
  margin-top: var(--space-8);
  font-size: var(--type-body);
  color: var(--gray-500);
  line-height: 1.7;
  opacity: 0;
  animation: fadeInUp 1s ease-out 0.8s forwards;
}




@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInPulse {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes heroGlow {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--text) 40%, transparent);
  }
  40% {
    box-shadow: 0 0 0 12px color-mix(in srgb, var(--text) 0%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--text) 0%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-icon,
  .hero-title,
  .hero-tagline,
  .hero-actions,
  .hero-signin-button,
  .hero-description {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.auth-hint a {
  color: var(--gray-300);
  text-decoration: underline;
  text-underline-offset: 2px;
}
