/* Visual identity of the official NostroMostro site: bitcoin orange, Syne for titles and DM Sans for
   text (self-hosted in fonts/). Light theme by default, the site's dark theme on request. */
@font-face {
  font-family: "Syne";
  src: url("fonts/syne-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("fonts/dm-sans-latin.woff2") format("woff2");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

/* Light is the default; dark is the NostroMostro site's own look. Text colours are checked for WCAG AA
   contrast in test/web.test.ts: the bright bitcoin orange is only used for fills in light mode, and
   --accent (a darker orange) for text and links. */
:root,
:root[data-theme="light"] {
  --bg: #eaeff5;
  --bg-secondary: #ffffff;
  --card: #ffffff;
  --card-hover: #f6f9fc;
  --text: #0f1b2d;
  --strong: #070f1b;
  --muted: #526078;
  --orange: #f7931a;
  --orange-hover: #e8850f;
  --accent: #ad4300;
  --accent-hover: #7e3000;
  --btn-text: #0f1b2d;
  --red: #b3261e;
  --border: #d3dbe6;
  --border-hover: #bcc7d6;
  --secondary-bg: #ffffff;
  --secondary-hover: #fff1e0;
  --ring: #e3b56e;
  --ring-strong: #d9a458;
  --glow: rgba(247, 147, 26, 0.07);
  --glow-strong: rgba(247, 147, 26, 0.16);
  --btn-glow: rgba(247, 147, 26, 0.28);
  --title-shadow: none;
  --topbar-bg: rgba(234, 239, 245, 0.92);
  --alert-bg: rgba(247, 147, 26, 0.10);
  --confirm-bg: rgba(247, 147, 26, 0.08);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-secondary: #111111;
  --card: #161616;
  --card-hover: #1c1c1c;
  --text: #ede8e2;
  --strong: #fff7ee;
  --muted: #8a8278;
  --orange: #f7931a;
  --orange-hover: #ffb347;
  --accent: #f7931a;
  --accent-hover: #ffb347;
  --btn-text: #0a0a0a;
  --red: #ff8a80;
  --border: #2a2520;
  --border-hover: #3d3529;
  --secondary-bg: #1a1612;
  --secondary-hover: #221c16;
  --ring: #7a5222;
  --ring-strong: #8a5a1f;
  --glow: rgba(247, 147, 26, 0.15);
  --glow-strong: rgba(247, 147, 26, 0.35);
  --btn-glow: rgba(247, 147, 26, 0.25);
  --title-shadow: 0 0 28px rgba(247, 147, 26, 0.35);
  --topbar-bg: rgba(10, 10, 10, 0.88);
  --alert-bg: rgba(247, 147, 26, 0.08);
  --confirm-bg: rgba(247, 147, 26, 0.06);
  color-scheme: dark;
}

:root {
  --radius: 16px;
  --radius-sm: 12px;
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font-body);
  min-height: 100vh;
}
/* soft orange glow behind the top of the page, like the official site's hero */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse 80% 45% at 50% -5%, var(--glow), transparent 70%);
}

/* top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem max(1rem, calc((100vw - 1120px) / 2));
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--text);
  text-decoration: none;
  font: 700 1.15rem var(--font-display);
  letter-spacing: -.01em;
}
/* more specific than the generic link colour below, so the wordmark stays cream like the official site */
.topbar a.brand, .topbar a.brand:hover { color: var(--text); }
.brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--ring);
  background: #fff;
}
.progress { color: var(--muted); font-size: .85rem; margin: 0; }

main { max-width: 36rem; margin: 0 auto; padding: 2rem 1rem 3rem; }

/* title block: a hero on the welcome screen, compact afterwards */
.hero { text-align: center; margin: 0 0 1.75rem; }
.hero-logo {
  display: none;
  width: 140px;
  height: 140px;
  margin: 1rem auto 1.25rem;
  border-radius: 50%;
  border: 3px solid var(--ring-strong);
  background: #fff;
  box-shadow: 0 0 40px var(--glow-strong);
}
.hero h1 {
  margin: 0;
  font: 800 1.9rem/1.1 var(--font-display);
  letter-spacing: -.03em;
  color: var(--accent);
  text-shadow: var(--title-shadow);
}
.tagline { display: none; margin: .9rem 0 0; color: var(--muted); font-size: 1.05rem; }
body[data-step="welcome"] .hero-logo { display: block; }
body[data-step="welcome"] .hero h1 { font-size: clamp(2.4rem, 9vw, 3.4rem); }
body[data-step="welcome"] .tagline { display: block; }

