/* ============================================
   HPX Login/Reset — CSS
   Source of truth: mockup login-redesign.html
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #0a0a0d;
  color: #ece8e0;
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ============================================
   BACKGROUND LAYER — orbs + CSS particles
   ============================================ */
.bg-layer {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #C9A84C, transparent);
  top: -10%; right: -10%;
  animation: orb-float 12s ease-in-out infinite alternate;
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #8B7535, transparent);
  bottom: -15%; left: -10%;
  animation: orb-float 15s ease-in-out 2s infinite alternate-reverse;
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, #E2C97E, transparent);
  top: 40%; left: 50%;
  opacity: 0.08;
  animation: orb-float 10s ease-in-out 4s infinite alternate;
}

/* CSS Particles */
.particle-sim {
  position: absolute; border-radius: 50%;
  background: #C9A84C; opacity: 0.3;
}
.particle-sim:nth-child(4)  { width: 5px; height: 5px; top: 20%; left: 15%; animation: p-drift 3s ease-in-out infinite; }
.particle-sim:nth-child(5)  { width: 4px; height: 4px; top: 60%; left: 80%; animation: p-drift 4s ease-in-out 0.3s infinite; }
.particle-sim:nth-child(6)  { width: 6px; height: 6px; top: 35%; left: 70%; animation: p-drift 3.5s ease-in-out 0.6s infinite; }
.particle-sim:nth-child(7)  { width: 4px; height: 4px; top: 75%; left: 30%; animation: p-drift 3s ease-in-out 0.9s infinite; }
.particle-sim:nth-child(8)  { width: 5px; height: 5px; top: 15%; left: 55%; animation: p-drift 4.5s ease-in-out 0.2s infinite; }
.particle-sim:nth-child(9)  { width: 4px; height: 4px; top: 50%; left: 10%; animation: p-drift 3s ease-in-out 1.2s infinite; }
.particle-sim:nth-child(10) { width: 6px; height: 6px; top: 85%; left: 60%; animation: p-drift 3.5s ease-in-out 0.1s infinite; }
.particle-sim:nth-child(11) { width: 5px; height: 5px; top: 40%; left: 90%; animation: p-drift 4s ease-in-out 0.7s infinite; }
.particle-sim:nth-child(12) { width: 4px; height: 4px; top: 10%; left: 40%; animation: p-drift 3s ease-in-out 1.5s infinite; }
.particle-sim:nth-child(13) { width: 6px; height: 6px; top: 65%; left: 5%;  animation: p-drift 3.5s ease-in-out 0.4s infinite; }
.particle-sim:nth-child(14) { width: 5px; height: 5px; top: 25%; left: 92%; animation: p-drift 4s ease-in-out 0.8s infinite; }
.particle-sim:nth-child(15) { width: 4px; height: 4px; top: 80%; left: 45%; animation: p-drift 3s ease-in-out 1.1s infinite; }
.particle-sim:nth-child(16) { width: 7px; height: 7px; top: 45%; left: 25%; animation: p-drift 3.5s ease-in-out 0.5s infinite; }
.particle-sim:nth-child(17) { width: 5px; height: 5px; top: 55%; left: 65%; animation: p-drift 4s ease-in-out 1.3s infinite; }
.particle-sim:nth-child(18) { width: 4px; height: 4px; top: 90%; left: 85%; animation: p-drift 3s ease-in-out 0.2s infinite; }
.particle-sim:nth-child(19) { width: 6px; height: 6px; top: 8%;  left: 75%; animation: p-drift 3.5s ease-in-out 1.0s infinite; }
.particle-sim:nth-child(20) { width: 5px; height: 5px; top: 70%; left: 50%; animation: p-drift 4s ease-in-out 0.6s infinite; }
.particle-sim:nth-child(21) { width: 4px; height: 4px; top: 30%; left: 8%;  animation: p-drift 3s ease-in-out 1.4s infinite; }
.particle-sim:nth-child(22) { width: 7px; height: 7px; top: 48%; left: 48%; animation: p-drift 3.5s ease-in-out 0.3s infinite; }
.particle-sim:nth-child(23) { width: 5px; height: 5px; top: 95%; left: 20%; animation: p-drift 4s ease-in-out 0.9s infinite; }

@keyframes orb-float {
  0% { transform: translate(0, 0); }
  100% { transform: translate(30px, -20px); }
}
@keyframes p-drift {
  0% { transform: translate(0, 0); opacity: 0.4; }
  20% { transform: translate(25px, -15px); opacity: 0.6; }
  40% { transform: translate(-15px, -35px); opacity: 0.5; }
  60% { transform: translate(30px, -20px); opacity: 0.7; }
  80% { transform: translate(-20px, -10px); opacity: 0.5; }
  100% { transform: translate(0, 0); opacity: 0.4; }
}

/* ============================================
   LOGIN CONTAINER (wrapper for responsive)
   ============================================ */
