/* Bitcoinist Creator Agreement — signing page.
   Reuses the beta site's design tokens, dark theme, and legal-page layout so
   it feels like part of the Bitcoinist family. Single centered reading column
   with the agreement text, followed by the sign-and-download form. */

:root {
  --bg: #0a0a0a;
  --surface-1: #0f0f0f;
  --surface-2: #141414;
  --line: #1f1f21;
  --line-soft: rgba(255, 255, 255, 0.1);
  --line-accent: #86432c;

  --text: #f4f4f4;
  --text-2: #f4f4f4cc;
  --text-3: #f4f4f466;

  --orange: #e76a22;
  --bitcoin: #f7931a;
  --green: #21c068;
  --danger: #ff6b6b;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-card: 14px;
  --gutter: clamp(20px, 5vw, 80px);
  --shadow-brand: 0 16px 32px rgba(231, 106, 34, 0.28);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* The `hidden` attribute must beat our explicit `display` rules below
   (e.g. .success-box/.sign-form use display:flex), otherwise a hidden
   element still shows. Keeps the success box hidden until someone signs,
   and hides the form after they do. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Ambient background (glow + particles) ---------- */
/* Fixed layer behind all content. Content sits above via z-index below. */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Orange wash rising from the bottom-centre — same hue as the main site's
   "Stand Out" glow (rgb 231,106,34 = --orange). */
.bg-glow {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: clamp(420px, 70vh, 860px);
  background: radial-gradient(
    ellipse 65% 62% at 50% 100%,
    rgba(231, 106, 34, 0.42) 0%,
    rgba(231, 106, 34, 0.22) 28%,
    rgba(231, 106, 34, 0.08) 55%,
    rgba(231, 106, 34, 0) 82%
  );
}

.particles {
  position: absolute;
  inset: 0;
}

/* Each particle: a tiny white dot that drifts slowly upward while twinkling.
   left/top/size/opacity/timing are set inline per-dot by app.js. */
.particle {
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
  --drift: 0vw;
  animation:
    particleDrift var(--duration, 18s) linear infinite,
    particleTwinkle 3.2s ease-in-out infinite;
  will-change: transform, opacity;
}

@keyframes particleDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(var(--drift), -100vh, 0);
  }
}

@keyframes particleTwinkle {
  0%,
  100% {
    filter: brightness(0.85);
  }
  50% {
    filter: brightness(1.35);
  }
}

@media (prefers-reduced-motion: reduce) {
  .particle {
    animation: none;
  }
}

/* Keep all real content above the ambient background layer. */
.nav,
.creator-page,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ---------- Nav ---------- */
.nav {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  height: 26px;
  width: auto;
  display: block;
}

.nav-tag {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  padding: 6px 12px;
  border: 1px solid var(--line-accent);
  border-radius: 999px;
}

/* ---------- Page shell ---------- */
.creator-page {
  position: relative;
  padding: 56px 0 96px;
}

.legal-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* ---------- Agreement header + body ---------- */
.legal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.legal-eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0;
  color: var(--orange);
}

.legal-title {
  font-family: var(--sans);
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.legal-effective {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text-2);
  margin: 4px 0 0;
}

.legal-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Boxed, scrollable agreement so the form stays reachable on long contracts. */
.agreement-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 28px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.legal-intro {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 0;
}

.legal-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legal-section-title {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
  color: var(--text);
}

.legal-text {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
  margin: 0;
}

.legal-text strong {
  color: var(--text);
  font-weight: 500;
}

/* ---------- Sign form ---------- */
.sign-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.sign-form .legal-text {
  margin-bottom: 4px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.field-hint {
  font-size: 12px;
  color: var(--text-3);
  margin: 2px 0 0;
}

.input {
  width: 100%;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: var(--text-3);
}

.input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(231, 106, 34, 0.18);
}

.input-area {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-2);
  cursor: pointer;
}

.consent-check input {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--orange);
  flex-shrink: 0;
  cursor: pointer;
}

.form-error {
  margin: 0;
  font-size: 14px;
  color: var(--danger);
}

/* ---------- Buttons ---------- */
.button {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  padding: 14px 22px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, opacity 0.15s ease;
}

.button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.button-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.button-primary:hover {
  background: #f2792f;
}

.button-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--line-accent);
}

.button-full {
  width: 100%;
}

/* ---------- Success ---------- */
.success-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 40px 28px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
}

.success-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 26px;
  color: #fff;
  background: var(--green);
}

.success-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  margin-top: 8px;
}

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px 32px;
}

.footer-inner .brand-logo {
  height: 22px;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 24px;
}

.footer-legal a {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-legal a:hover {
  color: var(--text);
}

.footer-copy {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text-3);
  margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 767px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .creator-page {
    padding: 36px 0 72px;
  }

  .legal-container {
    gap: 32px;
  }

  .agreement-body,
  .sign-form {
    padding: 20px;
  }

  .legal-intro,
  .legal-text {
    font-size: 14px;
  }
}