h2 { margin: 0 0 .6rem; font: 700 1.3rem/1.25 var(--font-display); letter-spacing: -.01em; }
h3 { font-family: var(--font-display); }
p { margin: 0 0 .9rem; }
a:not(.button) { color: var(--accent); text-underline-offset: 3px; }
a:not(.button):hover { color: var(--accent-hover); }
strong { color: var(--strong); }

/* cards */
section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.25rem 0;
}
section[hidden] { display: none; }

/* buttons: pills, like the official site */
button, .button {
  display: inline-block;
  font: 700 1rem var(--font-body);
  color: var(--btn-text);
  background: var(--orange);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .8rem 1.6rem;
  margin-top: .8rem;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 0 24px var(--btn-glow);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
button:hover:not(:disabled), .button:hover { background: var(--orange-hover); }
button:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
button.secondary, .button.secondary {
  color: var(--text);
  background: var(--secondary-bg);
  border-color: var(--border-hover);
  box-shadow: none;
}
button.secondary:hover:not(:disabled), .button.secondary:hover {
  background: var(--secondary-hover);
  border-color: var(--orange);
}
button.large { font-size: 1.1rem; padding: .95rem 1.8rem; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1rem 0 .5rem; }
.choice {
  font: 700 1.25rem var(--font-display);
  letter-spacing: -.01em;
  padding: 1.6rem .8rem;
  margin-top: 0;
  color: var(--text);
  background: var(--card-hover);
  border-color: var(--border-hover);
  border-radius: var(--radius);
  box-shadow: none;
}
.choice:hover:not(:disabled) { background: var(--secondary-hover); border-color: var(--orange); box-shadow: 0 0 24px var(--glow); }

/* forms */
label { display: block; font-weight: 600; margin: 1rem 0 .4rem; }
label:first-child { margin-top: 0; }
input, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  padding: .75rem .9rem;
}
input { font-family: var(--font-mono); letter-spacing: .03em; }
input:focus, textarea:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px var(--glow); }
input::placeholder { color: var(--muted); }
textarea { font-family: var(--font-mono); font-size: .8rem; resize: vertical; word-break: break-all; }
.hint { color: var(--muted); font-size: .85rem; margin: .4rem 0 0; }

/* The one thing users must not skip: saving the NWC secret. */
.alert {
  background: var(--alert-bg);
  border: 2px solid var(--orange);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0 0 1rem;
  box-shadow: 0 0 28px var(--glow);
}
.alert p { margin: 0 0 .5rem; }
.alert-title { font: 800 1.15rem var(--font-display); color: var(--accent); }
.alert-steps { margin: .4rem 0 0; padding-left: 1.3rem; }
.alert-steps li { margin: .3rem 0; }
.confirm {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  margin: 1.25rem 0 0;
  padding: .9rem;
  border: 2px solid var(--border-hover);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.confirm:has(input:checked) { border-color: var(--orange); background: var(--confirm-bg); }
.confirm input { width: 1.5rem; height: 1.5rem; margin: 0; flex: none; accent-color: var(--orange); }

#status { min-height: 1.5rem; margin: 0 0 .5rem; color: var(--muted); }
#status.error { color: var(--red); font-weight: 600; }

/* the QR keeps a white background and quiet zone so phones can scan it */
#qr {
  display: block;
  margin: 1rem auto 0;
  background: #fff;
  padding: 12px;
  border-radius: var(--radius);
  max-width: 100%;
  height: auto;
}

ol, ul { padding-left: 1.3rem; }
li { margin: .35rem 0; }

/* epilogue: how to load the wallet in Mostro */
.epilogue { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.epilogue h3 { margin: 0 0 .5rem; font-size: 1.2rem; color: var(--accent); }
.mostro-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  padding-left: 1.3rem;
  margin: 1rem 0;
}
.mostro-steps img {
  display: block;
  width: 100%;
  max-width: 289px;
  height: auto;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  margin-top: .6rem;
}

footer { color: var(--muted); font-size: .9rem; margin-top: 2rem; }
h2:focus { outline: none; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

@media (max-width: 380px) {
  .brand { font-size: 1rem; gap: .55rem; }
  .progress { white-space: nowrap; }
}

/* light / dark switch, on the welcome screen */
.theme-switch {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .4rem;
  margin: -.25rem 0 1rem;
  color: var(--muted);
  font-size: .85rem;
}
.theme-switch span { margin-right: .25rem; }
.seg {
  margin: 0;
  padding: .35rem .85rem;
  font-size: .85rem;
  color: var(--text);
  background: var(--secondary-bg);
  border-color: var(--border-hover);
  box-shadow: none;
}
.seg[aria-pressed="true"] {
  color: var(--btn-text);
  background: var(--orange);
  border-color: transparent;
}
