/* Colours come from palette.css. This file only refers to its tokens. */
:root { --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; --head: "Inter Tight", "IBM Plex Sans", system-ui, sans-serif; }
* { box-sizing: border-box; }
html { background: var(--sunken); }
/* The same accent glow as onboarding, so signing in and setting up look like one place. */
body { --glow: 30%; --glow-edge: 12%; margin: 0; font: 14px/1.5 var(--sans); color: var(--text); -webkit-font-smoothing: antialiased;
  background: radial-gradient(900px 700px at 50% 45%, color-mix(in srgb, var(--accent) var(--glow), transparent), color-mix(in srgb, var(--accent) var(--glow-edge), transparent) 50%, transparent 78%), var(--sunken); }
:root[data-theme="dark"] body { --glow: 16%; --glow-edge: 6%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body { --glow: 16%; --glow-edge: 6%; } }
a { color: inherit; }
button, input { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.card { width: min(100%, 400px); padding: 40px 36px 28px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  box-shadow: 0 1px 2px color-mix(in oklch, var(--text) 6%, transparent), 0 24px 60px -24px color-mix(in srgb, var(--accent) 45%, transparent); text-align: center; }

.logo { display: inline-flex; align-items: flex-end; gap: 8px; margin-bottom: 28px; text-decoration: none; }
.logo img { display: block; height: 32px; width: auto; }
.logo-dark { display: none !important; }
[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark { display: block !important; }

h1 { margin: 0; font: 650 21px/1.3 var(--head); letter-spacing: -.015em; }
.subtitle { text-wrap: balance; margin: 4px 0 28px; color: var(--muted); font-size: 14px; }

.github-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 42px; padding: 0 16px;
  border: 0; border-radius: 8px; background: var(--text); color: var(--surface); font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s; }
.github-button:hover { background: color-mix(in oklch, var(--text) 86%, var(--surface)); }
.github-button:disabled { opacity: .6; cursor: wait; }
.github-button svg { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* Email is the second way in: an outlined button under the GitHub one, so GitHub stays the first choice. */
.divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--faint); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.text-input { width: 100%; height: 42px; margin: 0 0 10px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--sunken); color: inherit; font-size: 14px; }
.text-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.email-button { width: 100%; height: 42px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 8px; background: transparent; color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; }
.email-button:hover { background: var(--raised); }
.email-button:disabled { opacity: .6; cursor: wait; }

.hint { display: block; margin: 14px 0 0; color: var(--muted); font-size: 13px; }
a.hint { text-decoration: underline; text-underline-offset: 2px; }

.message { margin: 18px 0 0; color: var(--danger); font-size: 13px; }
.message.success { color: var(--success); }
.legal { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--border); color: var(--faint); font-size: 12px; text-wrap: balance; }
.legal a { white-space: nowrap; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.legal a:hover, a.hint:hover { color: var(--text); }

form { display: flex; flex-direction: column; text-align: left; }
#organization-options { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; border: 0; }
#organization-options legend { margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.organization-choice { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--raised); font-size: 14px; cursor: pointer; }
.organization-choice input, .terms-agree input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--text); }
.terms-agree { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.45; cursor: pointer; }
.terms-agree input { margin-top: 2px; }
.terms-agree a { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
#terms-panel .hint { align-self: center; }

/* A phone gets the whole screen rather than a small box: content centered, terms at the bottom, a thumb-sized button. */
@media (max-width: 480px) {
  .page { display: block; padding: 0; }
  .card { width: 100%; min-height: 100svh; display: flex; flex-direction: column; border: 0; border-radius: 0;
    background: transparent; box-shadow: none; padding: 48px 24px calc(20px + env(safe-area-inset-bottom)); }
  .card > * { flex: none; }
  .logo { align-self: center; margin: auto 0 32px; }
  .logo img { height: 44px; }
  h1 { font-size: 26px; }
  .subtitle { font-size: 15px; margin-bottom: 36px; }
  .github-button, .email-button { height: 50px; border-radius: 12px; font-size: 16px; }
  .text-input { height: 50px; border-radius: 12px; font-size: 16px; }
  .legal { margin-top: auto; padding-top: 32px; border-top: 0; }
}
@media (prefers-reduced-motion: reduce) { .github-button, .email-button { transition: none; } }
.code-label { display: block; margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.code-input { width: 100%; height: 44px; margin: 0 0 14px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--sunken); color: inherit; font: inherit; font-size: 20px; letter-spacing: .3em; text-align: center; }
.code-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Connecting GitHub, when more than one account has the Perch app and none is connected yet. */
.github-choices { display: grid; gap: 8px; margin: 0 0 4px; text-align: left; }
a.organization-choice { font-weight: 600; text-decoration: none; }
a.organization-choice:hover { border-color: var(--border-strong); }
/* With no legal line to hold the bottom of a phone screen, the last link does, so the choice stays centered. */
@media (max-width: 480px) { .github-choices ~ .hint { margin-bottom: auto; } }
