:root {
  --bg: #050706;
  --surface: #0b0f0d;
  --surface-hover: #0e1512;
  --border: #18201c;
  --border-strong: #24302a;
  --text: #ecf3ef;
  --text-2: #8a9a92;
  --text-3: #55635c;
  --green: #22c55e;
  --green-bright: #4ade80;
  --green-soft: rgba(34, 197, 94, .10);
  --green-line: rgba(34, 197, 94, .45);
  --ink: #03140a;
  --radius: 20px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mono { font-family: var(--mono); font-feature-settings: 'zero' 1; }
kbd {
  font-family: var(--mono); font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 6px;
  border: 1px solid var(--border-strong); color: var(--text-2); background: var(--surface);
}

/* Brilho de fundo */
.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(600px 340px at 50% 0%, rgba(34, 197, 94, .10), transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .035) 1px, transparent 0) 0 0 / 28px 28px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}

/* Marca */
.brand {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 36px 16px 0;
}
.logo { width: 34px; height: 34px; }
.logo-frame { fill: var(--green); }
.logo-ring { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.logo-4 { fill: var(--ink); font: 700 12px var(--font); }
.wordmark { font-size: 20px; font-weight: 700; letter-spacing: -.03em; }
.wordmark span { color: var(--text-2); font-weight: 600; }

/* Palco */
.stage {
  flex: 1; width: 100%; max-width: 920px; margin: 0 auto;
  padding: 40px 16px 32px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.intro { text-align: center; margin-bottom: 32px; }
.intro h1 { margin: 0; font-size: clamp(22px, 3.2vw, 30px); font-weight: 600; letter-spacing: -.03em; }
.intro p { margin: 8px 0 0; color: var(--text-2); font-size: 15px; }

/* Cards */
.cards {
  width: 100%;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px;
}
.card {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 200px; padding: 22px 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.015), transparent), var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; user-select: none; outline: none;
  transition: border-color .18s, background-color .18s, transform .18s, box-shadow .18s;
}
.card:hover { border-color: var(--border-strong); background-color: var(--surface-hover); transform: translateY(-2px); }
.card:focus-visible { border-color: var(--green-line); box-shadow: 0 0 0 4px var(--green-soft); }
.card:active { transform: translateY(0) scale(.995); }

.card-head { display: flex; align-items: center; justify-content: space-between; }
.card-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2);
}
.refresh {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 10px; background: none; cursor: pointer; color: var(--text-3);
  transition: .15s;
}
.refresh svg { width: 16px; height: 16px; transition: transform .4s; }
.refresh:hover { color: var(--green); border-color: var(--border-strong); background: var(--bg); }
.refresh:hover svg { transform: rotate(-90deg); }
.refresh:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.card-value {
  font-size: clamp(22px, 3vw, 30px); font-weight: 600; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 18px 0;
}
.card-value.mono { font-weight: 500; letter-spacing: .01em; }
.card.fresh .card-value { animation: rise .32s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card-foot { display: flex; align-items: center; justify-content: space-between; }
.hint {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-3); transition: color .15s;
}
.card:hover .hint { color: var(--text-2); }

/* Estado copiado */
.card.copied { border-color: var(--green-line); box-shadow: 0 0 0 4px var(--green-soft); }
.card.copied .hint { color: var(--green); }

/* Slot: card + linha do último copiado */
.slot { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.last {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0;
  height: 36px; padding: 0 14px;
  border: 1px solid transparent; border-radius: 12px; background: none;
  cursor: pointer; text-align: left; color: var(--text-2);
  transition: border-color .15s, background-color .15s, color .15s;
}
.last-label {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); white-space: nowrap;
}
.last-value { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.last svg { width: 14px; height: 14px; color: var(--text-3); opacity: 0; transition: .15s; }
.last:not(:disabled):hover { border-color: var(--border); background: var(--surface); color: var(--text); }
.last:not(:disabled):hover svg { opacity: 1; color: var(--green); }
.last:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.last.is-empty { cursor: default; }
.last.is-empty .last-value { color: var(--text-3); }
.last.copied { border-color: var(--green-line); background: var(--green-soft); }
.last.copied svg { opacity: 1; color: var(--green); }
.last.copied .last-value { color: var(--green-bright); }

/* Ações */
.actions { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 28px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 26px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--green); color: var(--ink); font-weight: 600; font-size: 15px;
  box-shadow: 0 8px 30px rgba(34, 197, 94, .22);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn-primary:hover { background: var(--green-bright); transform: translateY(-1px); box-shadow: 0 10px 34px rgba(34, 197, 94, .32); }
.btn-primary:active { transform: none; }
.btn-primary:focus-visible { outline: 2px solid var(--green-bright); outline-offset: 3px; }
.btn-primary svg { width: 17px; height: 17px; stroke-width: 2.4; }
.shortcut { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 12px; }

.foot { text-align: center; color: var(--text-3); font-size: 12px; padding: 0 16px 28px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 50;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px);
  padding: 10px 18px 10px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--green-line); color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--green); color: var(--ink); stroke-width: 3; }
#toastText { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Responsivo */
@media (max-width: 640px) {
  .brand { padding-top: 24px; }
  .stage { padding-top: 28px; }
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .card { min-height: 160px; padding: 18px 20px; }
  .card-label kbd, .shortcut { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
