/* FuckRN — thème sombre inspiré de X : noir pur, ardoise, accent rose-rouge. */

:root {
  --bg: #000000;
  --surface: #16181c;
  --surface-2: #202327;
  --border: #2f3336;
  --text: #e7e9ea;
  --muted: #8b9095;
  --accent: #f91880;
  --accent-hover: #d9146f;
  --accent-soft: rgba(249, 24, 128, 0.12);
  --ok: #00ba7c;
  --warn: #ffd400;
  --danger: #f4212e;
  --radius: 16px;
  --pill: 9999px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  color-scheme: dark;
}

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

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  overflow-wrap: anywhere;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

code, .kbd {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

.kbd { font-family: var(--font); font-weight: 700; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 100;
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: var(--pill);
  font-weight: 700;
}
.skip-link:focus { top: calc(var(--safe-top) + 12px); }

/* ---------- Mise en page ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1265px;
  margin: 0 auto;
}

.sidenav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 8px) 12px 8px;
  background: rgba(0, 0, 0, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 19px;
  flex: none;
  padding: 4px;
  border-radius: var(--pill);
}
.brand:hover { text-decoration: none; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 19px;
}

.brand-name { display: none; }

.nav { min-width: 0; flex: 1; }
.nav ul {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav ul::-webkit-scrollbar { display: none; }

.nav a {
  display: block;
  white-space: nowrap;
  color: var(--text);
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--pill);
  transition: background-color .15s;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }

.sidenav .sidenav-cta { display: none; }

.main {
  min-width: 0;
  border-left: 0;
  border-right: 0;
}

.aside {
  padding: 16px;
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--border);
}

@media (min-width: 400px) {
  .brand-name { display: inline; }
}

@media (min-width: 720px) {
  .layout { grid-template-columns: minmax(0, 640px); justify-content: center; }
  .main { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  .aside { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

@media (min-width: 1040px) {
  .layout {
    grid-template-columns: 240px minmax(0, 600px) 340px;
    justify-content: center;
    align-items: start;
  }
  .sidenav {
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: calc(var(--safe-top) + 12px) 16px 16px 12px;
    border-bottom: 0;
    background: var(--bg);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .brand { align-self: flex-start; padding: 8px 12px 8px 8px; }
  .brand:hover { background: var(--surface-2); }
  .nav { flex: none; }
  .nav ul { flex-direction: column; overflow: visible; }
  .nav a { font-size: 19px; font-weight: 500; padding: 10px 16px; }
  .sidenav .sidenav-cta { display: inline-flex; margin-top: 12px; }
  .aside {
    position: sticky;
    top: 0;
    border: 0;
    padding: calc(var(--safe-top) + 12px) 16px 16px 24px;
  }
  html { scroll-padding-top: 16px; }
}

/* ---------- Sections ---------- */

.section {
  padding: 24px 16px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hero h1 {
  margin: 4px 0 12px;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lead { font-size: 17px; margin: 0 0 20px; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: 14px; margin: 16px 0 0; }
.tiny { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

.compare { display: grid; gap: 12px; margin-bottom: 20px; }
@media (min-width: 560px) { .compare { grid-template-columns: 1fr 1fr; } }

.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.post-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
}

.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }

.badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--pill);
  color: var(--accent);
  background: var(--accent-soft);
}

.ticks { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.ticks li + li { margin-top: 4px; }

/* ---------- Boutons ---------- */

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions-tight { margin-top: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--pill);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn-block { width: 100%; }

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

.btn-outline { background: transparent; color: var(--text); border-color: #536471; }
.btn-outline:hover { background: rgba(231, 233, 234, 0.08); }

.btn:disabled, .btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.inline-link { font-weight: 600; white-space: nowrap; }

/* ---------- Onglets / étapes ---------- */

.detected {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 14px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--pill);
  font-size: 14px;
  color: var(--muted);
}
.detected strong { color: var(--text); }

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin: 0 -16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 1 0 auto;
  position: relative;
  min-height: 50px;
  padding: 0 16px;
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { background: rgba(231, 233, 234, 0.06); }
.tab[aria-selected="true"] { color: var(--text); font-weight: 700; }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 56px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: var(--pill);
  background: var(--accent);
}
.tab:focus-visible { outline-offset: -3px; }

