/* LostPhones V2 — homepage and emergency recovery. Legacy pages keep style.css. */

:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --text: #17324d;
  --muted: #3d4a57;
  --line: #d9e1e8;
  --accent: #17324d;
  --accent-hover: #12273c;
  --interactive: #2e5f8a;
  --focus: #2e5f8a;
  --secured: #2d6a4f;
  --secured-bg: #e7f3ec;
  --attention: #9a5a00;
  --attention-bg: #f8f0e4;
  --danger: #9b2c2c;
  --danger-bg: #f8eaea;
  --caution-bg: #f8f0e4;
  --caution-text: #3f3420;
  --trust-bg: #eaf1f6;
  --shadow: 0 8px 24px rgba(23, 50, 77, 0.06);
  --radius: 16px;
  --space: 8px;
  --max: 46rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", Calibri, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--interactive);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
dialog:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem 1rem;
  z-index: 20;
}

.skip-link:focus {
  top: 0.75rem;
}

.site-header,
.emergency-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 248, 250, 0.96);
}

.site-header-inner,
.emergency-header-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.wordmark {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-quiet,
.emergency-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-quiet a,
.emergency-nav a,
.emergency-nav button {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  min-height: 44px;
  min-width: 44px;
  padding: 0.65rem 0.7rem;
  display: inline-flex;
  align-items: center;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.nav-quiet a[aria-current="page"] {
  color: var(--text);
}

@media (max-width: 767px) {
  .nav-about {
    display: none;
  }
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.hero {
  padding-top: 1.5rem;
}

.hero h1 {
  font-size: clamp(1.85rem, 6vw, 2.5rem);
  line-height: 1.15;
  margin: 0 0 0.85rem;
  letter-spacing: -0.02em;
}

.lede {
  font-size: 1.125rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.trust-facts {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.trust-facts li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  min-height: 44px;
}

.prepare-panel {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 48px;
  padding: 0.85rem 1.1rem;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

.btn-tertiary {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  font-weight: 600;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

.secondary-path {
  margin-top: 1.5rem;
  color: var(--muted);
}

.secondary-path p {
  margin: 0 0 0.35rem;
}

.secondary-path button {
  color: var(--interactive);
  background: none;
  border: 0;
  font: inherit;
  font-weight: 650;
  min-height: 44px;
  padding: 0.4rem 0;
  cursor: pointer;
  text-align: left;
}

.secondary-path .btn {
  margin-top: 0.25rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem;
  margin-top: 1.5rem;
}

.panel h2 {
  font-size: 1.05rem;
  margin: 0 0 0.65rem;
}

.panel ul {
  margin: 0;
  padding-left: 1.15rem;
}

.panel li + li {
  margin-top: 0.4rem;
}

.trust {
  background: var(--trust-bg);
}

.caution,
.safety-note {
  background: var(--attention-bg);
  color: var(--caution-text);
}

.safety-note {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin: 0 0 1rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 1rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1rem;
  margin-bottom: 0.75rem;
}

.site-footer a {
  color: var(--muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.progress,
.progress-header {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 650;
  margin: 0 0 1rem;
}

.segmented-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin: 0 0 1.25rem;
}

.segmented-progress[data-steps="5"] {
  grid-template-columns: repeat(5, 1fr);
}

.segment {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
}

.segment.is-done,
.segment.is-current {
  background: var(--accent);
}

.live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.screen-title {
  font-size: clamp(1.55rem, 5vw, 2rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.choice-list {
  border: 0;
  margin: 0;
  padding: 0;
}

.choice-list legend {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.choice-list legend .screen-title {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  margin: 0;
  letter-spacing: 0;
}

#outcome-primary .btn,
#outcome-exception-controls .btn {
  flex-direction: column;
  align-items: flex-start;
  white-space: normal;
  height: auto;
}

.filename {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
}

@media (forced-colors: active) {
  .choice:has(input:checked),
  .choice.is-selected,
  .btn:focus-visible,
  a:focus-visible {
    outline: 3px solid CanvasText;
    outline-offset: 3px;
  }
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 0.65rem;
  cursor: pointer;
}

.choice:has(input:checked),
.choice.is-selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  background: #eef3f7;
}

.choice input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--accent);
}

.flow-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.kicker {
  text-transform: none;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: 0 0 0.4rem;
}

.action-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.15rem 1.35rem;
  box-shadow: var(--shadow);
}

.action-steps {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
}

.action-steps li + li {
  margin-top: 0.4rem;
}

.progress-rail {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 1.15rem;
}

.progress-stage {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.95rem;
}

.progress-stage-status {
  font-weight: 700;
}

.progress-stage.is-done .progress-stage-status {
  color: var(--secured);
}

.progress-stage.is-current .progress-stage-status {
  color: var(--interactive);
}

.progress-stage.is-attention .progress-stage-status {
  color: var(--attention);
}

.disclosure {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

details.reveal {
  margin-top: 0.85rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

details.reveal summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 650;
}

.outcome-help {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

.awaiting-banner,
.resume-box,
.plan-panel,
.paid-offer,
.result-card,
.recommendation-card,
.complete-summary {
  margin-top: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.paid-offer {
  background: #eef3f8;
}

.complete-summary {
  background: var(--secured-bg);
}

.awaiting-banner {
  background: var(--attention-bg);
  color: var(--caution-text);
}

.status-pill {
  display: inline-block;
  margin: 0 0 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--trust-bg);
  font-weight: 700;
}

.status-pill.is-secured {
  background: var(--secured-bg);
  color: var(--secured);
}

.status-pill.is-attention {
  background: var(--attention-bg);
  color: var(--attention);
}

.plan-intro,
.plan-blocked {
  color: var(--muted);
  font-size: 0.95rem;
}

.plan-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.plan-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
}

.plan-status {
  font-size: 0.85rem;
  font-weight: 700;
}

.plan-completed .plan-status {
  color: var(--secured);
}

.plan-blocked .plan-status,
.plan-item.plan-blocked .plan-status {
  color: var(--attention);
}

.plan-not_applicable {
  opacity: 0.7;
}

#outcome-controls,
#outcome-primary,
#resume-controls,
#action-controls,
#download-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
}

.primary-cta-slot {
  margin-top: 0.75rem;
}

.sticky-cta {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(246, 248, 250, 0), var(--bg) 28%);
}

body.keyboard-open .sticky-cta,
body.dialog-open .sticky-cta {
  position: static;
  background: none;
  padding-bottom: 0;
}

.overview-list {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.overview-row {
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.overview-row.is-needs_setup {
  border-left: 4px solid var(--attention);
}

.overview-row.is-not_sure {
  border-left: 4px solid var(--interactive);
}

.overview-row.is-protected {
  border-left: 4px solid var(--secured);
}

.privacy-box ul {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
}

dialog.reset-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem;
  max-width: 24rem;
}

dialog.reset-dialog::backdrop {
  background: rgba(23, 50, 77, 0.35);
}

@media (min-width: 768px) {
  main {
    padding-top: 2.5rem;
  }

  .hero {
    padding-top: 2rem;
  }

  .sticky-cta {
    position: static;
    background: none;
    padding-bottom: 0;
  }
}

@media (min-width: 1024px) {
  .emergency-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 13rem;
    gap: 1.5rem;
    align-items: start;
  }

  .progress-rail {
    order: 2;
  }
}

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

@media print {
  .site-header,
  .emergency-header,
  .site-footer,
  .skip-link,
  .flow-nav,
  .paid-offer,
  .emergency-nav,
  .sticky-cta,
  details.reveal:not([open]) {
    display: none !important;
  }

  .complete-summary,
  .plan-panel,
  .action-surface {
    box-shadow: none;
    border-color: #bbb;
  }
}
