/* Service Setup — dark sports-TV wizard */

:root {
  --bg: #07090d;
  --bg-2: #0c1018;
  --panel: #121826;
  --panel-2: #181f2e;
  --ink: #f4f6fa;
  --muted: #9aa3b8;
  --faint: #6d768c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --gold: #f0c24b;
  --gold-2: #ffd56a;
  --gold-ink: #16120a;
  --ice: #7dcec6;
  --ok: #5ee0a0;
  --danger: #ff8a7a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --radius-sm: 12px;
  --tap: 56px;
  --font: "Barlow", "Segoe UI", system-ui, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

img,
svg {
  display: block;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  appearance: none;
}

a {
  color: var(--gold);
  text-decoration: none;
}

a:hover {
  color: var(--gold-2);
  text-decoration: underline;
}

/* Ambient stadium lighting */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(240, 194, 75, 0.18), transparent 58%),
    radial-gradient(640px 380px at 110% 92%, rgba(125, 206, 198, 0.1), transparent 55%),
    radial-gradient(520px 320px at -10% 80%, rgba(240, 194, 75, 0.06), transparent 50%),
    linear-gradient(180deg, #0a0d13 0%, #07090d 40%, #0b1016 100%);
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 72px,
      rgba(240, 194, 75, 0.035) 72px,
      rgba(240, 194, 75, 0.035) 73px
    );
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}

.shell {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  margin: 0 auto;
  min-height: 100dvh;
  padding:
    calc(18px + var(--safe-t))
    18px
    calc(28px + var(--safe-b));
  display: flex;
  flex-direction: column;
}

/* Header */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-kicker {
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.brand-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.progress {
  text-align: right;
  min-width: 118px;
}

.progress-label {
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress-track {
  display: flex;
  gap: 5px;
  justify-content: flex-end;
}

.pip {
  width: 22px;
  height: 4px;
  border-radius: 99px;
  background: var(--line-strong);
}

.pip.is-on {
  background: var(--gold);
  box-shadow: 0 0 12px rgba(240, 194, 75, 0.55);
}

.pip.is-done {
  background: rgba(240, 194, 75, 0.45);
}

/* Screen card */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: rise 280ms ease-out;
}

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

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

.eyebrow {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--ice);
  margin: 0 0 8px;
}

h1,
.h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 8vw, 40px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0 0 14px;
}

.lede {
  color: var(--muted);
  font-size: 18px;
  margin: 0 0 22px;
  max-width: 36ch;
}

.lede strong {
  color: var(--ink);
  font-weight: 600;
}

/* Forms */
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input {
  height: var(--tap);
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.28);
  font-size: 16px; /* iOS: avoid auto-zoom */
  outline: none;
  width: 100%;
}

.field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 194, 75, 0.18);
}

.pass-wrap {
  position: relative;
}

.pass-wrap input {
  padding-right: 88px;
}

.ghost-inline {
  position: absolute;
  right: 8px;
  top: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--gold);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hint {
  font-size: 14px;
  color: var(--faint);
  margin: 4px 0 0;
}

