/* Page-specific styles — shared theme lives in common.css */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

button,
input {
  font: inherit;
}

/* =========================================================
   Page
   ========================================================= */

.recovery-page {
  width: 100%;
  min-height: 100dvh;
  max-width: var(--page-max);
  margin: 0 auto;

  padding: max(16px, env(safe-area-inset-top)) 20px
    max(22px, env(safe-area-inset-bottom));

  display: flex;
  flex-direction: column;

  /* همون بک‌گراند صفحه‌ی ورود (orb های محو رنگی) */
  position: relative;
  overflow: hidden;
}

.recovery-page > *:not(.bg-orb) {
  position: relative;
  z-index: 2;
}

.recovery-page .orb-3 {
  top: 42%;
  right: -40px;
  left: auto;
  animation: recovery-orb-float 13s ease-in-out infinite;
}

@keyframes recovery-orb-float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(12px, -10px); }
}

@media (prefers-reduced-motion: reduce) {
  .recovery-page .orb-3 { animation: none; }
}

/* =========================================================
   Header
   ========================================================= */

.topbar {
  height: 52px;

  display: grid;
  grid-template-columns: 44px 1fr 44px;

  align-items: center;
}

.brand {
  justify-self: center;

  display: flex;
  align-items: center;
  gap: 8px;

  color: var(--primary);

  font-size: 19px;
  font-weight: 800;
}

.brand-mark {
  width: 34px;
  height: 34px;

  display: grid;
  place-items: center;

  border-radius: 11px;

  background: var(--primary-soft);

  font-size: 19px;
}

.back-button {
  width: 40px;
  height: 40px;

  display: grid;
  place-items: center;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: var(--surface);
  color: var(--text-soft);

  font-size: 20px;

  cursor: pointer;
}

.topbar-space {
  width: 40px;
}

/* =========================================================
   Main content
   ========================================================= */

