/* Shared styles for forgot/reset/MFA auth flow pages */
:root {
  --primary: #8a4fff;
  --primary-dark: #6b3fcc;
  --primary-light: #b794ff;
  --text-primary: #1f2a3d;
  --text-secondary: #4b5870;
  --text-muted: #6b7280;
  --border-color: rgba(138, 79, 255, 0.2);
  --input-bg: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  background: radial-gradient(circle at 12% 8%, rgba(183, 148, 255, 0.2), transparent 28%),
              radial-gradient(circle at 88% 20%, rgba(138, 79, 255, 0.14), transparent 30%),
              linear-gradient(140deg, #f8fbff 0%, #f3ecff 100%);
  color: var(--text-primary);
}

.auth-flow-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem clamp(0.75rem, 2.4vw, 2rem);
  position: relative;
  z-index: 1;
}

/* Particle background (shared with login/signup feel) */
.particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle at 35% 35%, #f4e9ff 0%, #b684ff 45%, #8a4fff 100%);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 5px rgba(138, 79, 255, 0.6), 0 0 9px rgba(138, 79, 255, 0.28);
  animation: float linear infinite;
}

.particle::after {
  content: '';
  position: absolute;
  width: 34%;
  height: 34%;
  left: 26%;
  top: 24%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

@keyframes float {
  0% {
    transform: translateY(calc(100vh + 32px)) scale(0.45);
    opacity: 0;
  }
  10% {
    opacity: 0.92;
  }
  90% {
    opacity: 0.58;
  }
  100% {
    transform: translateY(-16vh) scale(1.35);
    opacity: 0;
  }
}

.auth-flow-card {
  width: 100%;
  max-width: 500px;
  background: linear-gradient(165deg, #ffffff 0%, #faf6ff 100%);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  box-shadow: 0 22px 50px rgba(95, 71, 149, 0.18), 0 0 0 1px rgba(138, 79, 255, 0.08);
  padding: clamp(1.25rem, 2.2vw, 2rem);
}

.auth-flow-head {
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-flow-brand {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  margin-bottom: 0.7rem;
}

.auth-flow-icon {
  width: clamp(52px, 7vw, 62px);
  height: clamp(52px, 7vw, 62px);
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 8px 24px rgba(138, 79, 255, 0.35);
}

.auth-flow-head h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  font-weight: 700;
}

.auth-flow-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
}

.alerts {
  margin-bottom: 1rem;
}

.alert-custom {
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font-size: 0.86rem;
  margin-bottom: 0.65rem;
  border: 1px solid transparent;
}

.alert-error {
  background: #fff2f2;
  color: #c53030;
  border-color: rgba(197, 48, 48, 0.25);
}

.alert-success {
  background: #f5efff;
  color: #6b3fcc;
  border-color: rgba(138, 79, 255, 0.26);
}

.alert-info {
  background: #eef5ff;
  color: #3f6cad;
  border-color: rgba(63, 108, 173, 0.22);
}

.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 600;
}

.input-wrap {
  position: relative;
}

.input-wrap .input-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: #8b91a3;
  font-size: 0.95rem;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.92rem;
  padding: 0.72rem 0.78rem 0.72rem 2.4rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}

.input-wrap input::placeholder {
  color: #9aa1b2;
}

.input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(138, 79, 255, 0.16);
  background: #ffffff;
}

.password-toggle {
  position: absolute;
  right: 0.68rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: #7f8798;
  padding: 0.2rem;
}

.password-toggle:hover {
  color: var(--primary-light);
}

.field-note {
  font-size: 0.74rem;
  color: #7f8798;
  margin-top: 0.35rem;
  min-height: 14px;
}

.btn-auth {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.btn-auth:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(138, 79, 255, 0.32);
}

.btn-auth:active {
  transform: translateY(0);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.84rem;
}

.back-link:hover {
  color: var(--primary-dark);
}

.otp-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(clamp(34px, 8.5vw, 42px), 1fr));
  gap: clamp(0.26rem, 1vw, 0.5rem);
}

.otp-row .otp-digit {
  width: 100%;
  height: clamp(44px, 9.2vw, 52px);
  border-radius: 11px;
  border: 1.5px solid var(--border-color);
  background: var(--input-bg);
  color: var(--text-primary);
  text-align: center;
  font-size: clamp(1rem, 3.3vw, 1.25rem);
  font-weight: 700;
  outline: none;
}

.otp-row .otp-digit:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(138, 79, 255, 0.2);
}

.strength-meter {
  margin-top: 0.45rem;
  height: 4px;
  border-radius: 999px;
  background: rgba(138, 79, 255, 0.15);
  overflow: hidden;
}

.strength-meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width .25s, background-color .25s;
}

@media (max-width: 576px) {
  .auth-flow-card {
    border-radius: 16px;
    padding: 1.1rem;
  }

  .otp-row {
    grid-template-columns: repeat(6, 1fr);
    gap: 0.38rem;
  }

  .otp-row .otp-digit {
    height: 48px;
    font-size: 1.1rem;
  }
}

@media (max-width: 420px) {
  .auth-flow-wrap {
    padding: 0.9rem 0.55rem;
  }

  .auth-flow-card {
    border-radius: 14px;
    padding: 1rem;
  }

  .otp-row {
    gap: 0.3rem;
  }

  .otp-row .otp-digit {
    height: 44px;
    font-size: 1rem;
  }
}
