/* =========================================================
   Renovamente — Bilhete virtual (gerador + impressão)
   Reutiliza tokens de styles.css
   ========================================================= */

.bilhete-page { padding-top: clamp(7rem, 12vh, 8.5rem); min-height: 100vh; }

/* ---------- Formulário ---------- */
.gen-wrap { max-width: 680px; margin: 0 auto; }
.gen-form { background: var(--white); border: 1px solid rgba(127, 148, 99, 0.18); border-radius: var(--radius); padding: clamp(1.6rem, 4vw, 2.2rem); box-shadow: var(--shadow-sm); margin-bottom: 2.2rem; }
.gen-form label { display: block; font-weight: 700; color: var(--green-800); margin-bottom: 0.5rem; font-size: 0.95rem; }
.gen-form .field { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.gen-form input { flex: 1; min-width: 220px; font-family: var(--font-body); font-size: 1.05rem; padding: 0.9rem 1.1rem; border: 1.5px solid rgba(127, 148, 99, 0.3); border-radius: 12px; color: var(--green-800); background: var(--oat); }
.gen-form input:focus-visible { outline: 3px solid var(--moss-600); outline-offset: 2px; border-color: var(--moss-600); }
.gen-hint { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.8rem; }
.gen-error { color: #b4463f; font-size: 0.9rem; margin-top: 0.6rem; font-weight: 600; display: none; }
.gen-error.show { display: block; }

/* ---------- Bilhete ---------- */
.vticket-area { display: none; }
.vticket-area.show { display: block; animation: fadeUp 0.5s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.vticket {
  display: flex; background: var(--white); border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid rgba(127, 148, 99, 0.2);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.vticket-main { flex: 1; padding: clamp(1.6rem, 4vw, 2.2rem); position: relative; }
.vt-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 1.4rem; }
.vt-brand .brand-mark { width: 38px; height: 38px; font-size: 1.05rem; }
.vt-brand b { font-family: var(--font-display); font-size: 1.15rem; color: var(--green-800); }
.vt-brand small { display: block; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sage-500); }

.vt-title { font-family: var(--font-display); font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); font-weight: 600; color: var(--green-800); line-height: 1.05; }
.vt-sub { font-family: var(--font-display); font-style: italic; color: var(--moss-600); margin-bottom: 1.3rem; }

.vt-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 1.2rem; margin-bottom: 1.4rem; }
.vt-meta div { display: flex; align-items: center; gap: 10px; }
.vt-meta i { color: var(--moss-600); width: 18px; text-align: center; }
.vt-meta span { font-size: 0.92rem; color: var(--ink-soft); }
.vt-meta b { color: var(--green-800); display: block; font-size: 0.95rem; }

.vt-holder { background: var(--sage-100); border-radius: 14px; padding: 1rem 1.2rem; }
.vt-holder label { display: block; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--moss-600); margin-bottom: 0.2rem; }
.vt-holder strong { font-family: var(--font-display); font-size: clamp(1.3rem, 1rem + 1.5vw, 1.8rem); font-weight: 600; color: var(--green-800); line-height: 1.15; word-break: break-word; }

/* Stub */
.vticket-stub {
  width: 168px; flex: 0 0 auto; color: var(--cream); text-align: center;
  background: linear-gradient(160deg, var(--green-800), var(--moss-700));
  padding: 1.6rem 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
  position: relative; border-left: 2px dashed rgba(250, 248, 240, 0.5);
}
.vticket-stub::before, .vticket-stub::after {
  content: ''; position: absolute; left: -11px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--oat); /* cor do fundo da seção, simula perfuração */
}
.vticket-stub::before { top: -10px; }
.vticket-stub::after { bottom: -10px; }
.vticket-stub .st-label { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--wheat-soft); }
.vticket-stub .st-price { font-family: var(--font-display); font-size: 2rem; font-weight: 600; color: var(--white); line-height: 1; }
.vticket-stub .st-code { font-family: 'Courier New', monospace; font-weight: 700; font-size: 0.98rem; letter-spacing: 1px; color: var(--white); background: rgba(250, 248, 240, 0.14); padding: 0.4rem 0.6rem; border-radius: 8px; margin-top: 0.3rem; }
.vticket-stub .st-bars { display: flex; gap: 2px; height: 34px; align-items: stretch; margin-top: 0.6rem; }
.vticket-stub .st-bars i { width: 2px; background: var(--cream); display: block; }

.vt-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 1.3rem; flex-wrap: wrap; }
.vt-code-inline { font-family: 'Courier New', monospace; font-weight: 700; color: var(--green-800); letter-spacing: 1px; }
.vt-issued { font-size: 0.8rem; color: var(--ink-soft); }
.vt-note { font-size: 0.82rem; color: var(--ink-soft); margin-top: 1.3rem; text-align: center; display: flex; align-items: center; justify-content: center; gap: 8px; }
.vt-note i { color: var(--moss-600); }

/* Ações */
.vt-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-top: 1.8rem; }

