/* ===== Reset / base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --azul: #0071e3;
  --azul-esc: #0059b8;
  --verde: #34c759;
  --txt: #1d1d1f;
  --txt-sub: #6e6e73;
  --borda: #e5e5e7;
  --bg: #f5f5f7;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ===== Layout ===== */
.container { width: 100%; max-width: 440px; padding: 0 16px 40px; }
.top-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 4px; margin-bottom: 8px;
}
.logo { font-weight: 600; font-size: 17px; }

.card {
  background: #fff;
  border-radius: 20px;
  padding: 36px 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  text-align: center;
  animation: fade .35s ease;
}
.hidden { display: none; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== Ícones de topo do card ===== */
.card-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: #eaf3ff; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
}
.card-icon.success { background: var(--azul); }
.check-circle {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--verde); display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; animation: pop .4s ease;
}
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

h1 { font-size: 24px; font-weight: 600; margin-bottom: 6px; letter-spacing: -.3px; }
.sub { color: var(--txt-sub); font-size: 15px; margin-bottom: 24px; }

/* ===== Input de valor ===== */
.input-group {
  display: flex; align-items: center; gap: 6px;
  border: 2px solid var(--borda); border-radius: 14px;
  padding: 14px 18px; margin-bottom: 20px;
  transition: border-color .2s;
}
.input-group:focus-within { border-color: var(--azul); }
.currency { font-size: 22px; font-weight: 600; color: var(--txt-sub); }
#valor {
  flex: 1; border: none; outline: none; font-size: 28px; font-weight: 600;
  width: 100%; background: transparent; color: var(--txt);
}

/* ===== Botões ===== */
.btn {
  width: 100%; border: none; border-radius: 14px;
  padding: 15px; font-size: 16px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .2s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--azul); color: #fff; }
.btn-primary:hover { background: var(--azul-esc); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-copy { margin-top: 20px; }
.btn-link {
  background: transparent; color: var(--txt-sub); margin-top: 10px; font-weight: 500;
}

.field {
  border: 2px solid var(--borda); border-radius: 14px;
  padding: 12px 16px; margin-bottom: 12px; transition: border-color .2s;
}
.field:focus-within { border-color: var(--azul); }
.field input {
  width: 100%; border: none; outline: none; background: transparent;
  font-size: 16px; color: var(--txt);
}
#qrcode-img img, #qrcode-img canvas { width: 220px !important; height: 220px !important; }

.error { color: #ff3b30; font-size: 14px; margin-top: 12px; min-height: 18px; }
.footer-info { color: var(--txt-sub); font-size: 13px; margin-top: 22px; }

/* ===== QR Code ===== */
.qrcode-wrapper { display: flex; justify-content: center; margin-bottom: 18px; }
.qr-border { padding: 12px; border: 1px solid var(--borda); border-radius: 16px; background: #fff; }
#qrcode-img { width: 220px; height: 220px; display: block; }

.amount { font-size: 30px; font-weight: 700; margin: 8px 0 12px; }
.amount.large { font-size: 34px; color: var(--verde); }
.amount::before { content: "R$ "; font-size: .6em; font-weight: 600; }

.timer {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--txt-sub); font-size: 14px; margin-bottom: 8px;
}
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--borda);
  border-top-color: var(--azul); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.small { font-size: 11px; color: var(--txt-sub); word-break: break-all; margin-top: 12px; line-height: 1.5; }

/* ===== Comprovante ===== */
.receipt {
  border: 1px solid var(--borda); border-radius: 14px;
  padding: 4px 16px; margin: 20px 0; text-align: left;
}
.receipt-row {
  display: flex; justify-content: space-between;
  padding: 12px 0; font-size: 15px;
}
.receipt-row + .receipt-row { border-top: 1px solid var(--borda); }
.receipt-row span:first-child { color: var(--txt-sub); }
.receipt-row span:last-child { font-weight: 600; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: #1d1d1f; color: #fff; padding: 12px 22px; border-radius: 12px;
  font-size: 14px; opacity: 0; transition: all .3s; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
