/* The /connect page (seam R3b). Tokens and sizes are R5's connector.css, which is the page
   standard for this program; they are repeated here rather than imported because R5's
   stylesheet is on its own branch and this page must render on its own. When both have
   landed, this file becomes a link to connector.css and nothing else.

   Phone first: this page is opened from a chat on a phone, and that is the only layout that
   has to be perfect. No Rails vocabulary in any copy a person reads. */

:root {
  --ground: #f7f6f3;
  --raised: #fffefb;
  --ink: #1b1b1a;
  --muted: #6b6a66;
  --hairline: #e6e4df;
  --accent: #2e8b57;
  --accent-ink: #ffffff;
  --warning: #b7791f;
  --radius: 12px;
  --tap: 44px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #111110;
    --raised: #1a1a18;
    --ink: #f2f1ee;
    --muted: #9b9a95;
    --hairline: #2a2927;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
  padding: max(env(safe-area-inset-top), 12px) var(--gutter) max(env(safe-area-inset-bottom), 24px);
  min-height: 100vh;
  min-height: 100dvh;
}

main { max-width: 560px; margin: 0 auto; }

h1 { font-size: 28px; font-weight: 600; line-height: 1.2; margin: 0 0 8px; }
p { margin: 0 0 12px; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.caption { font-size: 13px; color: var(--muted); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] { display: none !important; }

.top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }

.state { padding: 32px 0; color: var(--muted); }

.skeleton {
  height: 14px;
  border-radius: 7px;
  background: var(--hairline);
  margin-bottom: 12px;
  animation: pulse 1.4s ease-in-out infinite;
}
.skeleton.wide { width: 100%; }
.skeleton.half { width: 55%; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; }
  * { transition: none !important; }
}

/* -- what the app will be able to reach ------------------------------------------------------ */

.scopes {
  list-style: none;
  margin: 24px 0;
  padding: 0;
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

.scopes li {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
}
.scopes li:last-child { border-bottom: none; }

/* -- controls -------------------------------------------------------------------------------- */

.actions { display: flex; flex-direction: column; gap: 8px; }

button, .button {
  font: inherit;
  min-height: var(--tap);
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--raised);
  color: var(--ink);
  padding: 12px 16px;
  cursor: pointer;
  transition: opacity 200ms ease-out, background 200ms ease-out;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

button:disabled { opacity: 0.45; cursor: default; }

.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
  font-weight: 600;
  text-decoration: none;
}

.secondary { background: transparent; }

/* -- an honest refusal ----------------------------------------------------------------------- */

.refusal {
  background: var(--raised);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 24px;
}
.refusal h1 { font-size: 20px; }
.refusal p { color: var(--muted); }
.refusal .code { font-size: 13px; color: var(--muted); margin: 16px 0 0; }

#status:not(:empty) { margin-top: 16px; color: var(--warning); }

footer {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}
footer a { min-height: var(--tap); display: inline-flex; align-items: center; font-size: 13px; }
