/* ═══════════════════════════════════════════════
   TwinShip Auth Theme (shared)
   Matches the upgraded Login page: dark surface,
   lime accent, Outfit typography.
   Used by: ForgotPassword, ForgotPasswordConfirmation,
            ResetPassword, ResetPasswordConfirmation
   ═══════════════════════════════════════════════ */
:root {
  --lime: #C4FF61;
  --lime-10: rgba(196, 255, 97, 0.10);
  --lime-15: rgba(196, 255, 97, 0.15);
  --lime-25: rgba(196, 255, 97, 0.25);
  --lime-40: rgba(196, 255, 97, 0.40);
  --black: #000000;
  --near-black: #08080a;
  --dark: #111113;
  --dark-2: #19191c;
  --dark-3: #222226;
  --gray: #55555e;
  --muted: #888892;
  --faint: #aaaab2;
  --white: #ffffff;
  --font: 'Outfit', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --error: #ef4444;
  --error-10: rgba(239, 68, 68, 0.1);
  --success: #22c55e;
  --success-10: rgba(34, 197, 94, 0.1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body.auth-theme {
  font-family: var(--font);
  background: var(--near-black);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.auth-theme ::selection { background: var(--lime); color: var(--black); }
.auth-theme a { color: inherit; text-decoration: none; }

/* Subtle grain */
.auth-theme::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Subtle grid background */
.auth-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(196, 255, 97, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196, 255, 97, 0.02) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.5;
  pointer-events: none;
}

/* Ambient glow */
.auth-glow {
  position: fixed;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 255, 97, 0.08) 0%, transparent 60%);
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  animation: auth-breathe 9s ease-in-out infinite;
}

@keyframes auth-breathe {
  0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.6; }
  50% { transform: translateX(-50%) scale(1.12); opacity: 0.9; }
}

/* Card */
.auth-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  background: var(--dark);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  padding: 44px 40px 36px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

/* Brand */
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}

.auth-brand-title {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--white);
  line-height: 1;
}

.auth-brand-sub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.auth-brand-sub span {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

/* Header */
.auth-header { margin-bottom: 28px; text-align: center; }

.auth-eyebrow {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--lime);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.auth-eyebrow::before,
.auth-eyebrow::after {
  content: '';
  width: 20px;
  height: 1.5px;
  background: var(--lime);
  opacity: 0.5;
}

.auth-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--white);
  margin-bottom: 10px;
}

.auth-subtitle {
  font-size: 0.9rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
}

/* Icon badge (for confirmation pages) */
.auth-badge {
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lime-10);
  border: 1px solid var(--lime-25);
}

.auth-badge svg {
  width: 34px;
  height: 34px;
  color: var(--lime);
}

.auth-badge.is-error {
  background: var(--error-10);
  border-color: rgba(239, 68, 68, 0.25);
}

.auth-badge.is-error svg { color: var(--error); }

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-input-group { position: relative; }

.auth-label {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 8px;
}

.auth-input {
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--white);
  transition: all 0.3s ease;
}

.auth-input::placeholder { color: rgba(255, 255, 255, 0.25); }

.auth-input:focus {
  outline: none;
  border-color: var(--lime);
  background: rgba(196, 255, 97, 0.03);
  box-shadow: 0 0 0 3px rgba(196, 255, 97, 0.08);
}

.auth-input:hover:not(:focus) { border-color: rgba(255, 255, 255, 0.15); }

/* Password wrapper */
.auth-password-wrapper { position: relative; }
.auth-password-wrapper .auth-input { padding-right: 48px; }

.auth-password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.auth-password-toggle:hover { color: var(--lime); }
.auth-password-toggle svg { width: 20px; height: 20px; }

/* Submit button */
.auth-button {
  width: 100%;
  padding: 16px 32px;
  background: var(--lime);
  color: var(--black);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.35s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.auth-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(196, 255, 97, 0.35);
}

.auth-button:disabled { opacity: 0.7; cursor: not-allowed; }

.auth-button.is-outline {
  background: transparent;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.auth-button.is-outline:hover:not(:disabled) {
  border-color: var(--lime);
  color: var(--lime);
  box-shadow: none;
}

.auth-button .auth-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.2);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: auth-spin 0.8s linear infinite;
  display: none;
}

.auth-button.loading .auth-spinner { display: block; }
.auth-button.loading .auth-button-text { display: none; }

@keyframes auth-spin { to { transform: rotate(360deg); } }

/* Validation */
.auth-validation-error {
  padding: 14px 18px;
  background: var(--error-10);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.auth-validation-error svg {
  width: 18px;
  height: 18px;
  color: var(--error);
  flex-shrink: 0;
  margin-top: 1px;
}

.auth-validation-error div,
.auth-validation-error ul {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--error);
  line-height: 1.5;
}

.auth-validation-error ul { margin: 0; padding-left: 16px; }

.auth-field-error {
  font-size: 0.72rem;
  color: var(--error);
  margin-top: 6px;
  display: block;
}

/* Callout box (confirmation instructions) */
.auth-note {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.6);
  text-align: left;
}

.auth-note strong { color: var(--white); font-weight: 600; }

/* Footer / links */
.auth-footer {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.auth-link-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--lime);
  transition: opacity 0.2s ease;
}

.auth-link-primary:hover { opacity: 0.8; }

.auth-link {
  font-size: 0.78rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s ease;
}

.auth-link:hover { color: rgba(255, 255, 255, 0.7); }

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

/* Back to home */
.auth-back-link {
  position: fixed;
  top: 28px;
  left: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.4);
  transition: color 0.2s ease;
  z-index: 10;
}

.auth-back-link:hover { color: var(--white); }
.auth-back-link svg { width: 16px; height: 16px; }

.auth-version {
  margin-top: 24px;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.2);
}

/* Animations */
.auth-fade-in {
  opacity: 0;
  transform: translateY(16px);
  animation: auth-fade-in 0.6s var(--ease) forwards;
}

.auth-fade-in-1 { animation-delay: 0.08s; }
.auth-fade-in-2 { animation-delay: 0.16s; }
.auth-fade-in-3 { animation-delay: 0.24s; }

@keyframes auth-fade-in {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .auth-card { padding: 34px 24px 28px; }
  .auth-title { font-size: 1.45rem; }
  .auth-back-link { top: 16px; left: 16px; }
}
