@charset "UTF-8";

:root {
  color-scheme: light;
  --background: #f9fafb;
  --surface: #ffffff;
  --foreground: #161616;
  --muted: #4d5761;
  --brand: #14573a;
  --primary: #1b8354;
  --primary-hover: #166a45;
  --subtle: #f3f4f6;
  --success: #14573a;
  --success-soft: #f3fcf6;
  --danger: #b42318;
  --danger-soft: #fef3f2;
  --border: #d2d6db;
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); scroll-padding-top: 96px; }
.input-wrap input, .eye-toggle, .fp-method, .primary-button, .fpx-gen { scroll-margin-block: 96px 24px; }
body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--foreground);
  background: var(--background);
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand); text-underline-offset: 4px; }
svg, img { display: block; }
[hidden], .hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--foreground); outline-offset: 3px; }

.skip-link { position: fixed; top: 12px; right: 12px; z-index: 1000; padding: 12px 16px; border-radius: 4px; color: #ffffff; background: var(--primary); font-weight: 500; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
#progressBar { position: fixed; inset: 0 0 auto auto; z-index: 90; width: 0; height: 3px; background: var(--primary); transition: width .2s ease; }
.offline-bar { position: fixed; inset: 0 0 auto; z-index: 80; padding: 12px 16px; color: var(--danger); background: var(--danger-soft); border-bottom: 1px solid var(--danger); text-align: center; font-size: 14px; transform: translateY(-110%); transition: transform .2s ease; }
.offline-bar.show { transform: none; }

.site-header { width: 100%; min-height: 80px; padding: max(16px, env(safe-area-inset-top)) max(24px, calc((100vw - 1200px) / 2)) 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--foreground); text-decoration: none; }
.brand-mark { width: 48px; height: 48px; flex: none; overflow: hidden; border-radius: 4px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-copy strong { font-size: 24px; font-weight: 700; }
.brand-copy small { display: none; }

.page-shell { width: 100%; flex: 1; padding: 48px 24px max(48px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: center; }
.recovery-shell { width: 100%; max-width: 480px; padding: 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.trust-panel { display: none; }
.form-panel { min-width: 0; }
/* The shared legacy selectors style both wrappers; only the outer one is a card. */
html.code-design[data-theme] .form-panel { background: transparent !important; border: 0; border-radius: 0; box-shadow: none; }
html.code-design[data-theme] .fp-method { border-radius: 4px; box-shadow: none; }
.intro { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: start; }
.eyebrow, .success-kicker { color: var(--brand); font-size: 14px; font-weight: 500; }
.intro h1 { margin: 0; font-size: 32px; font-weight: 700; line-height: 1.4; text-wrap: balance; }
.intro p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; text-wrap: pretty; }

.fp-steps { margin: 28px 0; padding: 0; display: flex; align-items: flex-start; list-style: none; }
.fp-step { min-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.fp-step-dot { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); font-size: 14px; font-weight: 500; }
.fp-step-label { font-size: 12px; line-height: 20px; white-space: nowrap; }
.fp-step.active, .fp-step.done { color: var(--brand); }
.fp-step.active .fp-step-dot { border-color: var(--primary); background: var(--primary); color: #ffffff; }
.fp-step.done .fp-step-dot { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.fp-step-line { height: 1px; margin: 16px 4px 0; flex: 1; background: var(--border); }
.fp-step-line::after { content: ""; display: block; width: 100%; height: 100%; background: var(--success); transform: scaleX(0); transform-origin: right; transition: transform .2s ease; }
.fp-step-line.filled::after { transform: scaleX(1); }

.fp-view { animation: fpIn .2s ease both; }
.view-heading { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.view-heading h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 28px; }
.view-heading p { margin: 0; color: var(--muted); font-size: 14px; line-height: 22px; }
.method-list { display: flex; flex-direction: column; gap: 12px; }
.fp-method { width: 100%; min-height: 80px; padding: 16px; display: flex; align-items: center; gap: 12px; position: relative; border: 1px solid var(--border); border-radius: 4px; color: var(--foreground); background: var(--surface); text-align: start; cursor: pointer; transition: border-color .15s ease, background-color .15s ease; }
html.code-design[data-theme] .fp-method:hover:not(:disabled) { border-color: var(--brand) !important; background: var(--subtle) !important; }
.fp-method:disabled { cursor: not-allowed; }
.fp-method:disabled .fp-method-arrow { opacity: .4; }
.fp-method-icon { width: 40px; height: 40px; display: grid; flex: none; place-items: center; border: 1px solid var(--border); border-radius: 4px; background: var(--subtle); }
.fp-method-icon.google { background: #ffffff; }
.fp-method-icon svg { width: 24px; height: 24px; }
.fp-method-icon.telegram svg { fill: currentColor; }
.fp-method-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fp-method-copy strong { font-size: 16px; line-height: 24px; font-weight: 500; }
.fp-method-copy small { color: var(--muted); font-size: 12px; line-height: 20px; }
.fp-method-arrow { width: 20px; height: 20px; margin-inline-start: auto; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html.code-design[data-theme] .fp-method.loading { border-color: var(--brand) !important; }
.fp-method.loading { cursor: wait; }
.fp-method.loading .fp-method-arrow { opacity: 0; }
.fp-method.loading::after { content: ""; width: 20px; height: 20px; position: absolute; inset-inline-end: 16px; top: calc(50% - 10px); border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: fpSpin .7s linear infinite; }
.methods-status { margin: 16px 0 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; line-height: 22px; }
.status-spinner { width: 16px; height: 16px; flex: none; border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: fpSpin .8s linear infinite; }
.gsi-hidden { position: fixed; top: 0; right: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; clip-path: inset(50%); pointer-events: none; }

.verified-row { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.verified-row p { margin: 0; color: var(--success); font-size: 14px; line-height: 22px; font-weight: 500; overflow-wrap: anywhere; }
.fp-timer { min-height: 32px; padding: 4px 8px; display: inline-flex; align-items: center; gap: 4px; flex: none; border: 1px solid var(--border); border-radius: 4px; color: var(--brand); background: var(--success-soft); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; direction: ltr; }
.fp-timer svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fp-timer.danger { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }
.input-group { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.input-group > label { font-size: 16px; font-weight: 500; line-height: 24px; }
.input-wrap { position: relative; width: 100%; }
.input-wrap input { width: 100%; min-width: 0; height: 48px; padding: 12px 48px 12px 12px; border: 1px solid var(--border); border-radius: 4px; outline: none; color: var(--foreground); background: var(--surface); font-size: 16px; text-align: left; transition: border-color .15s ease, box-shadow .15s ease; }
.input-wrap input::placeholder { color: var(--muted); text-align: right; }
.input-wrap input:hover { border-color: var(--muted); }
.input-wrap input:focus { border-color: var(--foreground); box-shadow: 0 2px 0 var(--foreground); }
html.code-design .input-wrap input:focus-visible { outline: none; }
.input-wrap input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 2px 0 var(--danger); }
.input-wrap input:-webkit-autofill { -webkit-text-fill-color: var(--foreground); -webkit-box-shadow: 0 0 0 1000px var(--surface) inset; caret-color: var(--foreground); }
.eye-toggle { width: 44px; height: 44px; padding: 0; position: absolute; top: 2px; right: 2px; display: grid; place-items: center; border: 0; border-radius: 4px; color: var(--muted); background: transparent; cursor: pointer; }
.eye-toggle:hover { color: var(--foreground); background: var(--subtle); }
.eye-toggle[aria-pressed="true"] { color: var(--brand); }
.eye-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* Preserve the explicit labels and reserve the physical left side for the eye on LTR passwords. */
html.code-design #resetForm .input-wrap > input { padding: 12px 14px 12px 54px !important; }
html.code-design #resetForm .input-wrap > .eye-toggle { top: 50%; right: auto; left: 6px; width: 44px; height: 44px; transform: translateY(-50%); }
html.code-design #resetForm .eye-toggle:focus-visible { outline: 2px solid var(--code-link); outline-offset: -2px; }
.strength-row { margin-top: 12px; }
.fp-meter { height: 4px; overflow: hidden; border-radius: 4px; background: var(--border); }
.fp-meter-bar { width: 0; height: 100%; border-radius: inherit; transition: width .2s ease, background-color .2s ease; }
.fp-meter-label, .fp-match { min-height: 20px; margin: 4px 0 0; font-size: 12px; line-height: 20px; }
.fp-reqs { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fp-req { display: flex; align-items: flex-start; gap: 4px; color: var(--muted); font-size: 12px; line-height: 20px; }
.fp-req svg { width: 16px; height: 16px; margin-top: 2px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fp-req.ok { color: var(--success); }
.confirm-group { margin-top: 24px; }
.caps-warn { margin-top: 8px; padding: 8px 12px; display: none; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 4px; color: var(--foreground); background: var(--subtle); font-size: 14px; }
.caps-warn.show { display: flex; }
.caps-warn svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary-button { width: 100%; min-height: 48px; margin-top: 24px; padding: 12px 16px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 4px; color: #ffffff; background: var(--primary); font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background-color .15s ease; }
.primary-button:hover:not(:disabled) { color: #ffffff; background: var(--primary-hover); }
.primary-button:active:not(:disabled) { background: #14573a; }
.primary-button svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary-button:disabled { cursor: wait; }
.fpx-gen { min-height: 44px; padding: 8px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); border-radius: 4px; color: var(--brand); background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; }
.fpx-gen:hover { background: var(--subtle); border-color: var(--muted); }
.fpx-gen svg { width: 20px; height: 20px; flex: none; }
.fpx-crack, .fpx-pwn { display: block; margin-top: 4px; font-size: 12px; line-height: 20px; }
.fpx-crack:empty, .fpx-pwn:empty { display: none; }
.fpx-pwn { color: var(--danger); }

.error-message { margin: 16px 0 0; padding: 12px; border: 1px solid var(--danger); border-radius: 4px; color: var(--danger); background: var(--danger-soft); font-size: 14px; line-height: 24px; overflow-wrap: anywhere; }
.form-footer { margin-top: 24px; padding-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; line-height: 22px; text-align: center; }
.fp-back { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 500; text-decoration: none; }
.fp-back svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fp-back:hover { text-decoration: underline; }
.form-footer span a { font-weight: 500; }

.success-view { text-align: center; }
.fp-success-ring { width: 64px; height: 64px; margin: 0 auto 16px; display: grid; place-items: center; border: 1px solid var(--success); border-radius: 50%; color: var(--success); background: var(--success-soft); }
.fp-success-ring svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fp-check-path { stroke-dasharray: 48; stroke-dashoffset: 48; animation: fpCheck .4s .1s ease forwards; }
.success-kicker { color: var(--success); }
.success-view h2 { margin: 8px 0 0; font-size: 24px; line-height: 1.5; font-weight: 600; text-wrap: balance; }
.success-view p { margin: 8px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
#redirectCount { font-weight: inherit; font-variant-numeric: tabular-nums; }
.fpx-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.fpx-confetti { position: fixed; inset: 0; z-index: 9999; pointer-events: none; }
.fpx-shake { animation: fpxShake .3s ease both; }
@keyframes fpIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fpSpin { to { transform: rotate(360deg); } }
@keyframes fpCheck { to { stroke-dashoffset: 0; } }
@keyframes fpxShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

@media (max-width: 600px) {
  .site-header { min-height: 72px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; gap: 8px; }
  .brand { gap: 8px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand-copy strong { font-size: 20px; }
  .page-shell { align-items: flex-start; padding: 24px 16px max(24px, env(safe-area-inset-bottom)); }
  .recovery-shell { padding: 24px; }
  .intro h1 { font-size: 28px; }
  .intro p { font-size: 14px; line-height: 24px; }
  .fp-steps { margin-block: 24px; }
  .fp-method { padding: 12px; }
  .fp-method.loading::after { inset-inline-end: 12px; }
}
@media (max-width: 360px) {
  .recovery-shell { padding: 20px 16px; }
  .intro h1 { font-size: 26px; }
  .fp-step { min-width: 64px; }
  .fp-method { gap: 8px; }
  .fp-method-copy strong { font-size: 14px; }
  .fp-reqs { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .fp-check-path { stroke-dashoffset: 0; }
}
