/* Brand colours from the official logo files: charcoal #2e2e38, green #009245, lime #b3e718 (accent only).
   theme.js sets data-theme="light" or "dark" on <html> before the first paint; without JavaScript the
   prefers-color-scheme block below applies the same dark values. */
:root {
  color-scheme: light;
  --ink: #1f1f27;
  --ink-strong: #2e2e38;
  --muted: #5c5c68;
  --page: #f5f6f8;
  --page-glow: rgba(0, 146, 69, .08);
  --surface: #ffffff;
  --surface-raised: #fafafb;
  --line: #e3e4e8;
  --line-strong: #cfd0d6;
  --brand: #009245;
  /* White text on #007a3a is 5.5:1 (WCAG AA at any size). */
  --primary: #007a3a;
  --primary-hover: #00662f;
  --on-primary: #ffffff;
  --link: #007a3a;
  --lime: #b3e718;
  --focus: #009245;
  --code-bg: #f0f1f4;
  --success-bg: #e6f4ec;
  --success-ink: #00632f;
  --warning-bg: #fff6e0;
  --warning-line: #e0a100;
  --warning-ink: #5c4300;
  --badge-bg: #fff3d6;
  --badge-ink: #6b4b00;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --header-bg: rgba(255, 255, 255, .85);
  --skeleton: #eceef1;
  --skeleton-shine: #f7f8fa;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6e7eb;
  --ink-strong: #f4f4f6;
  --muted: #a0a2ad;
  --page: #121318;
  --page-glow: rgba(0, 146, 69, .16);
  --surface: #1b1c23;
  --surface-raised: #22232b;
  --line: #2e2f39;
  --line-strong: #3b3c47;
  --primary: #007a3a;
  --primary-hover: #008c42;
  --link: #5fd38d;
  --focus: #b3e718;
  --code-bg: #262731;
  --success-bg: rgba(0, 146, 69, .18);
  --success-ink: #7ee2a6;
  --warning-bg: rgba(224, 161, 0, .14);
  --warning-line: #e0a100;
  --warning-ink: #f5d27a;
  --badge-bg: rgba(224, 161, 0, .16);
  --badge-ink: #f5d27a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --header-bg: rgba(27, 28, 35, .85);
  --skeleton: #262731;
  --skeleton-shine: #31323d;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --ink: #e6e7eb;
    --ink-strong: #f4f4f6;
    --muted: #a0a2ad;
    --page: #121318;
    --surface: #1b1c23;
    --line: #2e2f39;
    --link: #5fd38d;
    --code-bg: #262731;
    --header-bg: rgba(27, 28, 35, .85);
    --skeleton: #262731;
    --skeleton-shine: #31323d;
  }
  :root:not([data-theme]) .logo-light { display: none; }
  :root:not([data-theme]) .logo-dark { display: block; }
}

:root {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 100%;
  line-height: 1.55;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background:
    radial-gradient(60rem 24rem at 50% -8rem, var(--page-glow), transparent 70%),
    var(--page);
}
[hidden] { display: none !important; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 1rem; top: 1rem; z-index: 10; padding: .5rem 1rem;
  background: var(--surface); color: var(--ink); border-radius: 8px; box-shadow: var(--shadow);
}

/* ----------------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: var(--header-bg); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.site-header::before {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--lime));
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  max-width: 64rem; margin: 0 auto; padding: .625rem 1.5rem;
}
/* Logo clear space: at least the height of the wordmark's "p" (about a quarter of the lockup height). */
.brand { display: inline-flex; padding: 10px; margin-left: -10px; line-height: 0; border-radius: 8px; }
.logo { height: 40px; width: auto; }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.product {
  padding-left: 1rem; border-left: 1px solid var(--line-strong);
  font-weight: 600; font-size: 1rem; color: var(--ink-strong); letter-spacing: -.005em; white-space: nowrap;
}
.header-end { margin-left: auto; display: inline-flex; align-items: center; gap: .75rem; }
.env-badge {
  padding: .1875rem .625rem; border-radius: 999px;
  background: var(--badge-bg); color: var(--badge-ink);
  font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
}
.icon-button {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background-color .15s, border-color .15s;
}
.icon-button:hover { background: var(--surface-raised); border-color: var(--line-strong); }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* ----------------------------------------------------------------------- content */

main { flex: 1; width: 100%; max-width: 42rem; margin: 3rem auto; padding: 0 1.25rem; outline: none; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 2rem 2.25rem; margin-bottom: 1.25rem; box-shadow: var(--shadow);
}
h1 { font-size: 1.625rem; line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .75rem; color: var(--ink-strong); }
h2 { font-size: 1.125rem; letter-spacing: -.01em; margin: 1.5rem 0 .75rem; color: var(--ink-strong); }
.card > h2:first-child { margin-top: 0; }
p { margin: 0 0 1rem; }
.card > :last-child { margin-bottom: 0; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875em;
  padding: .125em .375em; border-radius: 6px; background: var(--code-bg); color: var(--ink-strong);
}
.muted { color: var(--muted); }
.terms { font-size: .875rem; color: var(--muted); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ----------------------------------------------------------------------- loading states */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.spinner {
  display: inline-block; width: 2.5rem; height: 2.5rem; flex: none; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--brand); border-right-color: var(--lime);
  animation: spin .8s linear infinite;
}
/* The first-load spinner appears only if loading takes more than a moment, so fast loads don't flash. */
.loader { display: grid; place-items: center; padding: 5rem 0; animation: fade-in .3s ease .2s both; }