.login-container {
  position: relative; z-index: 1;
}

/* ============================================
   LOGIN CARD — exact mockup values
   ============================================ */
.login-card {
  position: relative; z-index: 10;
  width: 420px;
  background: rgba(17, 17, 20, 0.7);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(201, 168, 76, 0.15);
  border-radius: 20px;
  padding: 48px 40px;
  box-shadow:
    0 24px 48px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(201, 168, 76, 0.08);
  animation: card-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

/* ============================================
   HEADER
   ============================================ */
.login-header {
  text-align: center;
  margin-bottom: 36px;
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.login-title {
  font-family: 'Outfit', sans-serif;
  font-size: 32px; font-weight: 800; letter-spacing: 6px;
  color: #C9A84C;
  animation: text-in 0.5s ease-out 0.7s both;
}
.login-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 400;
  letter-spacing: 4px; text-transform: uppercase;
  color: #9a9590;
  margin-top: 6px;
  animation: text-in 0.4s ease-out 0.85s both;
}

/* ============================================
   FORM — exact mockup values
   ============================================ */
.form-group {
  margin-bottom: 20px;
  position: relative;
  animation: field-in 0.4s ease-out both;
}
.form-group:nth-child(1) { animation-delay: 0.9s; }
.form-group:nth-child(2) { animation-delay: 1.0s; }

.form-label {
  font-size: 11px; font-weight: 500;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: #605c55;
  margin-bottom: 8px;
  display: block;
  transition: color 0.3s;
}
.form-group:focus-within .form-label {
  color: #C9A84C;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(10, 10, 13, 0.5);
  border: 1px solid #2a2a30;
  border-radius: 12px;
  color: #ece8e0;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  transition: all 0.3s ease;
  outline: none;
}
.form-input:focus {
  border-color: #C9A84C;
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.12), 0 0 20px rgba(201, 168, 76, 0.06);
  background: rgba(10, 10, 13, 0.7);
}
.form-input::placeholder {
  color: #4a4a50;
}