.tabpanel { padding-top: 8px; border-radius: 0; }
.tabpanel:focus-visible { outline-offset: 4px; }

.steps {
  counter-reset: step;
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 12px 0 12px 44px;
  border-bottom: 1px solid var(--border);
}
.steps > li:last-child { border-bottom: 0; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 11px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
}

.callout {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
}
.callout-warn { border-color: rgba(255, 212, 0, 0.45); background: rgba(255, 212, 0, 0.06); }

/* ---------- Catalogue ---------- */

.catalog { display: grid; gap: 0; margin: 16px -16px 0; border-top: 1px solid var(--border); }

.list-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background-color .15s;
}
.list-card:hover { background: rgba(231, 233, 234, 0.03); }
.list-card:last-child { border-bottom: 0; }

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.list-name { margin: 0; font-size: 17px; font-weight: 700; }
.list-id { color: var(--muted); font-size: 13px; font-family: var(--mono); }
.list-desc { margin: 4px 0 0; color: var(--text); }
.list-count { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.list-count strong { color: var(--text); }
.list-error { margin: 6px 0 0; color: var(--danger); font-size: 14px; }

.catalog-msg { padding: 16px; margin: 0; }

/* ---------- Formulaire ---------- */

.form { margin-top: 12px; }
.label { display: block; font-weight: 700; font-size: 14px; margin: 14px 0 6px; }

.input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid #536471;
  border-radius: 8px;
  font: inherit;
  font-size: 16px; /* évite le zoom automatique de Safari iOS */
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); outline: none; }
.textarea { resize: vertical; min-height: 140px; font-family: var(--mono); font-size: 15px; }

.result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
}
.result.is-ok { border-color: rgba(0, 186, 124, 0.5); }
.result.is-warn { border-color: rgba(255, 212, 0, 0.5); }

.invalid-list {
  margin: 8px 0 0;
  padding: 8px 12px 8px 28px;
  max-height: 140px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--danger);
  background: rgba(244, 33, 46, 0.06);
  border-radius: 8px;
}

/* ---------- FAQ ---------- */

.faq details {
  border-bottom: 1px solid var(--border);
}
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer;
  padding: 14px 28px 14px 0;
  font-weight: 700;
  list-style: none;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 12px;
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0 0 14px; color: var(--muted); }

/* ---------- Aside ---------- */

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border);
}
.card p { margin: 6px 0 0; font-size: 14px; }
.card-title { margin: 0; font-size: 19px; font-weight: 800; }
.card-danger { border-color: rgba(244, 33, 46, 0.55); }
.card-danger .card-title { color: #ff6b74; }

/* ---------- Pied de page / toast ---------- */

.footer {
  max-width: 1265px;
  margin: 0 auto;
  padding: 24px 16px calc(var(--safe-bottom) + 24px);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.footer p { margin: 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 20px);
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

/* ---------- Dons ---------- */

.wallets { list-style: none; margin: 16px -16px 0; padding: 0; border-top: 1px solid var(--border); }

.wallet {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.wallet:last-child { border-bottom: 0; }

.wallet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wallet-name { font-weight: 700; font-size: 16px; }
.wallet-net { color: var(--muted); font-size: 13px; }

.wallet-addr {
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
  color: var(--text);
}

.wallet-copy { justify-self: start; }

.wallet { grid-template-areas: "head" "qr" "addr" "copy"; }
.wallet-head { grid-area: head; }
.wallet-qr { grid-area: qr; justify-self: center; }
.wallet-addr { grid-area: addr; }
.wallet-copy { grid-area: copy; }

.qr {
  display: block;
  width: 168px;
  height: 168px;
  border-radius: 12px;
  background: #fff;
  shape-rendering: crispEdges;
}

@media (min-width: 480px) {
  .wallet {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "head head" "qr addr" "qr copy";
    column-gap: 16px;
    align-items: start;
  }
  .wallet-qr { justify-self: start; }
  .qr { width: 132px; height: 132px; }
}
