/* Authentication Pages — Terminal Noir aesthetic
 * Dark background, cyan accents, Space Mono typography.
 * Matches the landing page design system. */

/* ── Auth Container ── */
.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

/* ── Auth Card ── */
.auth__card {
  background: #0f1117;
  border: 1px solid #1e2030;
  border-radius: 6px;
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: auth-appear 0.5s ease 0.1s forwards;
}

@keyframes auth-appear {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Header ── */
.auth__header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth__logo {
  font-family: 'Space Mono', monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: #22d3ee;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.auth__title {
  font-family: 'Space Mono', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  color: #e2e4ed;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.auth__subtitle {
  color: #6b7089;
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.5;
}

/* ── Form ── */
.auth__form {
  margin-bottom: 1.5rem;
}

.auth__field {
  margin-bottom: 1.25rem;
}

.auth__label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #6b7089;
  letter-spacing: 0.03em;
}

.auth__input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: #e2e4ed;
  background: #161822;
  border: 1px solid #1e2030;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth__input:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.auth__input:hover:not(:focus) {
  border-color: #2a2d42;
}

.auth__input::placeholder {
  color: #3d4059;
}

.auth__input--error {
  border-color: #f87171;
}

.auth__input--error:focus {
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.1);
}

/* ── Buttons ── */
.auth__button {
  width: 100%;
  padding: 0.875rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.875rem;
  font-weight: 700;
  color: #08090d;
  background: #22d3ee;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth__button:hover {
  background: #67e8f9;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.15);
  transform: translateY(-1px);
}

.auth__button:active {
  transform: translateY(0);
}

.auth__button--secondary {
  background: transparent;
  color: #6b7089;
  border: 1px solid #1e2030;
  margin-top: 0.5rem;
}

.auth__button--secondary:hover {
  color: #e2e4ed;
  border-color: #6b7089;
  background: transparent;
  box-shadow: none;
}

/* ── Inline Note ── */
.auth__inline-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #535678;
}

/* ── Divider ── */
.auth__divider {
  text-align: center;
  margin: 2rem 0;
  position: relative;
}

.auth__divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #1e2030;
}

.auth__divider-text {
  background: #0f1117;
  padding: 0 1rem;
  color: #535678;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  position: relative;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Social / OAuth ── */
.auth__social {
  margin-bottom: 1rem;
}

.auth__social-button {
  width: 100%;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #161822;
  border: 1px solid #1e2030;
  border-radius: 4px;
  color: #e2e4ed;
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.auth__social-button:hover {
  background: #1e2030;
  border-color: #22d3ee;
}

.auth__social-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth__social-button--github .auth__social-icon::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 18px;
  background: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 0C5.37 0 0 5.37 0 12c0 5.3 3.438 9.8 8.205 11.387.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 21.795 24 17.295 24 12c0-6.63-5.37-12-12-12'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
}

.auth__social-note {
  text-align: center;
  font-size: 0.75rem;
  color: #535678;
  margin-bottom: 1rem;
}

/* ── Links ── */
.auth__links {
  text-align: center;
  margin-top: 1rem;
}

.auth__link {
  color: #22d3ee;
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.auth__link:hover {
  color: #67e8f9;
  text-decoration: none;
}

.auth__links-divider {
  color: #1e2030;
  margin: 0 0.75rem;
}

/* ── Messages ── */
.auth__message {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0;
  animation: auth-appear 0.3s ease forwards;
}

.auth__message--error {
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.auth__message--success {
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.auth__message--warning {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

/* ── Footer ── */
.auth__footer {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid #1e2030;
  margin-top: 1.5rem;
}

.auth__footer-text {
  color: #535678;
  font-size: 0.85rem;
  margin: 0;
}

/* ── Password Strength ── */
.auth__password-strength {
  margin-top: 0.5rem;
  height: 3px;
  border-radius: 2px;
  background: #1e2030;
  overflow: hidden;
}

.auth__password-strength-bar {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
  border-radius: 2px;
}

.auth__password-strength-bar--weak {
  width: 33%;
  background: #f87171;
}

.auth__password-strength-bar--medium {
  width: 66%;
  background: #fbbf24;
}

.auth__password-strength-bar--strong {
  width: 100%;
  background: #34d399;
}

/* ── Loading State ── */
.auth__button--loading {
  color: transparent;
  pointer-events: none;
}

.auth__button--loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin-left: -9px;
  margin-top: -9px;
  border: 2px solid #08090d;
  border-radius: 50%;
  border-top-color: transparent;
  animation: auth-spinner 0.8s linear infinite;
}

@keyframes auth-spinner {
  to { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .auth {
    padding: 1rem;
    align-items: flex-start;
    padding-top: 3rem;
  }

  .auth__card {
    padding: 2rem 1.5rem;
  }

  .auth__title {
    font-size: 1.25rem;
  }

  .auth__social {
    flex-direction: column;
  }

  .auth__links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .auth__links-divider {
    display: none;
  }
}

/* ── Accessibility ── */
.auth__input:focus-visible,
.auth__button:focus-visible,
.auth__link:focus-visible,
.auth__social-button:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 2px;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .auth__card,
  .auth__message {
    animation: none;
    opacity: 1;
  }

  .auth__button,
  .auth__input,
  .auth__social-button,
  .auth__password-strength-bar {
    transition: none;
  }
}
