/*
 * Identidade Futuristas (mesmas cores e fontes dos decks): fundo roxo escuro, roxo nas ações,
 * lavanda no que está em andamento e dourado reservado para a trilha de progresso e o sucesso.
 * O site é sempre escuro, como a marca.
 */
:root {
  --bg: #15132b;
  --bg-deep: #0e0c1f;
  --surface: #1e1b3a;
  --surface-2: #272350;
  --line: rgb(255 255 255 / 0.09);
  --purple: #7b3eff;
  --purple-hover: #8f5bff;
  --lavender: #a684ff;
  --gold: #f5b73c;
  --green: #4ade80;
  --red: #ff7a7a;
  --red-soft: rgb(255 122 122 / 0.1);
  --text: #ffffff;
  --body: #d6d3e4;
  --muted: #8f8c9e;
  --radius-card: 20px;
  --radius-field: 14px;
  color-scheme: dark;
  font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60rem 30rem at 100% -10%, rgb(123 62 255 / 0.22), transparent 60%),
    var(--bg);
}

h1,
h2 {
  font-family: 'Hubot Sans', 'DM Sans', system-ui, sans-serif;
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 2rem;
}
strong {
  color: var(--text);
}
a {
  color: var(--lavender);
}

/* ---- Topo: marca + trilha das 7 etapas ---- */
.top {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 0;
}
.brand {
  font-family: 'Hubot Sans', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
}
.trail {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin: 18px 0 8px;
  padding: 0;
}
.trail li {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  font-size: 0; /* o nome da etapa atual aparece em .trail-label */
}
.trail li.done {
  background: var(--gold);
}
.trail li.current {
  background: linear-gradient(90deg, var(--gold), rgb(245 183 60 / 0.35));
}
.trail-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- Telas ---- */
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 16px 64px;
}
.lead {
  font-size: 1.05rem;
  margin: 0 0 1.5rem;
}

.needs {
  padding: 0;
  margin: 0 0 1.5rem;
  list-style: none;
  display: grid;
  gap: 14px;
}
.needs li {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.shot {
  margin: 12px 0 0;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.shot figcaption {
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.risk {
  margin: 0 0 1.5rem;
  padding: 16px;
  border-radius: var(--radius-card);
  border: 1px solid rgb(245 183 60 / 0.35);
  background: rgb(245 183 60 / 0.06);
}
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  cursor: pointer;
  color: var(--text);
}
.check input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--gold);
}
details {
  margin-top: 12px;
}
summary {
  cursor: pointer;
  color: var(--lavender);
  font-weight: 500;
}
details p {
  margin: 8px 0 0;
  font-size: 0.95rem;
}

/* ---- Formulário ---- */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}
.field > span:first-child {
  color: var(--text);
  font-weight: 500;
}
.field small {
  color: var(--muted);
  font-size: 0.85rem;
}
input[type='text'],
input:not([type]),
input[type='password'],
textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1.05rem;
  color: var(--text);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
}
textarea {
  min-height: 0;
  resize: vertical;
}
input:focus-visible,
textarea:focus-visible,
button:focus-visible,
summary:focus-visible,
.check input:focus-visible {
  outline: 3px solid var(--lavender);
  outline-offset: 2px;
}
.password {
  position: relative;
  display: block;
}
.password input {
  padding-right: 96px;
}
.password button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
}
.form-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-field);
  background: var(--red-soft);
  color: var(--red);
}

/* ---- Botões ---- */
button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 999px;
}
.primary {
  width: 100%;
  min-height: 54px;
  padding: 0 24px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  background: var(--purple);
}
.primary:hover:not(:disabled) {
  background: var(--purple-hover);
}
.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ghost {
  min-height: 48px;
  padding: 0 20px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}
.ghost:hover {
  border-color: var(--lavender);
}
.ghost.small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.85rem;
}
.actions {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

/* ---- Etapas da instalação ---- */
.steps {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  gap: 2px;
}
.steps li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.steps .icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
}
.steps li.concluida {
  color: var(--body);
}
.steps li.concluida .icon {
  border-color: var(--gold);
  background:
    no-repeat center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315132B' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"),
    var(--gold);
}
.steps li.em_andamento {
  color: var(--text);
  font-weight: 500;
}
.steps li.em_andamento .icon {
  border-color: var(--lavender);
  animation: pulse 1.6s ease-in-out infinite;
}
.steps li.falhou {
  color: var(--red);
}
.steps li.falhou .icon {
  border-color: var(--red);
  background: var(--red);
}
.steps .time {
  font-size: 0.8rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 6px rgb(166 132 255 / 0.25);
  }
}
@media (prefers-reduced-motion: reduce) {
  .steps li.em_andamento .icon {
    animation: none;
    background: var(--lavender);
  }
}

/* ---- Código de diagnóstico ---- */
.code-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.code {
  font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface-2);
}

/* ---- Erro ---- */
.error-card {
  padding: 20px;
  border-radius: var(--radius-card);
  background: var(--red-soft);
  border: 1px solid rgb(255 122 122 / 0.35);
}
.error-card h1 {
  font-size: 1.6rem;
}
.error-card p {
  margin: 0 0 10px;
}
.error-action {
  color: var(--text);
}
.error-card pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8rem;
  color: var(--body);
  background: var(--bg-deep);
  padding: 10px;
  border-radius: 10px;
  max-height: 240px;
  overflow: auto;
}
.copied {
  color: var(--green);
  font-size: 0.9rem;
}
.report {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ---- Telas 4 a 7: passos numerados, código grande, links que parecem botões ---- */
.howto {
  counter-reset: howto;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  gap: 14px;
}
.howto > li {
  counter-increment: howto;
  position: relative;
  padding: 14px 16px 14px 56px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}
.howto > li::before {
  content: counter(howto);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface-2);
}
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 4px;
}
.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: var(--purple);
}
.button-link:hover {
  background: var(--purple-hover);
}
.button-link[hidden] {
  display: none;
}
.error-card .button-link {
  margin-top: 4px;
}
.bigcode {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.bigcode .code {
  font-size: 1.6rem;
  padding: 8px 16px;
  letter-spacing: 0.08em;
  color: var(--gold);
  user-select: all;
}
.waiting {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--body);
}
.waiting::before {
  content: '';
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--lavender);
  animation: pulse 1.6s ease-in-out infinite;
}
.waiting[hidden] {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .waiting::before {
    animation: none;
  }
}

/* ---- Sucesso ---- */
.success-card {
  padding: 22px 20px;
  border-radius: var(--radius-card);
  border: 1px solid rgb(245 183 60 / 0.45);
  background: rgb(245 183 60 / 0.08);
}
.success-card h1 {
  color: var(--gold);
}
.success-card p {
  margin: 0 0 6px;
}
.tips {
  padding-left: 1.2rem;
  margin: 0 0 1.5rem;
  display: grid;
  gap: 8px;
}
.rating {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.rating fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
}
.rating legend {
  color: var(--text);
  font-weight: 500;
  margin-bottom: 8px;
}
/* Estrelas: as que vêm antes da escolhida (e ela) ficam douradas. */
.stars {
  display: flex;
  gap: 6px;
}
.stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.stars label {
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--surface-2);
  padding: 2px;
}
.stars:has(input:checked) label {
  color: var(--gold);
}
.stars input:checked + label ~ label {
  color: var(--surface-2);
}
.stars input:focus-visible + label {
  outline: 2px solid var(--lavender);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