.recovery-content {
  flex: 1;

  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* =========================================================
   Heading
   ========================================================= */

.recovery-heading {
  text-align: center;
  margin-bottom: 25px;
}

.recovery-heading h1 {
  margin: 0;

  color: var(--text);

  font-size: 23px;
  font-weight: 800;
}

.recovery-heading p {
  margin: 9px 0 0;

  color: var(--text-soft);

  font-size: 12px;
  line-height: 1.8;
}

/* =========================================================
   Recovery methods
   ========================================================= */

.recovery-methods {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.recovery-method {
  width: 100%;
  min-height: 82px;

  display: flex;
  align-items: center;

  gap: 12px;

  padding: 13px 14px;

  border: 1px solid var(--border);
  border-radius: 15px;

  background: var(--surface);

  color: inherit;
  text-decoration: none;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.recovery-method:hover {
  border-color: var(--primary);

  box-shadow: 0 10px 22px rgba(77, 125, 230, 0.14);

  transform: translateY(-1px);
}

.recovery-method:active {
  transform: scale(0.985);
}

/* =========================================================
   Method icon
   ========================================================= */

.method-icon {
  width: 48px;
  height: 48px;

  min-width: 48px;

  display: grid;
  place-items: center;

  border-radius: 14px;

  background: linear-gradient(145deg, var(--primary-soft), #ffffff);
  box-shadow: 0 4px 12px rgba(77, 125, 230, 0.25);

  font-size: 21px;
}

/* =========================================================
   Method text
   ========================================================= */

.method-content {
  min-width: 0;

  flex: 1;
}

.method-content h2 {
  margin: 0;

  color: var(--text);

  font-size: 13px;
  font-weight: 700;

  line-height: 1.5;
}

.method-content p {
  margin: 4px 0 0;

  color: var(--text-soft);

  font-size: 11px;
  line-height: 1.7;
}

/* =========================================================
   Arrow
   ========================================================= */

.method-arrow {
  color: #c7c6d6;

  font-size: 22px;
  font-weight: 700;
  line-height: 1;

  flex-shrink: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.recovery-method:hover .method-arrow {
  color: var(--primary);
  transform: translateX(-3px);
}

/* =========================================================
   Small phones
   ========================================================= */

@media (max-width: 360px) {
  .recovery-page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .recovery-heading h1 {
    font-size: 21px;
  }

  .recovery-method {
    min-height: 78px;
    padding: 11px 12px;
  }

  .method-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;

    font-size: 19px;
  }

  .method-content h2 {
    font-size: 12px;
  }

  .method-content p {
    font-size: 10px;
  }
}

/* =========================================================
   Recovery steps
   ========================================================= */

.recovery-step {
  display: none;
}

.recovery-step.active {
  display: block;

  padding: 28px 22px;

  /* حالت شیشه‌ای — روی همون بک‌گراند صفحه‌ی ورود */
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 28px;
  box-shadow:
    0 20px 50px rgba(36, 33, 55, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);

  animation: recoveryStepIn 0.25s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .recovery-step.active { animation: none; }
}

/* =========================================================
   Recovery form
   ========================================================= */

.recovery-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.input-wrap {
  height: 51px;

  display: flex;
  align-items: center;

  gap: 9px;

  padding: 0 13px;

  border: 1px solid var(--border);
  border-radius: 13px;

  background: var(--surface);

  transition: 0.2s ease;
}

.input-wrap:focus-within {
  border-color: var(--primary);

  box-shadow: 0 0 0 4px rgba(77, 125, 230, 0.08);
}

.input-icon {
  color: #9994a7;
  font-size: 16px;
}

.password-toggle {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: #9994a7;
  cursor: pointer;
  transition: color 0.15s ease;
}

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

.password-toggle .ic-eye-off {
  display: none;
}

.password-toggle.is-visible {
  color: var(--primary);
}

.password-toggle.is-visible .ic-eye {
  display: none;
}

.password-toggle.is-visible .ic-eye-off {
  display: block;
}

.input-wrap input {
  width: 100%;
  height: 100%;

  min-width: 0;

  border: 0;
  outline: 0;

  background: transparent;

  color: var(--text);

  font-size: 13px;
}

.input-wrap input::placeholder {
  color: #aaa6b5;
}

/* =========================================================
   Recovery button
   ========================================================= */

.recovery-button {
  width: 100%;
  height: 52px;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 12px;

  margin-top: 2px;

  border: 0;
  border-radius: 14px;

  background: var(--primary);
  color: white;

  font-size: 14px;
  font-weight: 700;

  cursor: pointer;

  box-shadow: 0 8px 18px rgba(77, 125, 230, 0.22);

  transition: 0.2s ease;
}

.recovery-button:active {
  transform: scale(0.985);
}

.recovery-button[hidden] {
  display: none !important;
}

.recovery-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.recovery-button-login {
  background: linear-gradient(135deg, var(--secondary), #3d9b4f);
  box-shadow: 0 8px 18px rgba(140, 203, 69, 0.3);
  text-decoration: none;
  animation: recoveryBtnIn 0.25s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .recovery-button-login { animation: none; }
}

/* =========================================================
   پیام خطا / موفقیت
   ========================================================= */

.recovery-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.7;
  animation: recoveryMsgIn 0.22s ease;
}

.recovery-message[hidden] {
  display: none !important;
}

.recovery-message.error {
  background: #FDEAEA;
  color: #C23E3E;
  border: 1px solid rgba(243, 93, 93, 0.25);
}

.recovery-message.success {
  background: var(--secondary-soft);
  color: #1F8C57;
  border: 1px solid rgba(140, 203, 69, 0.3);
}

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

@keyframes recoveryShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.recovery-form.shake {
  animation: recoveryShake 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
  .recovery-message,
  .recovery-form.shake {
    animation: none;
  }
}

/* =========================================================
   Change method
   ========================================================= */

.change-method {
  display: block;

  margin: 18px auto 0;

  padding: 5px;

  border: 0;

  background: transparent;

  color: var(--primary);

  font-size: 12px;
  font-weight: 600;

  cursor: pointer;
}

/* ==============================
   Verification Code
   ============================== */

#verification-code {
  text-align: center;
  direction: ltr;
  letter-spacing: 6px;
  font-size: 18px;
  font-weight: 700;
}

#verification-code::placeholder {
  letter-spacing: 1px;
  font-size: 12px;
  font-weight: 400;
}

/* ==============================
   Email Recovery Success
   ============================== */

.recovery-success-icon {
  width: 64px;
  height: 64px;
  min-width: 64px;
  margin: 0 auto 18px;
  font-size: 28px;
  background: linear-gradient(145deg, var(--secondary-soft), #ffffff);
  box-shadow: 0 4px 14px rgba(140, 203, 69, 0.3);
}
