/* Shared styling for the public (unauthenticated) pages: /join, /privacy,
   /terms, /sms-terms. Self-hosted and same-origin — these pages load no
   third-party scripts or styles (the opt-in form collects PII). */

:root {
  --indigo: #4f46e5;
  --indigo-dark: #4338ca;
  --ink: #111827;
  --muted: #4b5563;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  /* dvh tracks the visual viewport as mobile browser chrome collapses; the vh line
     above stays as the fallback for browsers that do not know the unit. */
  min-height: 100dvh;
  background: #f3f4f6;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  padding: 2.5rem 1rem;
  /* Join URLs and opt-in codes are long unbroken tokens; without this they push the
     page wider than the viewport and the whole document scrolls sideways. */
  overflow-wrap: break-word;
}

.card, .doc {
  background: #fff;
  margin: 0 auto;
  padding: 2rem;
  border-radius: .5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .06);
}
.card { max-width: 32rem; }   /* the opt-in form */
.doc  { max-width: 44rem; }   /* policy documents */

h1 { margin: 0 0 .25rem; font-size: 1.5rem; font-weight: 700; }
.card h1 { text-align: center; }
h2 { font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 .35rem; }
p { margin: .6rem 0; }
a { color: var(--indigo); font-weight: 500; }
a:hover { color: var(--indigo-dark); }

.subtitle {
  margin: .25rem 0 1.5rem;
  text-align: center;
  font-size: .875rem;
  font-weight: 600;
  color: var(--indigo);
}

/* ---- opt-in form ---- */
.intro { font-size: .875rem; color: var(--muted); }

.disclosures {
  margin: 1.25rem 0;
  padding: 1rem;
  background: #f9fafb;
  border-radius: .375rem;
  font-size: .75rem;
  color: #6b7280;
}
.disclosures p { margin: .25rem 0; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .875rem; font-weight: 500; color: #374151; margin-bottom: .35rem; }
.field input {
  width: 100%;
  padding: .5rem .75rem;
  font-size: 1rem;
  color: var(--ink);
  border: 1px solid #d1d5db;
  border-radius: .375rem;
  background: #fff;
}
.field input:focus { outline: 2px solid var(--indigo); outline-offset: -1px; border-color: var(--indigo); }

.consent { display: flex; align-items: flex-start; gap: .6rem; margin: 1.25rem 0; }
.consent input { margin-top: .2rem; width: 1rem; height: 1rem; flex: none; }
.consent label { font-size: .75rem; color: var(--muted); }

button {
  width: 100%;
  padding: .6rem;
  font-size: .875rem;
  font-weight: 600;
  color: #fff;
  background: var(--indigo);
  border: 0;
  border-radius: .375rem;
  cursor: pointer;
}
button:hover { background: var(--indigo-dark); }

/* CTA link styled as a button (landing page) */
.button-link {
  display: inline-block;
  padding: .6rem 1.25rem;
  font-size: .875rem;
  font-weight: 600;
  color: #fff;
  background: var(--indigo);
  border-radius: .375rem;
  text-decoration: none;
}
.button-link:hover { background: var(--indigo-dark); color: #fff; }
.cta-row { margin-top: 1.5rem; }

.notice { padding: 1rem; border-radius: .375rem; }
.notice-error { background: #fef2f2; color: #b91c1c; font-size: .875rem; }
.notice-success { background: #f0fdf4; text-align: center; }
.notice-success .lead { font-size: 1.05rem; font-weight: 600; color: #166534; margin: 0; }
.notice-success p { margin: .35rem 0 0; font-size: .875rem; color: #15803d; }

/* ---- guides ---- */
.guide-index { padding-left: 1.25rem; }
.guide-index li { margin: .6rem 0; }

.back-link { margin: 0 0 1rem; font-size: .875rem; }

.guide h2 { margin-top: 1.75rem; }
.guide h3 { font-size: .95rem; font-weight: 600; margin: 1.25rem 0 .3rem; }
.guide ul, .guide ol { padding-left: 1.4rem; margin: .6rem 0; }
.guide li { margin: .35rem 0; }

.guide blockquote {
  margin: 1rem 0;
  padding: .5rem 1rem;
  border-left: 3px solid var(--indigo);
  background: #f9fafb;
  color: var(--muted);
}
.guide blockquote p { margin: .35rem 0; }

.guide code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em;
  background: #f3f4f6;
  padding: .1rem .3rem;
  border-radius: .25rem;
}

/* display:block + overflow-x lets wide tables scroll on narrow screens
   instead of overflowing the page. */
.guide table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: .9rem;
}
.guide th, .guide td {
  padding: .5rem .6rem;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
}
.guide th { font-weight: 600; }

/* ---- narrow screens ----
   The layout is fluid everywhere above this; the only thing that genuinely breaks on a
   phone is the chrome around the content — 2rem of card padding either side of a 320px
   viewport leaves barely 3.5rem for the opt-in fields. */
@media (max-width: 30rem) {
  body { padding: 1.5rem .75rem; }
  .card, .doc { padding: 1.25rem; }
  h1 { font-size: 1.3rem; }
  .guide ul, .guide ol { padding-left: 1.1rem; }
  .guide blockquote { padding: .5rem .75rem; }
}

/* Fingers need a bigger target than a cursor does. Applied only for coarse pointers so
   the desktop button proportions are untouched. */
@media (pointer: coarse) {
  button { min-height: 2.75rem; }
  /* inline-flex, not just min-height: the link is inline-block, so extra height would
     pile up under the text instead of centring it. */
  .button-link { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .consent input { width: 1.15rem; height: 1.15rem; }
}