/* Password toggle */
.password-wrapper {
  position: relative;
}
.password-wrapper .form-input {
  padding-right: 48px;
}
.toggle-pw {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #605c55;
  cursor: pointer; padding: 4px;
  transition: color 0.2s;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.toggle-pw:hover { color: #C9A84C; }
.eye-icon { display: block; }

/* ============================================
   BUTTON — exact mockup values
   ============================================ */
.btn-login {
  width: 100%;
  padding: 15px;
  margin-top: 8px;
  background: linear-gradient(135deg, #8B7535, #C9A84C);
  border: none;
  border-radius: 12px;
  color: #0a0a0d;
  font-family: 'Outfit', sans-serif;
  font-size: 15px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  animation: field-in 0.4s ease-out 1.1s both;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.35);
}
.btn-login:active {
  transform: translateY(0) scale(0.98);
}
.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
/* Shine sweep effect */
.btn-login::after {
  content: '';
  position: absolute; top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}
.btn-login:hover::after {
  left: 100%;
}

.btn-loader {
  width: 18px; height: 18px;
  border: 2px solid rgba(10, 10, 13, 0.3);
  border-top-color: #0a0a0d;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-4px); }
}

/* ============================================
   DIVIDER — exact mockup values
   ============================================ */
.divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0;
  animation: field-in 0.3s ease-out 1.15s both;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, #2a2a30, transparent);
}
.divider span {
  font-size: 10px; color: #4a4a50;
  letter-spacing: 2px; text-transform: uppercase;
}

/* ============================================
   FORGOT PASSWORD
   ============================================ */
.forgot-section {
  text-align: center;
  display: flex;
  justify-content: center;
}
.forgot-link {
  display: block;
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: #605c55;
  text-decoration: none;
  background: none; border: none;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.2s;
  animation: field-in 0.3s ease-out 1.2s both;
}
.forgot-link:hover { color: #C9A84C; }

.forgot-form {
  animation: card-in 0.3s ease-out;
}
.forgot-header {
  text-align: center;
  margin-bottom: 20px;
}
.forgot-header svg {
  margin-bottom: 8px;
}
.forgot-title {
  font-size: 18px; font-weight: 600;
  color: #ece8e0;
}
.forgot-text {
  font-size: 13px; color: #9a9590;
  margin-bottom: 20px;
  text-align: center; line-height: 1.5;
}
.forgot-actions {
  display: flex; flex-direction: column; gap: 10px;
}
.btn-forgot-send {
  width: 100%; padding: 12px;
  border-radius: 12px; border: none;
  background: linear-gradient(135deg, #8B7535, #C9A84C);
  color: #0a0a0d;
  font-family: 'Outfit', sans-serif;
  font-size: 14px; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-forgot-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.4);
}
.btn-forgot-send:disabled {
  opacity: 0.6; cursor: not-allowed; transform: none;
}
.btn-forgot-back {
  width: 100%; padding: 10px;
  border-radius: 12px;
  border: 1px solid #2a2a30;
  background: transparent;
  color: #9a9590;
  font-family: inherit; font-size: 13px;
  cursor: pointer; transition: all 0.2s;
}
.btn-forgot-back:hover {
  border-color: #3a3a40;
  color: #ece8e0;
}
.forgot-hint {
  font-size: 11px; color: #605c55;
  text-align: center;
  margin-top: 12px; line-height: 1.4;
}

/* ============================================
   FOOTER — exact mockup values
   ============================================ */
.login-footer {
  text-align: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(201, 168, 76, 0.1);
  font-size: 12px;
  color: #9a9590;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: field-in 0.3s ease-out 1.3s both;
}
.login-footer .hpx-mark {
  color: #C9A84C;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: 3px;
}

/* ============================================
   TOAST
   ============================================ */
.login-toast {
  position: fixed;
  top: 24px; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1a1a1f;
  border: 1px solid #2a2a30;
  border-radius: 12px;
  padding: 12px 20px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: #ece8e0;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  max-width: 90%;
}
.login-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.login-toast--success { border-color: rgba(74, 222, 128, 0.3); }
.login-toast--success svg { color: #4ade80; }
.login-toast--error { border-color: rgba(248, 113, 113, 0.3); }
.login-toast--error svg { color: #f87171; }

/* ============================================
   RESET PASSWORD — from reset-password mockup
   ============================================ */
.reset-msg {
  text-align: center;
  font-size: 14px;
  color: #9a9590;
  margin-bottom: 28px;
  line-height: 1.5;
  animation: text-in 0.4s ease-out 0.9s both;
}
.strength-bar {
  height: 3px; margin-top: 8px; border-radius: 2px;
  background: #2a2a30; overflow: hidden;
  animation: field-in 0.3s ease-out 1.15s both;
}
.strength-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #C9A84C, #E2C97E);
  border-radius: 2px;
  transition: width 0.3s;
}
.strength-label {
  font-size: 10px; color: #C9A84C; margin-top: 4px;
  letter-spacing: 1px; text-transform: uppercase;
  animation: field-in 0.3s ease-out 1.2s both;
}
.security-note {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 10px 14px;
  background: rgba(201, 168, 76, 0.05);
  border: 1px solid rgba(201, 168, 76, 0.1);
  border-radius: 10px;
  font-size: 11px; color: #9a9590;
  animation: field-in 0.3s ease-out 1.4s both;
}
.security-note svg { color: #C9A84C; flex-shrink: 0; }
.back-link {
  display: block; text-align: center;
  margin-top: 20px; font-size: 13px; color: #605c55;
  text-decoration: none; transition: color 0.2s;
  animation: field-in 0.3s ease-out 1.3s both;
}
.back-link:hover { color: #C9A84C; }

/* Password validation rules */
.pw-rules {
  margin-top: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.pw-rule {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #605c55;
  transition: color 0.2s;
}
.pw-rule.valid { color: #4ade80; }
.pw-rule svg { flex-shrink: 0; }

/* ============================================
   ANIMATIONS — exact mockup values
   ============================================ */
@keyframes card-in {
  0% { opacity: 0; transform: translateY(30px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes text-in {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes field-in {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ============================================
   RESET PAGE — overrides (from reset mockup)
   ============================================ */
.reset-page .login-header { margin-bottom: 32px; }
.reset-page .btn-login { margin-top: 12px; animation-delay: 1.25s; }
.reset-page .form-group:nth-child(1) { animation-delay: 1.0s; }
.reset-page .form-group:nth-child(2) { animation-delay: 1.1s; }
.reset-page .login-footer { animation-delay: 1.35s; }

/* Lock icon (reset page — available for use) */
.lock-icon {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  animation: text-in 0.5s ease-out 0.6s both;
}

/* ============================================
   REDUCED MOTION — accessibility
   Particles and orbs are subtle ambient decoration,
   NOT UI motion — safe to keep for vestibular users.
   Only kill UI entry/exit animations.
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .login-card, .login-brand, .login-title, .login-subtitle,
  .form-group, .btn-login, .divider, .forgot-section,
  .forgot-link, .forgot-form, .login-footer,
  .reset-msg, .strength-bar, .strength-label,
  .security-note, .back-link, .btn-loader {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .btn-login:hover,
  .btn-forgot-send:hover { transform: none; }
}

/* ============================================
   RESPONSIVE — small screens
   ============================================ */
@media (max-width: 480px) {
  .login-card { width: 100%; padding: 32px 24px; }
  .login-title { font-size: 28px; letter-spacing: 4px; }
}

/* ============================================
   GSAP-READY OVERRIDES
   ============================================ */
html.gsap-ready .login-card { animation: none; }
html.gsap-ready .forgot-form { animation: none; }