/* ---------- Impressão ---------- */
@media print {
  .site-header, .gen-form, .vt-actions, .wa-float, .site-footer, .bilhete-head, .gen-hint { display: none !important; }
  body { background: #fff !important; }
  .bilhete-page { padding-top: 0 !important; }
  section { padding: 0 !important; }
  .vticket-area { display: block !important; }
  .vticket { box-shadow: none; border: 1.5px solid #cbd2bb; page-break-inside: avoid; }
  .vticket-stub::before, .vticket-stub::after { background: #fff; }
  .vt-note { margin-top: 1rem; }
}

/* ---------- Checkout / compra online ---------- */
.checkout-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 1.6rem; align-items: start; }
.buy-card { background: var(--white); border: 1px solid rgba(127, 148, 99, 0.18); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.1rem); box-shadow: var(--shadow-sm); }
.buy-card h3 { font-size: 1.35rem; margin-bottom: 1.1rem; }
.buy-field { margin-bottom: 1rem; }
.buy-field label { display: block; font-weight: 700; color: var(--green-800); font-size: 0.9rem; margin-bottom: 0.4rem; }
.buy-field input { width: 100%; font-family: var(--font-body); font-size: 1.02rem; padding: 0.85rem 1rem; border: 1.5px solid rgba(127, 148, 99, 0.3); border-radius: 12px; color: var(--green-800); background: var(--oat); }
.buy-field input:focus-visible { outline: 3px solid var(--moss-600); outline-offset: 2px; border-color: var(--moss-600); }
.buy-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.order-summary { position: sticky; top: 96px; background: linear-gradient(160deg, var(--green-800), var(--moss-700)); color: var(--cream); border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow); }
.order-summary h4 { color: var(--white); font-size: 1.3rem; margin-bottom: 0.2rem; }
.order-summary .sub { color: var(--wheat-soft); font-style: italic; font-family: var(--font-display); margin-bottom: 1.2rem; }
.order-line { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 0; border-top: 1px solid rgba(250, 248, 240, 0.16); color: rgba(250, 248, 240, 0.85); font-size: 0.95rem; }
.order-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 0.8rem; padding-top: 0.9rem; border-top: 1px solid rgba(250, 248, 240, 0.28); }
.order-total b { font-family: var(--font-display); font-size: 2rem; color: var(--white); }
.order-perks { margin-top: 1.2rem; display: grid; gap: 0.5rem; }
.order-perks li { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; color: rgba(250, 248, 240, 0.8); }
.order-perks i { color: var(--wheat); }

.pay-step { display: none; }
.pay-step.show { display: block; animation: fadeUp 0.5s var(--ease); }
.qr-wrap { text-align: center; }
.qr-img { width: 230px; height: 230px; margin: 0 auto 1rem; border-radius: 16px; border: 6px solid var(--white); box-shadow: var(--shadow-sm); background: var(--white); }
.pix-copia { display: flex; gap: 0.6rem; margin: 1rem 0; }
.pix-copia input { flex: 1; font-family: 'Courier New', monospace; font-size: 0.82rem; padding: 0.75rem 0.9rem; border: 1px solid rgba(127, 148, 99, 0.28); border-radius: 10px; background: var(--oat); color: var(--green-800); }
.pay-status { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--sage-100); color: var(--moss-700); font-weight: 700; padding: 0.9rem 1rem; border-radius: 12px; margin-top: 0.8rem; }
.pay-status.paid { background: #dff0dc; color: #2f7a3f; }
.buy-error { color: #b4463f; font-weight: 600; font-size: 0.9rem; margin-top: 0.6rem; display: none; }
.buy-error.show { display: block; }
.buy-hint { font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.9rem; display: flex; align-items: flex-start; gap: 8px; }
.buy-hint i { color: var(--moss-600); margin-top: 3px; }

@media (max-width: 860px) {
  .checkout-grid { grid-template-columns: 1fr; }
  .order-summary { position: static; order: -1; }
}

/* ---------- Painel admin ---------- */
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.6rem; }
.admin-stat { background: var(--white); border: 1px solid rgba(127, 148, 99, 0.18); border-radius: var(--radius); padding: 1.3rem; text-align: center; box-shadow: var(--shadow-sm); }
.admin-stat b { display: block; font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; color: var(--green-800); line-height: 1; }
.admin-stat span { font-size: 0.82rem; color: var(--ink-soft); font-weight: 600; }
.admin-table-wrap { background: var(--white); border: 1px solid rgba(127, 148, 99, 0.18); border-radius: var(--radius); padding: 0.5rem; box-shadow: var(--shadow-sm); overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 640px; }
.admin-table th { text-align: left; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sage-500); padding: 0.9rem 0.8rem; border-bottom: 1px solid rgba(127, 148, 99, 0.2); }
.admin-table td { padding: 0.8rem; border-bottom: 1px solid rgba(127, 148, 99, 0.12); color: var(--ink-soft); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .mono { font-family: 'Courier New', monospace; font-weight: 700; color: var(--green-800); letter-spacing: 0.5px; }
.admin-table .nowrap { white-space: nowrap; }
.badge-ok { background: var(--sage-100); color: var(--moss-700); font-weight: 700; font-size: 0.78rem; padding: 0.25rem 0.7rem; border-radius: 30px; }
.badge-used { background: #eadfd6; color: #9c6a3f; font-weight: 700; font-size: 0.78rem; padding: 0.25rem 0.7rem; border-radius: 30px; }
.admin-table .acts { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.admin-table .mini { display: inline-flex; align-items: center; gap: 5px; background: var(--oat); border: 1px solid rgba(127, 148, 99, 0.28); color: var(--green-800); font-family: var(--font-body); font-weight: 700; font-size: 0.78rem; padding: 0.4rem 0.65rem; border-radius: 8px; cursor: pointer; text-decoration: none; }
.admin-table .mini:hover { background: var(--sage-100); }

@media (max-width: 620px) {
  .admin-stats { grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
  .admin-stat b { font-size: 1.6rem; }
  .vticket { flex-direction: column; }
  .vticket-stub { width: 100%; border-left: none; border-top: 2px dashed rgba(250, 248, 240, 0.5); flex-direction: row; justify-content: space-around; padding: 1.2rem; }
  .vticket-stub::before { top: 50%; left: -10px; transform: translateY(-50%); }
  .vticket-stub::after { bottom: 50%; left: auto; right: -10px; top: 50%; transform: translateY(-50%); }
  .vticket-stub .st-bars { display: none; }
  .vt-meta { grid-template-columns: 1fr; }
}
