/* Eden's sign-in page (askeden.com/signin), and the provider callbacks' result pages
   (.card, .orb, h1, .lead, .button): the Atelier look of Eden itself, in Liquid Glass. */
:root {
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.12);
  --orb: linear-gradient(135deg, #3fb8f2, #1677c9);
  --bg: #f5f5f7;
  --wash1: rgba(216, 232, 250, 0.9);
  --wash2: rgba(251, 244, 236, 0.9);
  --text: #1d1d1f;
  --text2: #6e6e73;
  --text3: #86868b;
  --glass: rgba(255, 255, 255, 0.62);
  --inset: rgba(255, 255, 255, 0.55);
  --rim: rgba(255, 255, 255, 0.6);
  --hairline: rgba(0, 0, 0, 0.07);
  --warn: #c93400;
  --warn-soft: rgba(255, 159, 10, 0.12);
  --ok: #248a3d;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 24px 64px rgba(0, 0, 0, 0.14);
  /* Apple: black on light; Google: its light theme (#fff, #747775 stroke, #1f1f1f text) */
  --apple-bg: #000;
  --apple-fg: #fff;
  --google-bg: #fff;
  --google-line: #747775;
  --google-fg: #1f1f1f;
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161618;
    --wash1: rgba(20, 42, 66, 0.55);
    --wash2: rgba(30, 26, 20, 0.5);
    --text: #f5f5f7;
    --text2: #a1a1a6;
    --text3: #8e8e93;
    --glass: rgba(32, 32, 34, 0.62);
    --inset: rgba(255, 255, 255, 0.04);
    --rim: rgba(255, 255, 255, 0.14);
    --hairline: rgba(255, 255, 255, 0.1);
    --warn: #ff9f0a;
    --ok: #30d158;
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 64px rgba(0, 0, 0, 0.55);
    /* Apple: white on dark; Google: its dark theme (#131314, #8e918f stroke, #e3e3e3 text) */
    --apple-bg: #fff;
    --apple-fg: #000;
    --google-bg: #131314;
    --google-line: #8e918f;
    --google-fg: #e3e3e3;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 56px 16px 32px;
  font: 400 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  letter-spacing: -0.1px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word; /* a long word wraps rather than overflows; never break-all (mid-word cuts) */
}
/* Dynamic Type on iPhone and iPad (R2C-22): the text follows the system's text size, in Safari and in
   the Eden apps' web view. `-webkit-touch-callout` is iOS-only, so desktop Safari (whose
   -apple-system-body is 13px) keeps 15px. The sizes below are em, so they scale with it. */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  html { font: -apple-system-body; }
  body { font-size: 1rem; }
}
/* The Eden Android app (it adds .eden-android): the iPhone app's 17 px body (Dynamic Type's default), so the
   page reads the same on both phones. */
html.eden-android { font-size: 17px; }
html.eden-android body { font-size: 1rem; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 620px at 8% -10%, var(--wash1), transparent 60%),
    radial-gradient(900px 700px at 105% 115%, var(--wash2), transparent 60%);
}
a { color: var(--accent); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px; }
.way:focus-visible { border-radius: 999px; }

.home {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: inset 0 0.5px 0 var(--rim), inset 0 0 0 0.5px var(--hairline);
}
.home:hover { color: var(--text); }

.card {
  width: min(460px, 100%);
  padding: 36px 32px 26px;
  border-radius: 28px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: var(--shadow), inset 0 0.5px 0 var(--rim), inset 0 0 0 0.5px var(--hairline);
  text-align: center;
  animation: rise 0.5s var(--spring);
}
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(0.99); } }
.orb {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  /* The Ask Eden mark (askeden.com's, as in Eden's own .orb): navy with a white mark; flipped in dark mode. */
  border-radius: 26%;
  background: #0e2747 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='43 81 410 422'%3E%3Cg fill='%23ffffff' stroke='%23ffffff' stroke-width='18' stroke-linejoin='round'%3E%3Cpolygon points='211%2C93 314%2C90 444%2C236 343%2C353 249%2C352 333%2C251'/%3E%3Cpolygon points='252%2C235 160%2C346 282%2C491 186%2C494 52%2C350 151%2C234'/%3E%3C/g%3E%3C/svg%3E") center / 56% no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 2px 12px rgba(14, 39, 71, 0.3);
}
@media (prefers-color-scheme: dark) {
  .orb {
    background: #f4f5f7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='43 81 410 422'%3E%3Cg fill='%230E2747' stroke='%230E2747' stroke-width='18' stroke-linejoin='round'%3E%3Cpolygon points='211%2C93 314%2C90 444%2C236 343%2C353 249%2C352 333%2C251'/%3E%3Cpolygon points='252%2C235 160%2C346 282%2C491 186%2C494 52%2C350 151%2C234'/%3E%3C/g%3E%3C/svg%3E") center / 56% no-repeat;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 12px rgba(0, 0, 0, 0.35);
  }
}
@keyframes breathe { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.08); } }
h1 { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -0.4px; }
.lead { margin-top: 8px; color: var(--text2); }

.alert {
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.9em;
  text-align: left;
  color: var(--text);
  background: var(--warn-soft);
  box-shadow: inset 0 0 0 0.5px rgba(255, 159, 10, 0.35);
}

