/* Leap Studio · sign in (v12).
   Self-contained (the app's /css is behind auth); tokens copied from ui-styles/base.css.
   Fonts in /fonts are served without a session for this page only. */
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/instrument-serif.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url(/fonts/instrument-serif-italic.woff2) format('woff2'); }
/* Sign-in uses the platform's native UI font; no authenticated font dependency. */

:root {
  --window: #f4f1ec; --paper: #ffffff; --wash: #f0ece6; --fill: rgba(60, 52, 40, .09); --fill-2: rgba(60, 52, 40, .16);
  --ink: #16130f; --ink-2: #3d3a35; --muted: #69645c; --faint: #a9a49c;
  --line: rgba(0, 0, 0, .08); --line-2: rgba(0, 0, 0, .14);
  --accent: #126dff; --accent-hover: #055fe8; --accent-ink: #0d54c6; --accent-50: #f0f5ff; --accent-100: #d9e7fe; --accent-tint: rgba(18, 109, 255, .1);
  --bad: #c21821; --bad-50: #fef0ee;
  --serif: 'Instrument Serif', 'New York', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', Inter, 'Helvetica Neue', sans-serif;
  --t-xs: 11px; --t-sm: 12.5px; --t-base: 14px; --t-md: 16px; --t-2xl: 34px;
  --s-1: 4px; --s-2: 6px; --s-3: 8px; --s-4: 12px; --s-5: 16px; --s-6: 24px; --s-7: 40px; --s-8: 64px;
  --r-xs: 5px; --r-sm: 8px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --shadow-raised: 0 0 0 .5px rgba(0, 0, 0, .06), 0 2px 4px rgba(0, 0, 0, .05), 0 12px 28px -10px rgba(0, 0, 0, .14);
  --control-h: 44px;
  --ease: cubic-bezier(.25, .1, .25, 1); --d-fast: 150ms;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--window); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s-6) var(--s-5); font: 400 var(--t-base)/1.45 var(--sans); letter-spacing: -.006em; -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; border-radius: var(--r-xs); }
::selection { background: var(--accent-100); }

/* One centred card on window gray. */
.sign { width: 100%; max-width: 420px; display: grid; gap: var(--s-5); }
.card { padding: var(--s-7) var(--s-7) var(--s-6); border-radius: var(--r-xl); background: var(--paper); box-shadow: var(--shadow-raised); }
.card-top { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-6); }
.brand { display: block; }
.brand img { display: block; width: auto; height: 22px; filter: brightness(0); }
.tool { padding: 2px var(--s-2); border-radius: var(--r-xs); background: var(--accent-tint); color: var(--accent-ink); font: 600 var(--t-xs)/1.3 var(--sans); }
.card h1 { font: 400 var(--t-2xl)/1.05 var(--serif); letter-spacing: -.01em; }
.card h1 em { font-style: italic; color: var(--accent); }
.lede { margin: var(--s-3) 0 var(--s-6); color: var(--muted); }

.google { display: grid; gap: var(--s-5); margin-bottom: var(--s-5); }
.divider { display: flex; align-items: center; gap: var(--s-4); font-size: var(--t-sm); color: var(--muted); }
.divider::before, .divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }

form { display: grid; }
/* Inset-grouped fields: one rounded box, hairline between rows. */
.fields { border: 1px solid var(--line-2); border-radius: var(--r); background: var(--paper); overflow: hidden; transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease); }
.fields:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 25%, transparent); }
.field { position: relative; display: grid; gap: 2px; padding: var(--s-3) var(--s-4) var(--s-2); cursor: text; }
.field + .field { border-top: 1px solid var(--line); }
.field > span, .field > label { font: 500 var(--t-xs)/1.2 var(--sans); color: var(--muted); }
.field input { width: 100%; height: 26px; padding: 0; border: 0; outline: 0; background: none; font-size: 16px; }
.password-field input { padding-right: 64px; }
.password-field button {
  position: absolute; right: var(--s-3); top: 50%; height: 30px; padding: 0 var(--s-3); transform: translateY(-50%);
  border: 0; border-radius: var(--r-sm); background: none; font: 500 var(--t-sm)/1 var(--sans); color: var(--accent-ink); cursor: pointer;
}
.password-field button:hover { background: var(--accent-tint); }
.error { min-height: 20px; margin: var(--s-3) 0 var(--s-2); font-size: var(--t-sm); color: var(--bad); }
.error:empty { min-height: var(--s-4); margin: 0; }

.submit {
  display: flex; align-items: center; justify-content: center; width: 100%; height: var(--control-h); padding: 0 var(--s-5);
  border: 0; border-radius: var(--r); background: var(--accent); color: #fff;
  font: 600 var(--t-md)/1 var(--sans); letter-spacing: -.01em; text-decoration: none; cursor: pointer;
  transition: background-color var(--d-fast) var(--ease), transform var(--d-fast) var(--ease);
}
.submit:hover { background: var(--accent-hover); text-decoration: none; }
.submit:active:not(:disabled) { transform: scale(.98); }
.submit:disabled { opacity: .5; cursor: wait; }
.submit.is-secondary { background: var(--fill); color: var(--ink); font-weight: 500; }
.submit.is-secondary:hover { background: var(--fill-2); }

.foot { text-align: center; font-size: var(--t-sm); color: var(--muted); }

/* Google setup/connect page (src/google-oidc.js): the same card, longer content. */
.google-setup { max-width: 620px; padding: var(--s-7); border-radius: var(--r-xl); background: var(--paper); box-shadow: var(--shadow-raised); }
.google-setup h1 { margin-bottom: var(--s-5); font: 400 var(--t-2xl)/1.05 var(--serif); }
.google-setup h2 { margin: var(--s-6) 0 var(--s-3); font: 600 var(--t-md)/1.25 var(--sans); }
.google-setup p { margin-bottom: var(--s-4); overflow-wrap: anywhere; }
.google-setup button { min-height: var(--control-h); padding: 0 var(--s-5); border: 0; border-radius: var(--r); background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.google-setup button:hover { background: var(--accent-hover); }
.google-setup button:disabled { opacity: .5; cursor: wait; }
.google-setup > a { display: inline-block; margin-top: var(--s-5); }
.google-setup .setup-hint { margin-top: var(--s-4); color: var(--muted); font-size: var(--t-sm); }
.google-setup #status { padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); background: var(--bad-50); color: var(--bad); }
.google-setup #status:empty { display: none; }

@media (max-width: 560px) {
  body { place-items: start center; padding-top: var(--s-7); }
  .card { padding: var(--s-6) var(--s-5) var(--s-5); }
  .card h1 { font-size: 30px; }
  .google-setup { padding: var(--s-6) var(--s-5); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
