/* ============================================
   ASTROMANTIKA – Auth Pages Premium Styles
   Login, Register, Password Reset, Verify
   ============================================ */

/* ---- Auth Page Layout ---- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
  position: relative;
}

/* Floating cosmic particles */
.auth-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(124,92,255,0.4), transparent),
    radial-gradient(2px 2px at 80% 10%, rgba(212,160,74,0.3), transparent),
    radial-gradient(1.5px 1.5px at 60% 70%, rgba(34,211,238,0.35), transparent),
    radial-gradient(1px 1px at 40% 90%, rgba(124,92,255,0.25), transparent),
    radial-gradient(2px 2px at 10% 60%, rgba(212,160,74,0.2), transparent),
    radial-gradient(1.5px 1.5px at 90% 50%, rgba(34,211,238,0.2), transparent),
    radial-gradient(1px 1px at 50% 20%, rgba(255,255,255,0.15), transparent),
    radial-gradient(1.5px 1.5px at 70% 85%, rgba(124,92,255,0.2), transparent);
  animation: auth-stars-drift 30s ease-in-out infinite alternate;
}

@keyframes auth-stars-drift {
  0% { transform: translate(0, 0) scale(1); opacity: 0.8; }
  50% { transform: translate(-10px, 5px) scale(1.02); opacity: 1; }
  100% { transform: translate(5px, -8px) scale(0.98); opacity: 0.85; }
}

/* ---- Auth Card ---- */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  animation: auth-card-enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes auth-card-enter {
  0% { opacity: 0; transform: translateY(20px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card-inner {
  background: rgba(15, 12, 30, 0.82);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(124, 92, 255, 0.18);
  border-radius: 20px;
  padding: 40px 36px 36px;
  box-shadow:
    0 0 0 1px rgba(124, 92, 255, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 80px -20px rgba(124, 92, 255, 0.15);
  position: relative;
  overflow: hidden;
}

/* Subtle top glow line */
.auth-card-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--brand, #7C5CFF) 30%, var(--gold, #D4A04A) 70%, transparent);
  border-radius: 0 0 4px 4px;
  opacity: 0.6;
}

/* ---- Brand Section ---- */
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-brand-logo {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  object-fit: contain;
  margin-bottom: 14px;
  filter: drop-shadow(0 6px 20px rgba(124, 92, 255, 0.35));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.auth-brand-logo:hover {
  transform: scale(1.08);
  filter: drop-shadow(0 8px 28px rgba(124, 92, 255, 0.5));
}

.auth-brand-name {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text, rgba(255,255,255,0.95));
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted, rgba(255,255,255,0.65));
  margin-top: 6px;
  line-height: 1.4;
}

/* ---- Alerts ---- */
.auth-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  margin-bottom: 0;
}

.auth-alert.visible {
  opacity: 1;
  max-height: 80px;
  margin-bottom: 16px;
}

.auth-alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.auth-alert-error i { color: #ef4444; }

.auth-alert-success {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.25);
  color: #4ade80;
}

.auth-alert-success i { color: #22c55e; }

.auth-alert-info {
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: #67e8f9;
}

.auth-alert-info i { color: #22d3ee; }

/* ---- Social Login ---- */
.auth-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  overflow: hidden;
}

.auth-social-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: inherit;
}

.auth-social-btn:hover::before {
  opacity: 1;
}

.auth-social-google {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, white);
}

.auth-social-google::before {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.12), rgba(234, 67, 53, 0.08));
}

.auth-social-google:hover {
  border-color: rgba(66, 133, 244, 0.4);
  box-shadow: 0 4px 16px rgba(66, 133, 244, 0.15);
  transform: translateY(-1px);
}

.auth-social-meta {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, white);
}

.auth-social-meta::before {
  background: linear-gradient(135deg, rgba(24, 119, 242, 0.12), rgba(66, 103, 178, 0.08));
}

.auth-social-meta:hover {
  border-color: rgba(24, 119, 242, 0.4);
  box-shadow: 0 4px 16px rgba(24, 119, 242, 0.15);
  transform: translateY(-1px);
}