/* ── the ways in ── */
.ways {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}
.ways[aria-busy="true"] { min-height: 44px; }
.way {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  font: 500 16px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  letter-spacing: -0.2px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s var(--spring), filter 0.15s;
}
.way:hover { filter: brightness(1.08); }
.way:active { transform: scale(0.98); }
.way svg { flex: none; width: 18px; height: 18px; }
.way.apple { color: var(--apple-fg); background: var(--apple-bg); }
.way.apple svg { width: 19px; height: 19px; margin-top: -2px; }
.way.google { color: var(--google-fg); background: var(--google-bg); box-shadow: inset 0 0 0 1px var(--google-line); }
.way.google:hover { filter: none; background-image: linear-gradient(rgba(127, 127, 127, 0.08), rgba(127, 127, 127, 0.08)); }
.way.phone {
  color: var(--text);
  background: var(--inset);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: inset 0 0.5px 0 var(--rim), inset 0 0 0 0.5px var(--hairline), 0 1px 3px rgba(0, 0, 0, 0.06);
}
/* this browser's last way in: said above the buttons, and that button ringed (outside it: Apple's and Google's own looks stay) */
.lastway { margin-top: 18px; font-size: 0.9em; color: var(--text2); }
.way.last { outline: 2px solid var(--accent); outline-offset: 3px; }
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 320px;
  margin: 4px 0;
  color: var(--text3);
  font-size: 12px;
}
.or::before, .or::after { content: ""; flex: 1; height: 0.5px; background: var(--hairline); }

/* ── Approve from your iPhone ── */
.link {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  background: var(--inset);
  box-shadow: inset 0 0.5px 0 var(--rim), inset 0 0 0 0.5px var(--hairline);
  text-align: left;
  animation: rise 0.4s var(--spring);
}
.link h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }
.link h2:focus { outline: none; }
.qr {
  flex: none;
  width: 148px;
  height: 148px;
  padding: 6px;
  border-radius: 12px;
  background: #fff; /* a QR code wants dark on light, in dark mode too */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.qr svg { display: block; width: 100%; height: 100%; }
.qr.used svg { opacity: 0.15; }
.steps { min-width: 0; }
.how { margin-top: 4px; font-size: 0.9em; color: var(--text2); }
.how b { color: var(--text); font-weight: 600; }
.path { color: var(--text); white-space: nowrap; }
.code {
  margin-top: 10px;
  font: 600 30px/1.1 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.06em;
  user-select: all;
}
.status { margin-top: 8px; min-height: 1.45em; font-size: 0.867em; color: var(--text3); }
.status.warn { color: var(--warn); }
.status.ok { color: var(--ok); }

/* a plain button: "Get a new code", and the result pages' "Continue to Eden" */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  margin-top: 12px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font: 600 14px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  text-decoration: none;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
}
.button.ghost { color: var(--accent); background: var(--accent-soft); }
.button:hover { filter: brightness(1.06); }
.card > p > .button { margin-top: 20px; }
/* the new-account question (session.js choicePage): its two answers, one under the other */
.choice .lead + .lead { margin-top: 10px; }
.choice form .button { margin-top: 10px; }

.fine, .legal-links { font-size: 0.8em; color: var(--text3); overflow-wrap: break-word; hyphens: auto; text-wrap: pretty; }
.fine { margin-top: 24px; }
/* the footer's links wrap as whole items at large text sizes (R2C-22) */
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 0.35em; margin-top: 10px; }
.legal-links a, .fine a { color: inherit; }
/* Turnstile's widget (its own frame) and "Create an account with a passkey" */
.human { display: flex; justify-content: center; margin-top: 14px; min-height: 65px; }
/* The shared test account's form (TEST_LOGIN): shown only when the server says it's on */
.testlogin { display: grid; gap: 6px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hairline); text-align: left; }
.testlogin[hidden] { display: none; }
.testlogin-title { margin: 0 0 4px; font-size: 0.867em; color: var(--text2); }
.testlogin label { font-size: 0.8em; color: var(--text2); }
.testlogin input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--hairline); background: var(--inset); color: var(--text); min-width: 0; }
.testlogin .button { margin-top: 8px; }
.newpk { margin-top: 12px; font-size: 0.867em; color: var(--text2); }
.textlink { border: 0; padding: 0; background: none; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* /privacy and /terms (src/eden/legal.js): the same card, wider, for reading */
.card.legal { width: min(720px, 100%); text-align: left; margin: 24px 0; }
.legal h1 { margin-bottom: 4px; }
.legal .eff { font-size: 13px; color: var(--text3); margin-bottom: 18px; }
.legal h2 { margin: 22px 0 8px; font-size: 17px; letter-spacing: -0.2px; }
.legal p, .legal li { font-size: 15px; line-height: 1.55; color: var(--text2); }
.legal p + p { margin-top: 10px; }
.legal ul { margin: 6px 0 0 20px; }
.legal li + li { margin-top: 6px; }
.legal a { color: var(--accent); }
.legal .note { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--text); }

@media (max-width: 480px) {
  body { padding-top: 64px; }
  .card { padding: 28px 20px 22px; border-radius: 24px; }
  .link { flex-direction: column; text-align: center; }
  .qr { width: 168px; height: 168px; }
}
/* Very narrow (a small phone, or Safari's largest text zoom): less padding, so the text keeps its width (R2C-22). */
@media (max-width: 360px) {
  body { padding: 56px 8px 24px; }
  .card { padding: 22px 14px 18px; border-radius: 20px; }
  .link { padding: 14px 10px; }
  .qr { width: min(168px, 100%); height: auto; aspect-ratio: 1; }
  .home { position: absolute; } /* not over the card when the text is huge */
}
@media (prefers-reduced-motion: reduce) {
  .orb, .card, .link { animation: none; }
  .way { transition: none; }
  .way:active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .card, .home { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
