:root {
  --bg: #0c0c0f;
  --surface: #16161d;
  --surface2: #1e1e28;
  --surface3: #252532;
  --border: #2e2e3a;
  --border-light: #3d3d4d;
  --text: #f0f0f5;
  --muted: #9494a8;
  --accent: #00e5a0;
  --accent-dim: rgba(0, 229, 160, 0.12);
  --accent-hover: #00c98d;
  --accent2: #7c5cff;
  --accent2-dim: rgba(124, 92, 255, 0.15);
  --danger: #ff4757;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 40% at 20% 0%, rgba(0, 229, 160, 0.14), transparent),
    radial-gradient(ellipse 45% 35% at 90% 100%, rgba(124, 92, 255, 0.1), transparent);
}

.container {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

/* ── Header ── */

.hero {
  text-align: center;
  margin-bottom: 2.75rem;
  padding: 2rem 1rem 0;
}

.hero-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(0, 229, 160, 0.25);
  padding: 0.35rem 0.9rem;
  border-radius: 50px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, #fff 30%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Panels ── */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.panel-input {
  border-top: 3px solid var(--accent);
}

.panel-result {
  border-top: 3px solid var(--accent2);
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.panel-head h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-head h2::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.panel-result .panel-head h2::before {
  background: var(--accent2);
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

textarea,
input[type="number"],
select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.88rem;
  padding: 0.9rem 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select {
  font-family: "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.5;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 1rem;
  margin-top: 1.25rem;
  align-items: end;
}

.row-3 {
  grid-template-columns: 1fr 1fr 1.6fr;
}

@media (max-width: 720px) {
  .row-3 {
    grid-template-columns: 1fr;
  }
}

.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.75rem;
  padding-left: 0.75rem;
  border-left: 2px solid var(--border-light);
}

.hint strong {
  color: var(--accent);
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, #00b87a 100%);
  color: #0a0a0f;
  box-shadow: 0 4px 20px rgba(0, 229, 160, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #00a870 100%);
  box-shadow: 0 6px 24px rgba(0, 229, 160, 0.4);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-outline {
  padding: 0.55rem 1.1rem;
  font-size: 0.82rem;
  background: transparent;
  color: var(--accent2);
  border: 1px solid rgba(124, 92, 255, 0.45);
}

.btn-outline:hover {
  background: var(--accent2-dim);
  border-color: var(--accent2);
}

.btn-sm {
  padding: 0.42rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-sm:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent2);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem;
}

.btn-link:hover {
  text-decoration: underline;
}

.actions-top {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.actions-top h2 {
  margin: 0;
}

/* ── Empty state ── */

.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--muted);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.12);
}

.empty p {
  font-size: 0.95rem;
  line-height: 1.7;
}

.empty strong {
  color: var(--accent);
}

/* ── Grid & Cards ── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem;
}

.grid:not(:empty) + .empty,
.grid:not(:empty) ~ .empty {
  display: none;
}

.card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.card-num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent2);
  background: var(--accent2-dim);
  border: 1px solid rgba(124, 92, 255, 0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}

.card-info {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.88rem;
  color: var(--text);
  text-align: center;
}

.card-info strong {
  color: var(--accent);
  font-size: 1rem;
}

.qr-wrap {
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  line-height: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.qr-wrap canvas,
.qr-wrap img {
  display: block;
  width: 180px;
  height: 180px;
  image-rendering: pixelated;
}

.qr-wrap.gerando {
  width: 204px;
  height: 204px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 0.8rem;
  font-family: "Segoe UI", system-ui, sans-serif;
}

.codigo {
  width: 100%;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.65rem;
  word-break: break-all;
  text-align: left;
  color: var(--muted);
  line-height: 1.45;
  max-height: 3.2em;
  overflow: hidden;
  background: var(--surface3);
  border: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
}

.codigo.expandido {
  max-height: none;
}

.codigo mark.hl-u,
.codigo mark.hl-x {
  background: rgba(0, 229, 160, 0.2);
  color: var(--accent);
  padding: 0 2px;
  border-radius: 2px;
}

.codigo .hl-c {
  color: #ffd166;
}

.card-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

/* ── Toast ── */

.toast {
  position: fixed;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 160, 0.35);
  padding: 0.7rem 1.4rem;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
  z-index: 100;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Info boxes ── */

.analise {
  margin-top: 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 229, 160, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.65;
}

.analise strong {
  color: var(--accent);
  font-family: "Consolas", "Courier New", monospace;
}

.erro-box {
  margin-top: 0.85rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.35);
  border-radius: var(--radius-sm);
  color: #ff8a95;
  font-size: 0.86rem;
}

/* ── Footer ── */

.site-footer {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  opacity: 0.6;
  margin-top: 2rem;
  letter-spacing: 0.04em;
}
