/* ==========================================================================
   Forgot password — refined card layout
   ========================================================================== */

:root {
  --fp-orange: #ff8623;
  --fp-orange-deep: #e68200;
  --fp-orange-deeper: #c66f00;
  --fp-ink: #0a0a0a;
  --fp-ink-soft: #2a2a2a;
  --fp-mute: #5b5b5b;
  --fp-mute-soft: #8a8a8a;
  --fp-line: #ececec;
  --fp-line-strong: #d8d8d8;
  --fp-surface: #ffffff;
  --fp-tint: #fff5eb;
  --fp-danger: #c43d3d;
  --fp-warn: #d18900;
  --fp-ok: #2d8659;
  --fp-radius: 24px;
  --fp-radius-input: 14px;
  --fp-shadow-card: 0 1px 2px rgba(10, 10, 10, 0.04),
                    0 12px 32px rgba(70, 30, 0, 0.12),
                    0 32px 64px -24px rgba(70, 30, 0, 0.18);
  --fp-shadow-card-hover: 0 1px 2px rgba(10, 10, 10, 0.05),
                          0 18px 40px rgba(70, 30, 0, 0.14);
}

html,
body {
  background: var(--fp-orange);
  min-height: 100vh;
  margin: 0;
}

body.theme-promoping {
  background: var(--fp-orange);
}

/* Subtle radial wash so the orange has depth instead of being flat */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, 0.18), transparent 55%),
    radial-gradient(80% 60% at 50% 120%, rgba(0, 0, 0, 0.10), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Header stays floating on top of the wash */
.pp-header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  background: var(--promoping-cream-transparent, rgba(255, 245, 235, 0.95));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  height: 4rem;
}

.login-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 7rem 1.25rem 3rem;
  min-height: 100vh;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */

.forgot-password-container {
  width: 100%;
  max-width: 480px;
  margin: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.fp-card {
  background: var(--fp-surface);
  border-radius: var(--fp-radius);
  padding: 40px 36px 32px;
  box-shadow: var(--fp-shadow-card);
  position: relative;
  animation: fpCardEnter 360ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes fpCardEnter {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fp-card-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.fp-card-logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.forgot-step,
.email-sent-section,
.reset-password-section {
  animation: fpStepEnter 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes fpStepEnter {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Typography hierarchy
   -------------------------------------------------------------------------- */

.forgot-password-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fp-ink);
  margin: 0 0 8px;
  text-align: center;
  line-height: 1.2;
}

.forgot-password-subtitle {
  font-size: 15px;
  font-weight: 400;
  color: var(--fp-mute);
  margin: 0 0 28px;
  text-align: center;
  line-height: 1.5;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fp-ink-soft);
  margin-bottom: 8px;
}

/* --------------------------------------------------------------------------
   Step 1 — Find Account
   -------------------------------------------------------------------------- */

.forgot-password-form {
  margin-top: 0;
}

.form-group {
  margin-bottom: 16px;
}

.form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  flex: 1;
  width: 100%;
  padding: 14px 44px 14px 44px;
  font-size: 15px;
  font-family: inherit;
  color: var(--fp-ink);
  background: var(--fp-surface);
  border: 1.5px solid var(--fp-line);
  border-radius: var(--fp-radius-input);
  transition: border-color 160ms ease, box-shadow 160ms ease;
  box-sizing: border-box;
}

.form-input::placeholder {
  color: var(--fp-mute-soft);
}

.form-input:hover:not(:focus) {
  border-color: var(--fp-line-strong);
}

.form-input:focus {
  outline: none;
  border-color: var(--fp-ink);
  box-shadow: 0 0 0 4px rgba(10, 10, 10, 0.06);
}

#findAccountForm .form-input {
  padding-left: 44px;
  padding-right: 38px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--fp-mute-soft);
  pointer-events: none;
}

.clear-button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--fp-line);
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--fp-mute);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  z-index: 2;
  transition: background 150ms ease, color 150ms ease;
}

.clear-button:hover {
  background: var(--fp-line-strong);
  color: var(--fp-ink);
}

.form-input:not(:placeholder-shown) ~ .clear-button {
  display: flex;
}

/* Hide the legacy "Search" button — search is live as user types */
.search-button {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* --------------------------------------------------------------------------
   Search results
   -------------------------------------------------------------------------- */

.search-results {
  margin-top: 10px;
  display: none;
  background: transparent;
  border: 1px solid var(--fp-line);
  border-radius: var(--fp-radius-input);
  max-height: 360px;
  overflow-y: auto;
  padding: 6px;
  box-shadow: none;
}

.search-results.active {
  display: block !important;
}

#accountsList {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background 150ms ease;
  margin-bottom: 0;
  border: 1.5px solid transparent;
}

.account-item:hover {
  background: var(--fp-tint);
}

