:root {
  --ink: #0a1e2d;
  --muted: #6b7f90;
  --line: #d7e3eb;
  --paper: #edf5f8;
  --white: #fff;
  --blue: #2387f6;
  --green: #2dc778;
  --navy: #09283b;
  --amber: #d8932f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 3%, rgba(35, 135, 246, .14), transparent 28rem),
    linear-gradient(145deg, #fbfdfe, var(--paper));
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
}

button, input, a { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.recovery-nav {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.recovery-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  padding-bottom: 10px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  background: linear-gradient(145deg, #46a4ff, #2765db);
  border-radius: 13px;
}

.brand-mark i { width: 3px; display: block; background: white; border-radius: 4px; }
.brand-mark i:nth-child(1) { height: 10px; opacity: .68; }
.brand-mark i:nth-child(2) { height: 19px; }
.brand-mark i:nth-child(3) { height: 14px; opacity: .82; }
.recovery-brand strong, .recovery-brand small { display: block; }
.recovery-brand small { margin-top: 2px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }

.recovery-nav nav { display: flex; gap: 8px; }
.recovery-nav nav a {
  padding: 10px 15px;
  color: #38566a;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  text-decoration: none;
}
.recovery-nav nav .nav-primary { color: white; background: var(--navy); border-color: var(--navy); }

main { max-width: 1180px; margin: 0 auto; padding: 48px 32px 90px; }

.recovery-hero {
  padding: 38px 0 82px;
  display: grid;
  grid-template-columns: 1.45fr .55fr;
  align-items: end;
  gap: 80px;
}

.eyebrow, .section-heading span, .recovery-rules > span, .signed-out-card > span {
  color: #557a94;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .2em;
}

.eyebrow i {
  width: 8px;
  height: 8px;
  margin-right: 10px;
  display: inline-block;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(45, 199, 120, .12);
}

.hero-copy h1 {
  margin: 25px 0 28px;
  font-size: clamp(48px, 7vw, 84px);
  line-height: .98;
  letter-spacing: -.055em;
}

.hero-copy p {
  max-width: 670px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.protection-card {
  padding: 30px;
  color: white;
  background: var(--navy);
  border-radius: 30px;
}

.protection-state { display: flex; align-items: center; gap: 9px; color: #a9c7d8; font-size: 11px; }
.protection-state i { width: 8px; height: 8px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 5px rgba(45, 199, 120, .14); }
.protection-card > strong { display: block; margin-top: 28px; font-size: 44px; }
.protection-card p { margin: 4px 0 25px; color: #b6cbd7; font-size: 13px; }
.protection-card small { color: #7497aa; }

.recovery-layout {
  display: grid;
  grid-template-columns: 1.45fr .55fr;
  align-items: start;
  gap: 18px;
}

.timeline-panel, .recovery-rules, .signed-out-card, .error-card {
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--line);
  border-radius: 30px;
}

.timeline-panel { padding: 30px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-heading h2, .recovery-rules h2 { margin: 9px 0 0; font-size: 30px; letter-spacing: -.035em; }
.section-heading button, .error-card button {
  padding: 9px 14px;
  color: #38566a;
  background: #f6fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.current-version {
  margin: 24px 0 0;
  padding: 13px 16px;
  color: #416075;
  background: #edf6fb;
  border-radius: 14px;
  font-size: 12px;
}

.backup-list { margin: 16px 0 0; padding: 0; list-style: none; }
.backup-item {
  position: relative;
  min-height: 94px;
  padding: 18px 0 18px 34px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #e5edf2;
}
.backup-item:last-child { border-bottom: 0; }
.backup-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 39px;
  width: 9px;
  height: 9px;
  background: var(--green);
  border: 4px solid #dff6e9;
  border-radius: 50%;
}
.backup-item::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 55px;
  bottom: -39px;
  width: 1px;
  background: #dce7ed;
}
.backup-item:last-child::after { display: none; }
.backup-copy strong { display: block; font-size: 15px; }
.backup-copy span { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.backup-copy small { margin-left: 8px; color: #91a2ad; }
.backup-item button {
  min-width: 78px;
  height: 38px;
  color: #176dbd;
  background: #eaf4ff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.backup-item button:hover { background: #dceeff; }

.recovery-rules { padding: 30px; color: white; background: linear-gradient(145deg, #0e344b, #071c2a); border-color: #12384e; }
.recovery-rules > span { color: #78a7c2; }
.recovery-rules ul { margin: 28px 0 0; padding: 0; list-style: none; }
.recovery-rules li { padding: 16px 0; display: flex; gap: 13px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.recovery-rules li i { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; color: #72b7ec; background: rgba(62, 151, 220, .14); border-radius: 9px; font-size: 11px; font-style: normal; }
.recovery-rules li p { margin: 0; }
.recovery-rules li strong, .recovery-rules li small { display: block; }
.recovery-rules li strong { font-size: 13px; }
.recovery-rules li small { margin-top: 6px; color: #8da8b8; font-size: 11px; line-height: 1.5; }
.privacy-boundary { margin-top: 25px; padding: 17px; background: rgba(255, 255, 255, .06); border-radius: 16px; }
.privacy-boundary strong { color: #b9d3e1; font-size: 11px; }
.privacy-boundary p { margin: 7px 0 0; color: #87a4b5; font-size: 11px; line-height: 1.6; }

.signed-out-card, .error-card { max-width: 650px; margin: 0 auto; padding: 44px; text-align: center; }
.signed-out-card h2, .error-card strong { display: block; margin: 12px 0; font-size: 30px; }
.signed-out-card p, .error-card p { color: var(--muted); line-height: 1.7; }
.signed-out-card a { display: inline-flex; margin-top: 15px; padding: 12px 19px; color: white; background: var(--blue); border-radius: 999px; text-decoration: none; }
.empty-state { padding: 60px 20px 40px; text-align: center; }
.empty-state > span { color: #81a1b4; font-size: 42px; }
.empty-state h3 { margin: 12px 0 7px; }
.empty-state p { color: var(--muted); font-size: 13px; }

.restore-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(5, 18, 29, .25);
}
.restore-dialog::backdrop { background: rgba(5, 18, 29, .42); backdrop-filter: blur(12px); }
.restore-dialog form { position: relative; padding: 32px; text-align: center; }
.dialog-close { position: absolute; top: 15px; right: 15px; width: 34px; height: 34px; color: #718694; background: #eff4f7; border: 0; border-radius: 50%; cursor: pointer; }
.dialog-icon { width: 54px; height: 54px; margin: 0 auto 17px; display: grid; place-items: center; color: #a76516; background: #fff3dc; border-radius: 17px; font-size: 28px; }
.dialog-kicker { color: #ba7219; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.restore-dialog h2 { margin: 9px 0 10px; font-size: 28px; letter-spacing: -.04em; }
.restore-dialog p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.restore-dialog label { display: block; margin: 22px 0 8px; color: #516b7d; font-size: 11px; text-align: left; }
.restore-dialog input { width: 100%; height: 48px; padding: 0 15px; border: 1px solid var(--line); border-radius: 14px; outline: none; }
.restore-dialog input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(35, 135, 246, .1); }
.dialog-error { min-height: 20px; margin: 8px 0 0; color: #c4443b !important; text-align: left; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.dialog-actions button { height: 46px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 700; }
.cancel-button { color: #506674; background: #edf3f6; }
.restore-button { color: white; background: var(--blue); }
.restore-button:disabled { cursor: not-allowed; opacity: .4; }

@media (max-width: 820px) {
  .recovery-nav { padding: 18px 20px; }
  .recovery-nav nav a:not(.nav-primary) { display: none; }
  main { padding: 30px 20px 64px; }
  .recovery-hero, .recovery-layout { grid-template-columns: 1fr; }
  .recovery-hero { gap: 34px; padding: 28px 0 60px; }
  .recovery-layout { gap: 14px; }
}

@media (max-width: 560px) {
  .hero-copy h1 { font-size: 49px; }
  .hero-copy p { font-size: 15px; }
  .protection-card, .timeline-panel, .recovery-rules { padding: 24px; border-radius: 24px; }
  .section-heading { align-items: start; }
  .section-heading h2 { font-size: 26px; }
  .backup-item { grid-template-columns: 1fr; gap: 13px; padding-left: 32px; }
  .backup-item button { justify-self: start; }
  .backup-item::after { bottom: -62px; }
  .restore-dialog form { padding: 28px 23px 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; }
}
