/* Instalador Júpiter — tokens oficiais Jupiter Tech (brand.md ed. 01.2) */

@font-face {
  font-family: 'Geist';
  src: url('/fonts/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Geist Mono';
  src: url('/fonts/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

* , *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

:root {
  --jupiter-black: #0A0A0B;
  --graphite: #1F2124;
  --steel: #8A8D93;
  --mist: #F5F5F7;
  --paper: #FAFAFA;
  --signal: #2F6FED;
  --amber: #C8612C; /* premium only — nunca em UI corrente (brand.md §3) */
  --line: #E6E6E9;
  --line-dark: #2A2C30;

  /* Semânticas (fora do manual; Amber falha AA e é reservado a peças premium) */
  --error: #B42318;
  --error-bg: #FBEAE8;
  --ok: #1F7A3D;
  --ok-bg: #E7F3EA;

  --ff-sans: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  --ff-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Grid de 8px (brand tokens --s-*) */
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 48px;

  --radius: 12px;
  --radius-sm: 8px;
}

body {
  background: var(--paper);
  color: var(--jupiter-black);
  font-family: var(--ff-sans);
  font-size: 17px; /* t-body */
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--signal); }

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* Header */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

/* Lockup horizontal: marca à esquerda, wordmark à direita (brand.md §2.2) */
.brand { display: flex; align-items: center; gap: 9px; } /* gap ≈ 22% da altura da marca */

.brand-mark {
  width: 40px;
  height: 40px;
  color: var(--jupiter-black);
  flex: none;
}

/* Wordmark: "Jupiter" 700 + "Tech" 500, texto vivo, sem caps (brand.md §1/§4) */
.brand-name { font-weight: 500; letter-spacing: -0.015em; font-size: 1.1rem; }
.brand-name b { font-weight: 700; }

.support-link {
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--steel);
  white-space: nowrap;
}
.support-link:hover { color: var(--signal); }

/* Progress bar */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin: 0 0 24px;
  padding: 0;
  overflow-x: auto; /* rede de segurança: nunca estoura a página em telas estreitas (320px) */
}

.steps li {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0; /* permite o item encolher abaixo da largura do rótulo sem transbordar */
  font-size: 0.75rem;
  color: var(--steel);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}

.steps li span:not(.n) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.steps li .n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--mist);
  color: var(--steel);
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  flex: none;
}

.steps li.active { color: var(--jupiter-black); border-color: var(--signal); }
.steps li.active .n { background: var(--signal); color: #fff; }
.steps li.done { color: var(--graphite); border-color: var(--jupiter-black); }

/* Card / screens */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 40px);
}

.screen { display: none; }
.screen.active { display: block; }

.hero { margin-bottom: 24px; }

/* t-overline: 11px, medium, 0.12em, ALL CAPS, mono (brand.md §4) */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 8px;
}

.eyebrow .n {
  color: var(--signal);
}

.hero h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); font-weight: 600; margin: 0 0 8px; letter-spacing: -0.02em; }
.hero .sub { color: var(--steel); margin: 0; max-width: 60ch; }

.body { display: flex; flex-direction: column; gap: 20px; }

/* Fields */

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-ddi { max-width: 120px; }

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

.field label { font-size: 0.85rem; font-weight: 600; color: var(--graphite); }

input[type="text"], input[type="email"], input[type="tel"], input[type="password"] {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--jupiter-black);
}

input:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 1px;
}

.field-error {
  color: var(--error);
  font-size: 0.8rem;
  margin: 0;
}

.hint { color: var(--steel); font-size: 0.85rem; margin: 0; }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--graphite);
}
.consent input { margin-top: 3px; }

/* Passo a passo de compra da VPS */

.howto {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--mist);
}

.howto-title { margin: 0; font-weight: 600; }

.howto-steps {
  list-style: none;
  counter-reset: howto;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.howto-steps li {
  counter-increment: howto;
  display: flex;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--graphite);
}

.howto-steps li::before {
  content: counter(howto);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--signal);
  color: #fff;
  font-family: var(--ff-mono);
  font-size: 0.7rem;
  flex: none;
  margin-top: 2px;
}

.cta-hostinger {
  display: inline-block;
  align-self: flex-start;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--mist);
  color: var(--jupiter-black);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}
.cta-hostinger:hover { background: var(--line); }

/* Choice cards */

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  background: #fff;
}

.choice input { position: absolute; top: 14px; right: 14px; }

.choice b { font-size: 1rem; }
.choice span { color: var(--steel); font-size: 0.85rem; }

.choice:has(input:checked) {
  border-color: var(--signal);
  background: #EFF4FE;
}

/* Channel conditional fieldsets */

.channel-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0;
}
.channel-fields legend { font-weight: 600; padding: 0 4px; }

/* Buttons */

.btn {
  font: inherit;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn.primary { background: var(--signal); color: #fff; }
.btn.primary:hover { background: #2557c2; }
.btn.primary:disabled { background: var(--line); color: var(--steel); cursor: not-allowed; }

.btn.ghost { background: transparent; border-color: var(--line); color: var(--graphite); }
.btn.ghost:hover { border-color: var(--steel); }

/* Nav */

.nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

/* OAuth */

.oauth-state { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }

.oauth-code {
  font-family: var(--ff-mono);
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  background: var(--mist);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
}

/* Installation screen */

.inst-steps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.inst-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--mist);
  color: var(--steel);
  font-size: 0.9rem;
}

.inst-step::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--steel);
  flex: none;
}

.inst-step.now { background: #EFF4FE; color: var(--signal); font-weight: 600; }
.inst-step.now::before { background: var(--signal); }

.inst-step.done { color: var(--jupiter-black); }
.inst-step.done::before { background: var(--jupiter-black); }

.inst-step.error { background: var(--error-bg); color: var(--error); }
.inst-step.error::before { background: var(--error); }

.qr-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--mist);
}

.qr-box img { width: 240px; height: 240px; image-rendering: pixelated; background: #fff; }

.log {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  background: var(--jupiter-black);
  color: var(--mist);
  padding: 12px;
  border-radius: var(--radius-sm);
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.result {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.result.ok { background: var(--ok-bg); color: var(--ok); }
.result.err { background: var(--error-bg); color: var(--error); }

.privacy-note {
  color: var(--steel);
  font-size: 0.8rem;
  margin-top: 8px;
}

/* Utility */

.hidden { display: none !important; }

/* Responsive */

@media (max-width: 767px) {
  .grid, .choice-grid { grid-template-columns: 1fr; }
  .steps li span:not(.n) { display: none; }
  .topbar { flex-wrap: wrap; }
}