/* ---- Divider ---- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.auth-divider-text {
  font-size: 12px;
  color: var(--text-subtle, rgba(255,255,255,0.45));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- Form Fields ---- */
.auth-field {
  margin-bottom: 16px;
}

.auth-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, rgba(255,255,255,0.78));
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.auth-input-wrap {
  position: relative;
}

.auth-input {
  width: 100%;
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text, white);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.25s ease;
  outline: none;
}

.auth-input::placeholder {
  color: var(--text-subtle, rgba(255,255,255,0.35));
}

.auth-input:focus {
  border-color: var(--brand, #7C5CFF);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15), 0 0 20px -5px rgba(124, 92, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
}

.auth-input:focus::placeholder {
  opacity: 0.5;
}

/* Input with icon (wrap) */
.auth-input-wrap .auth-input {
  padding-right: 48px;
}

/* Validation states */
.auth-input.valid {
  border-color: rgba(74, 222, 128, 0.5);
}

.auth-input.invalid {
  border-color: rgba(239, 68, 68, 0.5);
}

.auth-field-hint {
  font-size: 12px;
  color: var(--text-subtle, rgba(255,255,255,0.45));
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.auth-field-hint.error {
  color: #f87171;
}

.auth-field-hint.success {
  color: #4ade80;
}

/* ---- Password Toggle ---- */
.auth-pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-subtle, rgba(255,255,255,0.45));
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 14px;
}

.auth-pw-toggle:hover {
  color: var(--text, white);
  background: rgba(255, 255, 255, 0.08);
}

/* ---- Password Strength ---- */
.pw-strength {
  margin-top: 10px;
  animation: pw-strength-enter 0.3s ease;
}

@keyframes pw-strength-enter {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.pw-strength-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}

.pw-strength-seg {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  transition: all 0.35s ease;
}