/* Actions */
.actions {
  margin-top: auto;
  padding-top: 22px;
  padding-bottom: calc(12px + var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  background: linear-gradient(180deg, transparent, var(--bg) 16px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  touch-action: manipulation;
  user-select: none;
  transition: transform 120ms ease, filter 120ms ease, background 120ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--gold-ink);
  box-shadow: 0 10px 28px rgba(240, 194, 75, 0.22);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover {
  color: var(--ink);
  border-color: var(--muted);
}

.btn-wide {
  width: 100%;
}

.back-link {
  display: inline-flex;
  align-self: flex-start;
  margin: 4px 0 14px;
  font-size: 13px;
  color: var(--faint);
  letter-spacing: 0.02em;
  background: none;
  padding: 8px 0;
  min-height: 0;
}

.back-link:hover {
  color: var(--gold);
}

/* Device grid */
.device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.device {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 112px;
  padding: 16px 14px 14px;
  border-radius: 16px;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%),
    var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  touch-action: manipulation;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.device:hover,
.device:focus-visible {
  border-color: rgba(240, 194, 75, 0.55);
  box-shadow: 0 0 0 1px rgba(240, 194, 75, 0.25);
  outline: none;
}

.device:active {
  transform: scale(0.98);
}

.device-icon {
  width: 36px;
  height: 36px;
  color: var(--gold);
}

.device-label {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

/* App picker */
.app-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  text-align: left;
  color: var(--ink);
  touch-action: manipulation;
}

.app-card:hover,
.app-card:focus-visible {
  border-color: rgba(240, 194, 75, 0.5);
  outline: none;
}

.app-card.is-rec {
  border-color: rgba(240, 194, 75, 0.35);
  background:
    linear-gradient(90deg, rgba(240, 194, 75, 0.08), transparent 42%),
    var(--panel);
}

.app-copy {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.app-name {
  font-weight: 700;
  font-size: 17px;
}

.app-meta {
  color: var(--muted);
  font-size: 14px;
}

.badge {
  flex-shrink: 0;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-ink);
  background: var(--gold);
  padding: 4px 8px;
  border-radius: 99px;
}

.chev {
  color: var(--faint);
  flex-shrink: 0;
}

/* Setup step */
.step-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 8px;
}

.step-body {
  font-size: 20px;
  line-height: 1.35;
  margin: 0 0 20px;
  font-weight: 500;
}

.step-body em {
  font-style: normal;
  color: var(--gold-2);
  font-weight: 700;
}

.note {
  margin: 16px 0 0;
  padding: 14px 14px 14px 16px;
  border-left: 3px solid var(--ice);
  background: rgba(125, 206, 198, 0.07);
  border-radius: 0 12px 12px 0;
  color: var(--muted);
  font-size: 15px;
}

.note a {
  font-weight: 600;
}

.warn {
  border-left-color: var(--gold);
  background: rgba(240, 194, 75, 0.08);
}

/* Copy blocks */
.copy-block {
  margin: 0 0 12px;
  padding: 14px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.copy-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.copy-value {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 15px;
  overflow-wrap: anywhere;
  word-break: break-all;
  color: var(--ink);
  line-height: 1.3;
}

.copy-btn {
  flex-shrink: 0;
  height: 44px;
  min-width: 76px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(240, 194, 75, 0.12);
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(240, 194, 75, 0.28);
}

.copy-btn:hover {
  background: rgba(240, 194, 75, 0.2);
}

.copy-btn.is-copied {
  color: var(--gold-ink);
  background: var(--ok);
  border-color: var(--ok);
}

.code-huge-wrap {
  margin: 8px 0 14px;
  padding: 22px 12px 18px;
  border-radius: 18px;
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(240, 194, 75, 0.14), transparent 55%),
    var(--panel);
  border: 1px solid rgba(240, 194, 75, 0.22);
}

.code-huge {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(48px, 16vw, 72px);
  letter-spacing: 0.12em;
  line-height: 1;
  color: var(--gold-2);
}

.ext-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  margin: 8px 0 12px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
}

.ext-link:hover {
  text-decoration: none;
  border-color: rgba(240, 194, 75, 0.45);
  color: var(--ink);
}

.ext-link span {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  flex-shrink: 0;
}

/* Done */
.done-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 8px 0 16px;
  background: rgba(94, 224, 160, 0.12);
  color: var(--ok);
  border: 1px solid rgba(94, 224, 160, 0.3);
}

.quiet {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 14px;
}

.quiet p {
  margin: 0 0 8px;
}

.quiet a {
  color: var(--muted);
}

.quiet .copy-block {
  color: var(--ink);
  margin-bottom: 14px;
}

.phone {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.02em;
}

details.trouble {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
}

details.trouble summary {
  list-style: none;
  cursor: pointer;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-weight: 700;
  font-size: 16px;
}

details.trouble summary::-webkit-details-marker {
  display: none;
}

details.trouble summary::after {
  content: "+";
  color: var(--gold);
  font-size: 22px;
  font-weight: 500;
}

details.trouble[open] summary::after {
  content: "–";
}

.trouble-body {
  padding: 0 16px 16px;
  color: var(--muted);
}

.trouble-body > p {
  margin: 0 0 12px;
}

.cred-chip {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.subprog {
  font-size: 13px;
  color: var(--faint);
  margin: -6px 0 16px;
  letter-spacing: 0.04em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--bg);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 18px;
  border-radius: 99px;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.skip-note {
  text-align: center;
  color: var(--faint);
  font-size: 13px;
  margin: 0;
}

@media (min-width: 720px) {
  .shell {
    padding-top: 36px;
    padding-bottom: 48px;
  }

  .screen {
    background: rgba(18, 24, 38, 0.55);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px 26px 24px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
  }

  .topbar {
    margin-bottom: 22px;
  }
}