.progress-card { padding-top: 2.25rem; padding-bottom: 2.25rem; }
.progress-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .5rem; }
.progress-head h1 { margin: 0; }
.progress-head .spinner { width: 1.75rem; height: 1.75rem; border-width: 3px; }
.progress-steps { list-style: none; margin: 1.5rem 0 0; padding: 1.25rem 0 0; border-top: 1px solid var(--line); display: grid; gap: .875rem; }
.progress-steps li { display: flex; align-items: center; gap: .875rem; color: var(--muted); transition: color .2s; }
.progress-steps li.active { color: var(--ink-strong); font-weight: 500; }
.progress-steps li.done { color: var(--ink); }
.step-icon {
  position: relative; width: 1.375rem; height: 1.375rem; flex: none; border-radius: 50%;
  border: 2px solid var(--line-strong); transition: background-color .2s, border-color .2s;
}
.progress-steps li.active .step-icon { border-color: var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.progress-steps li.done .step-icon { background: var(--brand); border-color: var(--brand); }
.progress-steps li.done .step-icon::after {
  content: ""; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 9px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.skeleton {
  display: block; height: .875rem; border-radius: 6px;
  background: linear-gradient(90deg, var(--skeleton) 30%, var(--skeleton-shine) 50%, var(--skeleton) 70%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-title .skeleton { height: 1.5rem; margin: .25rem 0 1.25rem; }
.skeleton.w-label { width: 6.5rem; }
.skeleton.w-25 { width: 25%; }
.skeleton.w-40 { width: 40%; }
.skeleton.w-50 { width: 50%; }
.skeleton.w-60 { width: 60%; }
.skeleton.w-70 { width: 70%; }
.details dt .skeleton, .details dd .skeleton { margin: .1875rem 0; }

/* ----------------------------------------------------------------------- buttons */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .625rem;
  font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.25;
  padding: .6875rem 1.125rem; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-strong); cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.button:hover { background: var(--surface-raised); border-color: var(--muted); text-decoration: none; }
.button.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button:disabled { opacity: .6; cursor: progress; }
.button:focus-visible, a:focus-visible, .icon-button:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.providers { display: grid; gap: .75rem; margin: 1.5rem 0; }
.providers .button {
  width: 100%; min-height: 3.25rem; padding: .75rem 1.25rem; gap: .75rem;
  font-weight: 500; font-size: 1.0625rem; color: var(--ink-strong);
  border: 1.5px solid var(--line-strong); border-radius: 10px; background: var(--surface);
}
.providers .button:hover { background: var(--surface-raised); border-color: var(--muted); }
.provider-icon { width: 22px; height: 22px; flex: none; }
.button.primary .provider-icon { color: var(--on-primary); }

/* ----------------------------------------------------------------------- account details */

.details { display: grid; grid-template-columns: max-content 1fr; margin: 1.25rem 0 1.5rem; }
.details dt, .details dd { padding: .75rem 0; border-top: 1px solid var(--line); }
.details dt { color: var(--muted); padding-right: 2rem; font-size: .9375rem; }
.details dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-strong); }
.details dt:first-of-type, .details dd:first-of-type { border-top: 0; }
.pill {
  display: inline-block; padding: .0625rem .625rem; border-radius: 999px;
  font-size: .8125rem; font-weight: 600; letter-spacing: .02em;
  background: var(--code-bg); color: var(--ink-strong);
}
.pill.ok { background: var(--success-bg); color: var(--success-ink); }

.steps { margin: 0; padding-left: 1.25rem; }
.steps li { margin-bottom: .75rem; padding-left: .25rem; }
.steps li::marker { color: var(--muted); font-weight: 600; }

.paste-code {
  display: block; margin: 1rem 0; padding: .875rem 1rem; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--code-bg);
  overflow-wrap: anywhere; user-select: all;
}
.status { min-height: 1.5em; margin: .75rem 0 0; }
.warning {
  background: var(--warning-bg); color: var(--warning-ink); border-left: 4px solid var(--warning-line);
  padding: .75rem 1rem; border-radius: 8px; font-weight: 600;
}
.placeholder { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 1rem; color: var(--muted); }
.actions { display: flex; justify-content: flex-end; }

/* ----------------------------------------------------------------------- footer */

.site-footer {
  display: flex; gap: 1.75rem; justify-content: center; flex-wrap: wrap;
  padding: 1.5rem; border-top: 1px solid var(--line); font-size: .875rem;
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink-strong); text-decoration: underline; }

@media (max-width: 36rem) {
  main { margin: 1.5rem auto; }
  .card { padding: 1.5rem 1.25rem; border-radius: 14px; }
  .header-inner { padding: .5rem 1rem; gap: .75rem; }
  .logo { height: 32px; }
  .product { display: none; }
  .details { grid-template-columns: 1fr; }
  .details dt { padding-bottom: 0; }
  .details dd { border-top: 0; padding-top: .25rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .spinner, .progress-steps li.active .step-icon { animation-duration: 2.4s; }
  .skeleton { animation: none; }
}
