/* setup.css - /setup "Fast mode" page only; loads after base.css (tokens, .btn family). Owner: H. */

.setup {
  max-width: 760px;
  margin: 0 auto;
  padding:
    max(1rem, calc(env(safe-area-inset-top, 0px) + 0.5rem))
    max(1.25rem, env(safe-area-inset-right, 0px))
    max(3rem, calc(env(safe-area-inset-bottom, 0px) + 1.5rem))
    max(1.25rem, env(safe-area-inset-left, 0px));
  line-height: 1.5;
}

/* —— header: back link + compact marquee (same border/glow as the home marquee) —— */
.setup-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.4rem 0.75rem;
  border: 2px solid var(--neon-purple);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(192, 132, 252, 0.12), rgba(0, 240, 255, 0.05));
  box-shadow: var(--glow-purple), inset 0 0 40px rgba(0, 0, 0, 0.45);
}

.setup-back {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 44px;
  padding: 0 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.setup-back span {
  font-size: 1.35rem;
  line-height: 1;
}

.setup-back:hover,
.setup-back:focus-visible {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  outline: none;
}

.setup-brand {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  /* keeps the title centred against the back button */
  margin-right: calc(44px + 1.5rem);
}

.setup-logo {
  height: 40px;
  width: auto;
  flex: none;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.35));
  user-select: none;
  -webkit-user-drag: none;
}

.setup-top h1 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: clamp(1.1rem, 4.6vw, 1.6rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
  white-space: nowrap;
}

.fast-icon {
  width: 1em;
  height: 1em;
  flex: none;
  fill: var(--neon-yellow);
  filter: drop-shadow(0 0 6px rgba(255, 229, 102, 0.5));
}

/* —— cards (same panel as the home profile bar) —— */
.setup-card {
  margin: 0 0 1rem;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(26, 15, 46, 0.55);
}

.setup-card h2 {
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.1rem;
  color: var(--neon-pink);
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(255, 43, 214, 0.35);
}

.setup-card h3 {
  margin: 1rem 0 0.4rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--neon-purple);
}

.setup-card p {
  margin: 0 0 0.6rem;
  color: var(--text);
}

.setup-card p:last-child {
  margin-bottom: 0;
}

.setup-card strong {
  color: #fff;
}

.step-tag {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  border: 2px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-size: 0.95rem;
  text-shadow: none;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

/* —— status card —— */
.state-card {
  border-width: 2px;
}

.state-card .state-title {
  margin: 0 0 0.35rem;
  color: var(--text);
  text-shadow: none;
  font-size: 1.15rem;
}

.state-card[data-state="checking"] .state-title { color: var(--muted); }
.state-card[data-state="off"] { border-color: rgba(255, 229, 102, 0.5); }
.state-card[data-state="off"] .state-title { color: var(--neon-yellow); }
.state-card[data-state="unavailable"] .state-title { color: var(--muted); }
.state-card[data-state="on"] {
  border-color: var(--success);
  box-shadow: 0 0 14px rgba(57, 255, 136, 0.3);
}
.state-card[data-state="on"] .state-title { color: var(--success); }
.state-card[data-state="fail"] {
  border-color: var(--danger);
  box-shadow: 0 0 14px rgba(255, 77, 109, 0.3);
}
.state-card[data-state="fail"] .state-title { color: var(--danger); }

.state-detail:empty {
  display: none;
}

.checklist {
  list-style: none;
  margin: 0.5rem 0 0.25rem;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.checklist li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.checklist .mark {
  flex: none;
  width: 1.2rem;
  font-weight: 800;
  text-align: center;
}

.checklist .ok .mark { color: var(--success); }
.checklist .bad { color: var(--danger); }
.checklist .info { color: var(--muted); padding-left: 1.7rem; }

.state-actions {
  margin: 0.9rem 0 0.4rem;
  display: flex;
}

.state-note {
  font-size: 0.9rem;
  color: var(--muted) !important;
  word-break: break-word;
}

[hidden] {
  display: none !important;
}

/* —— big buttons —— */
.setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.25rem 0 0.75rem;
}

.setup a.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.setup a.btn:hover {
  text-shadow: none;
}

.setup .btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  box-shadow: none;
  filter: grayscale(0.6);
}

/* —— numbered steps —— */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  min-height: 1.9rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.05rem;
  width: 1.9rem;
  height: 1.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  font-weight: 700;
  font-size: 0.9rem;
}

.step-aside {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* —— Safari note / copy row —— */
.open-safari {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 229, 102, 0.55);
  border-radius: 10px;
  background: rgba(255, 229, 102, 0.06);
  color: var(--neon-yellow) !important;
  font-size: 0.9rem;
}

/* —— "set up at home" note (page opened through a public name) —— */
.home-wifi-note {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 229, 102, 0.55);
  border-radius: 10px;
  background: rgba(255, 229, 102, 0.06);
  color: var(--neon-yellow) !important;
  font-size: 0.9rem;
  word-break: break-word;
}

.home-wifi-note strong {
  color: var(--neon-yellow);
}

.home-links {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.home-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-panel);
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

/* —— fingerprint check —— */
.step-aside code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--neon-cyan);
  overflow-wrap: anywhere;
}

.fp-ref {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--success);
  font-weight: 600;
}

.fp-short {
  display: block;
  margin: 0.15rem 0 0.25rem;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  overflow-wrap: anywhere;
}

.fp-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.copy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.copy-row code {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-panel);
  color: var(--neon-cyan);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
  -webkit-user-select: all;
  user-select: all;
}

.copy-btn {
  flex: none;
  min-height: 44px;
  min-width: 72px;
}

.test-explain {
  font-size: 0.9rem;
  color: var(--muted) !important;
  word-break: break-word;
}

/* —— expandable sections —— */
.setup-more > summary {
  cursor: pointer;
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--neon-purple);
  font-weight: 600;
}

.setup-more > summary::-webkit-details-marker {
  display: none;
}

.setup-more > summary::after {
  content: '';
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin: 0 0.35rem 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}

.setup-more[open] > summary::after {
  transform: rotate(45deg);
}

.setup-card .setup-more {
  margin-top: 0.75rem;
  border-top: 1px dashed var(--border);
  padding-top: 0.25rem;
}

details.setup-card {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

details.setup-card[open] {
  padding-bottom: 1rem;
}

.plain-list,
.addr-list {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.92rem;
}

.addr-list a {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.tech-list {
  margin: 0.35rem 0 0.6rem;
  font-size: 0.85rem;
}

.tech-list dt {
  color: var(--neon-purple);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.6rem;
}

.tech-list dd {
  margin: 0.15rem 0 0;
  color: var(--text);
}

.tech-list code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--neon-cyan);
  overflow-wrap: anywhere;
}

.tech-note {
  font-size: 0.8rem;
  color: var(--muted) !important;
}

/* —— phones —— */
@media (max-width: 600px) {
  .setup-top {
    padding: 0.35rem 0.5rem;
    gap: 0.5rem;
  }
  .setup-back {
    padding: 0 0.6rem;
  }
  .setup-brand {
    margin-right: 0;
    justify-content: flex-start;
  }
  .setup-logo {
    height: 36px;
  }
  .setup-card {
    padding: 0.85rem 0.9rem 0.95rem;
  }
}

@media (max-width: 360px) {
  .setup-logo {
    display: none;
  }
}
