:root {
  --bg: #edf4f8;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --line: #d5e2ea;
  --primary: #0e7490;
  --primary-2: #155e75;
  --copy: #0b6ea8;
  --copy-2: #095888;
  --danger: #b91c1c;
  --ok: #166534;
  --mono-bg: #0b1220;
  --mono-text: #d9e2f2;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #dff0f7 0%, var(--bg) 280px);
  min-height: 100vh;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(14,116,144,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(14,116,144,.05) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.pix-float {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 180px;
  background: rgba(255, 255, 255, .95);
  border: 1px solid #c8dbe7;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .18);
  padding: 10px;
  z-index: 9;
  text-align: center;
}

.pix-float-title {
  margin: 0;
  font-size: .85rem;
  font-weight: 800;
  color: #0f3e57;
}

.pix-float-text {
  margin: 6px 0 8px;
  font-size: .74rem;
  line-height: 1.3;
  color: #334155;
}

.pix-float img {
  width: 118px;
  height: 118px;
  border: 1px solid #d5e3ec;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.pix-float-key {
  margin-top: 8px;
  display: block;
  font-size: .62rem;
  background: #f3f9fc;
  border: 1px solid #cfe0ea;
  border-radius: 8px;
  padding: 5px 6px;
  word-break: break-all;
}

.pix-copy-btn {
  margin-top: 8px;
  width: 100%;
  border: 1px solid #a6c9dc;
  background: linear-gradient(135deg, #e7f6ff, #d7eeff);
  color: #0b4f74;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: .73rem;
  font-weight: 700;
  cursor: pointer;
}

.pix-copy-btn:hover {
  background: linear-gradient(135deg, #d8eeff, #cae7ff);
}

.pix-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, .6);
  backdrop-filter: blur(2px);
  z-index: 20;
}

.pix-modal-card {
  width: min(92vw, 540px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .3);
  padding: 20px;
  text-align: center;
  position: relative;
}

.pix-modal-card h2 {
  margin: 4px 0 10px;
  font-size: 1.25rem;
}

.pix-modal-card p {
  margin: 0;
  color: #1e293b;
}

.pix-modal-card img {
  margin: 16px auto 8px;
  max-width: min(80vw, 280px);
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #d7e5ef;
  background: #fff;
}

.pix-footnote {
  margin-top: 10px !important;
  color: var(--muted) !important;
  font-size: .9rem;
}

.pix-key-label {
  margin-top: 8px !important;
  font-weight: 700;
  color: #0f3e57 !important;
}

.pix-key {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #c7d8e4;
  background: #f4f9fc;
  color: #0f172a;
  word-break: break-all;
}

.pix-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid #bcd2e0;
  background: #f2f8fc;
  color: #1b3a4d;
  border-radius: 10px;
  padding: 7px 10px;
  font-weight: 700;
  cursor: pointer;
}

.pix-close:hover {
  background: #e6f2f9;
}

.shell {
  width: min(980px, 92vw);
  margin: 26px auto 40px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  letter-spacing: -.02em;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary-2);
  text-transform: uppercase;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.lead { margin: 10px 0 0; color: var(--muted); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .07);
}

.note h2 { margin: 0 0 8px; font-size: 1rem; }
.note p { margin: 0 0 8px; }
.note code {
  background: #f2f7fb;
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: 8px;
  display: inline-block;
  word-break: break-all;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wide { grid-column: 1 / -1; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .9rem;
  font-weight: 600;
}

input, textarea {
  border: 1px solid #c9d8e3;
  border-radius: 11px;
  background: #f8fbfd;
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,116,144,.16);
}

textarea { resize: vertical; min-height: 96px; }

.actions-inline { display: flex; justify-content: flex-end; }
.actions-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .08s ease, opacity .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(15, 23, 42, .15);
}

.btn.primary {
  background: linear-gradient(135deg, #0e7490, #155e75);
  color: #fff;
  box-shadow: 0 10px 18px rgba(14,116,144,.24);
}
.btn.primary:hover {
  background: linear-gradient(135deg, #0f809f, #0f5f78);
  box-shadow: 0 12px 22px rgba(14,116,144,.3);
}

.btn.secondary {
  background: linear-gradient(135deg, #e8f4ff, #d9efff);
  border-color: #7fc1e6;
  color: var(--copy-2);
  box-shadow: 0 6px 14px rgba(11, 110, 168, .15);
}
.btn.secondary:hover {
  background: linear-gradient(135deg, #d5ecff, #c2e5ff);
  border-color: var(--copy);
  color: #07466f;
  box-shadow: 0 10px 18px rgba(11, 110, 168, .24);
}

.btn.ghost {
  background: #f7fbff;
  border-color: #b9cfde;
  color: #1c4058;
}
.btn.ghost:hover {
  background: #edf6fc;
  border-color: #97bed5;
  color: #12354c;
  box-shadow: 0 4px 10px rgba(10, 79, 99, .12);
}

#copyConsole {
  min-width: 290px;
  font-size: .95rem;
}

.status-top { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.badge {
  border: 1px solid var(--line);
  background: #f7fafc;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: .86rem;
  font-weight: 600;
}

#log {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--mono-bg);
  color: var(--mono-text);
  border-radius: 12px;
  border: 1px solid #1e293b;
  padding: 12px;
  min-height: 130px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .78rem;
}

.muted { color: var(--muted); font-size: .9rem; }

@media (max-width: 760px) {
  .pix-float {
    width: 156px;
    padding: 8px;
    top: 8px;
    left: 8px;
  }

  .pix-float-text {
    font-size: .7rem;
  }

  .pix-float img {
    width: 96px;
    height: 96px;
  }

  .grid { grid-template-columns: 1fr; }
  .actions-row .btn { width: 100%; }
  .actions-inline { justify-content: stretch; }
  .actions-inline .btn { width: 100%; min-width: 0; }
}