.account-item-content {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fp-orange) 0%, var(--fp-orange-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-right: 12px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.account-info {
  flex: 1;
  min-width: 0;
  margin-right: 12px;
}

.account-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fp-ink);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.account-email {
  font-size: 13px;
  color: var(--fp-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.account-select-button {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fp-orange-deep);
  background: transparent;
  border: 1.5px solid var(--fp-orange-deep);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.account-select-button:hover {
  background: var(--fp-orange-deep);
  color: #fff;
}

.account-select-button:active {
  transform: scale(0.97);
}

.no-results {
  padding: 16px 12px;
  text-align: center;
  color: var(--fp-mute);
  font-size: 13px;
}

.search-help {
  margin-top: 14px;
  text-align: center;
  color: var(--fp-mute);
  font-size: 13px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Step 2 — Email sent
   -------------------------------------------------------------------------- */

.email-sent-section {
  display: none;
  text-align: center;
  padding: 8px 0 0;
}

.email-sent-section.active {
  display: block;
}

.fp-envelope-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--fp-tint);
  color: var(--fp-orange-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.fp-envelope-icon svg {
  width: 28px;
  height: 28px;
}

.email-sent-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fp-ink);
  margin: 0 0 10px;
}

.email-sent-text {
  font-size: 14px;
  color: var(--fp-mute);
  margin: 0 0 14px;
  line-height: 1.55;
}

.email-sent-text strong {
  color: var(--fp-ink);
  font-weight: 600;
}

.email-sent-text a {
  color: var(--fp-mute);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.email-sent-text a:hover {
  color: var(--fp-ink);
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Step 3 — Reset password
   -------------------------------------------------------------------------- */

.reset-password-section {
  display: none;
}

.reset-password-section.active {
  display: block;
}

.reset-password-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fp-ink);
  margin: 0 0 8px;
  text-align: center;
}

.reset-password-subtitle {
  font-size: 14px;
  color: var(--fp-mute);
  margin: 0 0 28px;
  text-align: center;
  line-height: 1.5;
}

.reset-password-subtitle strong {
  color: var(--fp-ink);
  font-weight: 600;
}

#resetPasswordForm .form-input {
  padding-left: 16px;
  padding-right: 44px;
}

.password-input-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fp-mute-soft);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms ease, background 150ms ease;
}

.password-toggle:hover {
  color: var(--fp-ink);
  background: var(--fp-tint);
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

/* Strength indicator */
.fp-strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  min-height: 14px;
}

.fp-strength-bars {
  display: flex;
  gap: 4px;
  flex: 1;
}

.fp-strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--fp-line);
  transition: background 220ms ease;
}

.fp-strength[data-level="1"] .fp-strength-bar:nth-child(1) {
  background: var(--fp-danger);
}
.fp-strength[data-level="2"] .fp-strength-bar:nth-child(-n+2) {
  background: var(--fp-warn);
}
.fp-strength[data-level="3"] .fp-strength-bar {
  background: var(--fp-ok);
}

.fp-strength-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fp-mute-soft);
  width: 56px;
  text-align: right;
  transition: color 220ms ease;
}

.fp-strength[data-level="1"] .fp-strength-label { color: var(--fp-danger); }
.fp-strength[data-level="2"] .fp-strength-label { color: var(--fp-warn); }
.fp-strength[data-level="3"] .fp-strength-label { color: var(--fp-ok); }

.reset-button {
  width: 100%;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--fp-ink);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  margin-top: 24px;
  transition: background 160ms ease, transform 160ms ease;
}

.reset-button:hover {
  background: var(--fp-ink-soft);
}

.reset-button:active {
  transform: scale(0.99);
}

/* --------------------------------------------------------------------------
   Buttons (shared)
   -------------------------------------------------------------------------- */

.btn-secondary {
  flex: 1;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fp-ink);
  background: var(--fp-tint);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
  max-width: 180px;
}

.btn-secondary:hover {
  background: #ffe9d2;
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-primary-red {
  flex: 1;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--fp-ink);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
  max-width: 180px;
}

.btn-primary-red:hover {
  background: var(--fp-ink-soft);
}

.btn-primary-red:active {
  transform: scale(0.98);
}

/* --------------------------------------------------------------------------
   Messages
   -------------------------------------------------------------------------- */

.error-message {
  background: #fff4f4;
  border: 1px solid #f1c5c5;
  color: #8a1f1f;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.success-message {
  background: #f0faf4;
  border: 1px solid #c8e6d3;
  color: #1f5d3a;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Footer link
   -------------------------------------------------------------------------- */

.back-to-login {
  text-align: center;
  margin-top: 22px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.back-to-login a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  padding-bottom: 1px;
  transition: border-color 150ms ease;
}

.back-to-login a:hover {
  border-bottom-color: #fff;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 540px) {
  .login-main {
    padding: 6rem 1rem 2.5rem;
  }

  .fp-card {
    padding: 32px 22px 26px;
    border-radius: 20px;
  }

  .forgot-password-title {
    font-size: 22px;
  }

  .forgot-password-subtitle {
    font-size: 14px;
    margin-bottom: 22px;
  }

  .action-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .btn-secondary,
  .btn-primary-red {
    max-width: 100%;
    width: 100%;
  }

  .account-select-button {
    padding: 6px 12px;
    font-size: 12px;
  }

  .account-avatar {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}