.pw-strength-seg.active.weak      { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
.pw-strength-seg.active.medium    { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
.pw-strength-seg.active.strong    { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.4); }
.pw-strength-seg.active.very-strong { background: #06b6d4; box-shadow: 0 0 6px rgba(6, 182, 212, 0.4); }

.pw-strength-text {
  font-size: 12px;
  font-weight: 600;
  transition: color 0.3s ease;
}

.pw-strength-text.weak       { color: #ef4444; }
.pw-strength-text.medium     { color: #f59e0b; }
.pw-strength-text.strong     { color: #22c55e; }
.pw-strength-text.very-strong { color: #06b6d4; }

/* ---- Password Requirements ---- */
.pw-requirements {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pw-req {
  font-size: 12px;
  color: var(--text-subtle, rgba(255,255,255,0.45));
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.25s ease;
}

.pw-req i {
  font-size: 10px;
  width: 14px;
  text-align: center;
  transition: all 0.25s ease;
}

.pw-req.met {
  color: #4ade80;
}

.pw-req.met i {
  color: #22c55e;
}

/* ---- Forgot Password Link ---- */
.auth-forgot {
  display: block;
  text-align: right;
  font-size: 13px;
  color: var(--brand-light, #9B7AFF);
  text-decoration: none;
  margin-bottom: 16px;
  margin-top: -4px;
  transition: color 0.2s ease;
}

.auth-forgot:hover {
  color: var(--text, white);
}

/* ---- Submit Button ---- */
.auth-submit {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--brand, #7C5CFF), var(--brand-dark, #5A3CD4));
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.auth-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35), 0 0 40px rgba(124, 92, 255, 0.15);
}

.auth-submit:hover:not(:disabled)::before {
  opacity: 1;
}

.auth-submit:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading state */
.auth-submit.loading {
  color: transparent;
  pointer-events: none;
}

.auth-submit.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: auth-spin 0.65s linear infinite;
}

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

/* Success state */
.auth-submit.success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  pointer-events: none;
}

.auth-submit.success::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
}

/* ---- Terms Checkbox ---- */
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted, rgba(255,255,255,0.65));
  line-height: 1.4;
}

.auth-terms input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  margin-top: 2px;
  transition: all 0.25s ease;
  position: relative;
}

.auth-terms input[type="checkbox"]:checked {
  background: var(--brand, #7C5CFF);
  border-color: var(--brand, #7C5CFF);
}

.auth-terms input[type="checkbox"]:checked::after {
  content: '\2713';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.auth-terms a {
  color: var(--brand-light, #9B7AFF);
  text-decoration: none;
  transition: color 0.2s ease;
}

.auth-terms a:hover {
  color: white;
  text-decoration: underline;
}

/* ---- Footer Link ---- */
.auth-footer {
  text-align: center;
  font-size: 14px;
  color: var(--text-muted, rgba(255,255,255,0.65));
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-footer a {
  color: var(--brand-light, #9B7AFF);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-footer a:hover {
  color: white;
}

/* ---- Trust Badges ---- */
.auth-trust {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
}

.auth-trust-item {
  font-size: 11px;
  color: var(--text-subtle, rgba(255,255,255,0.45));
  display: flex;
  align-items: center;
  gap: 5px;
}

.auth-trust-item i {
  font-size: 10px;
  color: var(--gold, #D4A04A);
}

/* ---- Back Link ---- */
.auth-back {
  text-align: center;
  margin-top: 20px;
}

.auth-back a {
  font-size: 13px;
  color: var(--text-subtle, rgba(255,255,255,0.45));
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
}

.auth-back a:hover {
  color: var(--text, white);
}

/* ---- Email Verification Banner ---- */
.auth-verify-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--accent-light, #67e8f9);
}

.auth-verify-banner i {
  font-size: 16px;
  color: var(--accent, #22d3ee);
}

.auth-verify-banner a {
  color: white;
  font-weight: 600;
  text-decoration: underline;
  margin-left: auto;
  white-space: nowrap;
}

/* ---- Password Reset Success Illustration ---- */
.auth-success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  animation: auth-success-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.auth-success-icon.email-icon {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(124, 92, 255, 0.15));
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--accent, #22d3ee);
}

.auth-success-icon.check-icon {
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(34, 197, 94, 0.15));
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #4ade80;
}

.auth-success-icon.lock-icon {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.15), rgba(212, 160, 74, 0.15));
  border: 1px solid rgba(124, 92, 255, 0.3);
  color: var(--brand, #7C5CFF);
}

@keyframes auth-success-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* ---- Timer / Countdown ---- */
.auth-timer {
  font-size: 13px;
  color: var(--text-subtle, rgba(255,255,255,0.45));
  text-align: center;
  margin-top: 12px;
}

.auth-timer strong {
  color: var(--brand-light, #9B7AFF);
}

/* ---- Resend Link ---- */
.auth-resend {
  font-size: 13px;
  color: var(--text-subtle, rgba(255,255,255,0.45));
  text-align: center;
  margin-top: 12px;
}

.auth-resend button {
  background: none;
  border: none;
  color: var(--brand-light, #9B7AFF);
  font-family: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.auth-resend button:hover {
  color: white;
}

.auth-resend button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- Step Indicator ---- */
.auth-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-step {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.4s ease;
}

.auth-step.active {
  background: var(--brand, #7C5CFF);
  box-shadow: 0 0 8px rgba(124, 92, 255, 0.4);
}

.auth-step.completed {
  background: var(--gold, #D4A04A);
  box-shadow: 0 0 8px rgba(212, 160, 74, 0.4);
}

/* ---- Inline Email Display ---- */
.auth-email-display {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand-light, #9B7AFF);
  text-align: center;
  word-break: break-all;
  margin-bottom: 6px;
}

/* ---- Description Text ---- */
.auth-desc {
  font-size: 14px;
  color: var(--text-muted, rgba(255,255,255,0.65));
  text-align: center;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .auth-card-inner {
    padding: 28px 20px 24px;
    border-radius: 16px;
  }

  .auth-brand-logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
  }

  .auth-brand-name {
    font-size: 20px;
  }

  .auth-social-btn {
    padding: 12px 16px;
    font-size: 13px;
  }

  .auth-trust {
    gap: 10px;
  }
}

/* ---- Transitions for page switches ---- */
.auth-fade-in {
  animation: auth-fade-in 0.4s ease forwards;
}

@keyframes auth-fade-in {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.auth-slide-up {
  animation: auth-slide-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes auth-slide-up {
  0% { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}
