/*
 * Brand tokens (Stage 3 of plans/template-platform-plan.md): `--brand-primary`, `--brand-accent`
 * and `--brand-font` are the FIXED contract every LaunchPad's app links to via `_brand-tokens.css`
 * (see services/launchpad/launchpad-branding.service.ts) — this file only supplies the neutral
 * DEFAULT values so a LaunchPad with no `_brand-tokens.css` yet (or a load failure) still renders
 * correctly. `_brand-tokens.css` is loaded AFTER this stylesheet in index.html, so its `:root`
 * values win once written.
 */
:root {
  --brand-primary: #14181f;
  --brand-accent: #5b6b8c;
  --brand-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --brand-logo-url: none;

  --accent: var(--brand-accent);
  --accent-soft: color-mix(in srgb, var(--brand-accent) 12%, white);
  --ink: var(--brand-primary);
  --muted: #6b7280;
  --line: #e7e9ee;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ok: #12b76a;
  --shadow: 0 18px 50px -20px rgba(20, 24, 31, 0.28);
  --font: var(--brand-font);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  display: grid;
  place-items: center;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Soft animated brand glow behind the card */
.aurora {
  position: fixed;
  inset: -30vmax;
  background:
    radial-gradient(38vmax 38vmax at 25% 30%, rgba(239, 79, 38, 0.18), transparent 60%),
    radial-gradient(34vmax 34vmax at 78% 72%, rgba(239, 79, 38, 0.12), transparent 60%);
  filter: blur(6px);
  animation: drift 18s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

.stage {
  position: relative;
  z-index: 1;
  width: min(92vw, 560px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  text-align: center;
}

/* Renders the uploaded brand logo when set; falls back to nothing (no broken-image box) when
   `--brand-logo-url` is `none` — a graceful fallback, per Stage 3's logo-slot contract. */
.brand .logo {
  height: 34px;
  width: 120px;
  opacity: 0.92;
  background-image: var(--brand-logo-url);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
}

.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 40px 34px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Rocket in a haloed disc */
.rocket-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.rocket-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent-soft);
}

.rocket {
  position: relative;
  width: 44px;
  height: 44px;
  color: var(--accent);
  animation: bob 3s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-5px) rotate(2deg); }
}

/* Expanding rings - a gentle "signal is live" pulse */
.rings span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: ping 3s ease-out infinite;
}
.rings span:nth-child(2) { animation-delay: 1s; }
.rings span:nth-child(3) { animation-delay: 2s; }

@keyframes ping {
  0%   { transform: scale(0.7); opacity: 0.5; }
  80%  { opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(18, 183, 106, 0.1);
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.5);
  animation: heartbeat 1.8s ease-out infinite;
}
@keyframes heartbeat {
  0%   { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(18, 183, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); }
}

h1 {
  margin: 16px 0 8px;
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 .accent { color: var(--accent); }

.sub {
  margin: 0 0 22px;
  max-width: 42ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}
.sub strong { color: var(--ink); font-weight: 600; }

.checks {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.checks li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13.5px;
  color: var(--muted);
  opacity: 0.5;
  transform: translateX(-4px);
  transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}
.checks li::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line);
  background-size: 11px 11px;
  background-position: center;
  background-repeat: no-repeat;
  transition: all 0.35s ease;
}
.checks li.ok {
  opacity: 1;
  transform: translateX(0);
  border-color: rgba(18, 183, 106, 0.35);
  color: var(--ink);
}
.checks li.ok::before {
  border-color: var(--ok);
  background-color: var(--ok);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.meta {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.foot {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.75;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9ecf1;
    --muted: #9aa3b2;
    --line: #262b36;
    --bg: #0e1116;
    --surface: #151a22;
    --accent-soft: color-mix(in srgb, var(--brand-accent) 20%, #151a22);
    --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.6);
  }
  .sub strong { color: var(--ink); }
}

@media (prefers-reduced-motion: reduce) {
  .aurora, .rocket, .rings span, .badge .dot, .card { animation: none !important; }
  .checks li { transition: none; }
}
