/* The www.rootsofreason.org look for the auth origin's own pages.
 *
 * Values come from the site's own stylesheets, not from impressions of them:
 *   tokens.css      colors, radii, shadows, type stacks, focus ring
 *   typography.css  headings in Palatino, weight 400, sage green
 *   buttons.css     .btn, .btn-primary, .btn-secondary
 *   forms.css       .form label and input
 *   cards.css       .card
 * The class names are the ones signin.html and the account pages already use, so
 * one markup serves both looks. Palatino is self-hosted as TeX Gyre Pagella, as the
 * site does it; Gentium Plus is named first and falls back to Georgia, as on the
 * site. Nothing here loads from another origin.
 */

@font-face{font-family:palatino;src:url('/fonts/texgyrepagella-regular.woff') format('woff');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:palatino;src:url('/fonts/texgyrepagella-italic.woff') format('woff');font-weight:400;font-style:italic;font-display:swap}
@font-face{font-family:palatino;src:url('/fonts/texgyrepagella-bold.woff') format('woff');font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:palatino;src:url('/fonts/texgyrepagella-bolditalic.woff') format('woff');font-weight:700;font-style:italic;font-display:swap}

:root {
  --ink: #233226;
  --body: #354a3b;
  --brand: #2f6b45;
  --card: #fff;
  --line: #e7e1cf;
  --sage-green: #265c2f;
  --sage-dark: #0f2f1d;
  --sage-light: #487c42;
  --dark-green: #1e4423;
  --accent-gold-text: #82621a;
  --parchment-light: #f7f4ec;
  --parchment-dark: #f3e8d6;
  --cream: #f5f1e8;
  --beige: #ede6d6;
  --warm-white: #f7f4ec;
  --text-dark: #2d3a2d;
  --text-muted: #5b6b5d;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-md: 0 2px 8px rgb(0 0 0 / 8%);
  --text-sm: clamp(14px, 1.8vw, 16px);
  --text-base: clamp(16px, 2vw, 18px);
  --text-xl: clamp(22px, 3vw, 28px);
  --space-component: clamp(16px, 3vw, 32px);
  --font-palatino: palatino, 'Palatino Linotype', 'Book Antiqua', georgia, serif;
  --font-gentium: 'Gentium Plus', georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-gentium);
  font-size: 18px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--text-dark);
  background: radial-gradient(ellipse at center,
    var(--parchment-light) 0%,
    var(--parchment-light) 40%,
    var(--parchment-dark) 90%,
    var(--parchment-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

a { color: var(--brand); }
a:hover { color: var(--dark-green); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 2px;
}

.page { width: 100%; max-width: 460px; }

.masthead { text-align: center; margin-bottom: 20px; }

.mark {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}
.mark svg { width: 30px; height: 30px; color: var(--sage-green); }
.mark.gradient { background: var(--sage-green); border-color: var(--sage-green); }
.mark.gradient svg { color: #fff; }

.masthead h1 {
  font-family: var(--font-palatino);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.2;
  color: var(--sage-green);
  margin: 0 0 4px;
}
.masthead p { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-component);
  box-shadow: var(--shadow-md);
}

.card h2 {
  font-family: var(--font-palatino);
  font-weight: 400;
  font-size: var(--text-xl);
  line-height: 1.2;
  color: var(--sage-green);
  margin: 0 0 6px;
}
.card > p, .card form > p, .card div > p { margin: 0 0 16px; color: var(--body); font-size: var(--text-base); }

.field { margin-bottom: 16px; }
.field label, .field legend {
  display: block;
  font-weight: 500;
  font-size: 1.05rem;
  color: var(--text-dark);
  margin-bottom: 6px;
}
fieldset.field { border: 0; padding: 0; margin: 0 0 16px; }

.input, select.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--beige);
  border-radius: var(--radius-sm);
  font-family: var(--font-gentium);
  font-size: 1rem;
  color: var(--text-dark);
  background: var(--warm-white);
  transition: all 0.3s;
}
.input:focus {
  outline: none;
  border-color: var(--sage-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgb(74 103 65 / 10%);
}
.input.error { border-color: var(--accent-gold-text); }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

.hint, .card .hint { font-size: var(--text-sm); color: var(--text-muted); margin: 6px 0 0; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0.85em 2em;
  border: 2px solid var(--sage-green);
  border-radius: var(--radius-sm);
  background: var(--sage-green);
  color: #fff;
  font-family: var(--font-gentium);
  font-weight: 600;
  font-size: var(--text-base);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn:hover:not(:disabled) { background: var(--dark-green); border-color: var(--dark-green); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 0.7em 1.5em;
  border: 2px solid var(--sage-green);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--sage-green);
  font-family: var(--font-gentium);
  font-weight: 600;
  font-size: var(--text-sm);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-outline:hover:not(:disabled) { background: var(--sage-green); color: #fff; }
.btn-outline:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline svg { width: 17px; height: 17px; flex: none; }
.btn-outline[aria-pressed="true"] { background: var(--sage-green); color: #fff; }

.choices { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin: 0 0 16px; }
.choices .btn-outline { margin: 0; }
#nameChoices { grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }

.check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; font-size: var(--text-sm); }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--sage-green); flex: none; }

.swap { text-align: center; font-size: var(--text-sm); color: var(--text-muted); margin: 16px 0 0; }
.swap a { font-weight: 600; cursor: pointer; }

.notice {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--accent-gold-text);
  background: var(--cream);
  color: var(--text-dark);
  font-size: var(--text-sm);
}

.codes {
  list-style: none;
  margin: 0 0 16px;
  padding: 14px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink);
  text-align: center;
}

.divider { display: flex; align-items: center; gap: 14px; margin: 20px 0; color: var(--text-muted); font-size: var(--text-sm); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.helpline, .foot { text-align: center; font-size: var(--text-sm); color: var(--text-muted); margin: 16px 0 0; }
.helpline a { font-weight: 600; cursor: pointer; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgb(15 47 29 / 55%);
  display: grid;
  place-items: center;
  padding: 24px 16px;
  z-index: 70;
}
.overlay .card { max-width: 420px; text-align: center; }

.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); margin: 0 0 12px; }
.table th { text-align: left; font-weight: 600; color: var(--text-dark); padding: 6px 8px 6px 0; vertical-align: top; width: 40%; }
.table td { padding: 6px 0; color: var(--body); border-top: 1px solid var(--line); }
.table tr:first-child td, .table tr:first-child th { border-top: 0; }
.table th { border-top: 1px solid var(--line); }

.stack > * + * { margin-top: 16px; }
.danger { border-color: var(--accent-gold-text); color: var(--accent-gold-text); }
.danger:hover:not(:disabled) { background: var(--accent-gold-text); border-color: var(--accent-gold-text); color: #fff; }

[hidden] { display: none !important; }
.flush { margin: 0 !important; }
.spaced { margin-top: 16px; }
.inline { display: inline; }
