/* ============================================================
   MUNDO KIDS CRIATIVO — modal.css
   ============================================================ */

/* ── Overlay ── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10,5,46,.82);
  backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.open {
  display: flex;
  animation: mFadeIn .25s ease;
}
@keyframes mFadeIn { from { opacity:0; } to { opacity:1; } }

/* ── Box ── */
.modal-box {
  background: white; border-radius: 28px;
  width: 100%; max-width: 500px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
  position: relative;
  animation: mSlideUp .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes mSlideUp { from { transform: translateY(60px); opacity:0; } to { transform: translateY(0); opacity:1; } }

.modal-close {
  position: sticky; top: 12px; float: right; margin: 12px 14px 0 0;
  background: none; border: none; font-size: 1.4rem; cursor: pointer;
  color: rgba(255,255,255,.7); line-height: 1; padding: 4px 8px;
  border-radius: 50%; transition: background .2s; z-index: 10;
}
.modal-close:hover { background: rgba(255,255,255,.2); }

/* ── Header ── */
.modal-header {
  padding: 24px 28px 20px;
  background: linear-gradient(135deg, var(--mc1, #6d28d9), var(--mc2, #3b82f6));
  color: white;
}
.modal-emoji    { font-size: 2.2rem; display: block; margin-bottom: 6px; }
.modal-header h3 { font-family: var(--font-title, 'Fredoka One',cursive); font-size: 1.3rem; margin-bottom: 2px; }
.mprice-row     { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.mprice-old     { font-size: .82rem; text-decoration: line-through; opacity: .6; font-weight: 700; }
.mprice-new     { font-family: var(--font-title); font-size: 1.6rem; color: #FFD93D; }
.msavings       { background: rgba(255,255,255,.2); font-size: .75rem; font-weight: 800; padding: 3px 10px; border-radius: 20px; }

/* ── Steps ── */
.modal-steps {
  display: flex; align-items: center; justify-content: center;
  padding: 18px 28px 6px; background: white;
}
.mstep {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1; position: relative;
}
.mstep:not(:last-child)::after {
  content: ''; position: absolute; top: 13px; left: 60%; width: 80%;
  height: 2px; background: #e2e8f0; z-index: 0;
}
.mstep.done::after   { background: #22C55E; }
.mstep.active::after { background: #A855F7; }
.mstep-dot {
  width: 26px; height: 26px; border-radius: 50%; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 800;
  border: 2px solid #e2e8f0; background: white; color: #94a3b8;
  transition: all .3s;
}
.mstep.done   .mstep-dot { background: #22C55E; border-color: #22C55E; color: white; }
.mstep.active .mstep-dot { background: #A855F7; border-color: #A855F7; color: white; box-shadow: 0 0 0 4px rgba(168,85,247,.2); }
.mstep > span { font-size: .68rem; font-weight: 800; color: #94a3b8; white-space: nowrap; }
.mstep.active > span, .mstep.done > span { color: #1E1B4B; }

/* ── Body / Panels ── */
.modal-body   { padding: 20px 28px 28px; }
.mpanel       { display: none; }
.mpanel.active { display: block; animation: mFadeIn .2s ease; }

/* ── Fields ── */
.mfield { margin-bottom: 14px; }
.mfield label { display: block; font-size: .82rem; font-weight: 800; color: #475569; margin-bottom: 5px; }
.mfield input {
  width: 100%; padding: 11px 14px; border-radius: 12px;
  border: 2px solid #e2e8f0; font-size: .95rem; font-weight: 700;
  font-family: var(--font-body,'Nunito',sans-serif); outline: none;
  transition: border-color .2s;
}
.mfield input:focus { border-color: #A855F7; }
.mfield input.error { border-color: #EF4444; animation: shakeInput .4s ease; }
@keyframes shakeInput { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-6px)} 75%{transform:translateX(6px)} }

/* ── Payment Tabs ── */
.pay-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.pay-tab {
  padding: 12px; border: 2px solid #e2e8f0; border-radius: 14px;
  cursor: pointer; text-align: center; transition: all .2s; background: white;
}
.pay-tab:hover  { border-color: #A855F7; background: #faf5ff; }
.pay-tab.active { border-color: #A855F7; background: #faf5ff; box-shadow: 0 0 0 3px rgba(168,85,247,.15); }
.tab-icon  { font-size: 1.6rem; display: block; margin-bottom: 4px; }
.tab-label { font-family: var(--font-title); font-size: .95rem; color: #1E1B4B; display: block; }
.tab-sub   { font-size: .72rem; color: #64748b; font-weight: 700; display: block; }

/* ── PIX ── */
.pix-box {
  background: linear-gradient(135deg,#f0fdf4,#dcfce7);
  border: 2px solid #86efac; border-radius: 16px; padding: 20px; text-align: center;
}
.pix-box p { font-weight: 800; font-size: .88rem; color: #15803d; margin-bottom: 12px; }
.pix-qr {
  width: 200px; height: 200px; margin: 0 auto 14px;
  background: white; border-radius: 12px; padding: 8px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.1);
  overflow: hidden;
}
.pix-qr img {
  width: 100%; height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  border-radius: 6px;
}
.pix-key-box {
  background: white; border-radius: 10px; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  border: 1.5px solid #86efac; margin: 12px 0; flex-wrap: wrap; gap: 8px;
}
.pix-key     { font-size: .82rem; font-weight: 800; color: #1E1B4B; word-break: break-all; }
.copy-btn    { background: #22C55E; color: white; border: none; padding: 6px 14px; border-radius: 8px; font-family: var(--font-title); font-size: .8rem; cursor: pointer; white-space: nowrap; transition: background .2s; }
.copy-btn:hover  { background: #16a34a; }
.copy-btn.copied { background: #3B82F6; }
.pix-timer { font-size: .82rem; color: #16a34a; font-weight: 800; margin-top: 8px; }

/* ── Card ── */
.card-preview {
  background: linear-gradient(135deg,#1e1b4b,#4c1d95);
  border-radius: 16px; padding: 18px 22px; color: white; margin-bottom: 18px;
  position: relative; overflow: hidden;
}
.card-preview::before { content:''; position:absolute; top:-30px; right:-30px; width:100px; height:100px; border-radius:50%; background:rgba(255,255,255,.07); }
.card-preview::after  { content:''; position:absolute; bottom:-40px; left:-20px; width:130px; height:130px; border-radius:50%; background:rgba(255,255,255,.05); }
.card-chip {
  width:36px;height:28px;border-radius:6px;
  background:linear-gradient(135deg,#fcd34d,#f59e0b);
  margin-bottom:14px;display:grid;grid-template-columns:1fr 1fr;gap:2px;padding:4px;
}
.card-chip div { background:rgba(0,0,0,.2);border-radius:2px; }
.card-number-display { font-family:'Courier New',monospace;font-size:1.1rem;letter-spacing:3px;margin-bottom:12px;opacity:.9; }
.card-bottom { display:flex;justify-content:space-between;font-size:.75rem;opacity:.8; }
.card-bottom span { display:block;opacity:.6;font-size:.65rem;margin-bottom:2px; }

.card-group { position:relative;margin-bottom:12px; }
.card-group label { font-size:.8rem;font-weight:800;color:#475569;display:block;margin-bottom:5px; }
.card-group input {
  width:100%;padding:11px 40px 11px 14px;border-radius:12px;
  border:2px solid #e2e8f0;font-family:var(--font-body);
  font-size:.95rem;font-weight:700;outline:none;transition:border-color .2s;
}
.card-group input:focus { border-color:#A855F7; }
.card-group input.error { border-color:#EF4444;animation:shakeInput .4s ease; }
.card-icon { position:absolute;right:12px;top:33px;font-size:1.1rem; }
.card-row  { display:grid;grid-template-columns:1fr 1fr;gap:12px; }

.installments { background:#f8faff;border-radius:12px;padding:12px 14px;margin:14px 0; }
.installments label { font-size:.8rem;font-weight:800;color:#475569;display:block;margin-bottom:6px; }
.installments select { width:100%;border:2px solid #e2e8f0;border-radius:10px;padding:9px 12px;font-family:var(--font-body);font-size:.88rem;font-weight:700;outline:none;background:white; }

/* ── Action button ── */
.modal-action {
  width:100%;padding:15px;border-radius:16px;border:none;
  font-family:var(--font-title);font-size:1.1rem;cursor:pointer;
  background:linear-gradient(135deg,#A855F7,#3B82F6);
  color:white;box-shadow:0 6px 20px rgba(168,85,247,.35);
  transition:transform .2s,box-shadow .2s,opacity .2s;
  margin-top:6px;display:flex;align-items:center;justify-content:center;gap:8px;
}
.modal-action:hover  { transform:translateY(-2px);box-shadow:0 10px 28px rgba(168,85,247,.45); }
.modal-action:disabled { opacity:.65;cursor:not-allowed;transform:none; }
.spinner { width:18px;height:18px;border:3px solid rgba(255,255,255,.3);border-top-color:white;border-radius:50%;animation:spin .7s linear infinite;display:none; }
.modal-action.loading .spinner { display:block; }
.modal-action.loading .btn-label { opacity:.7; }
@keyframes spin { to { transform:rotate(360deg); } }

.modal-secure { display:flex;align-items:center;justify-content:center;gap:6px;margin-top:12px;font-size:.75rem;color:#94a3b8;font-weight:700; }

/* ── Success ── */
.success-panel { padding:32px 28px;text-align:center; }
.success-icon {
  width:80px;height:80px;border-radius:50%;
  background:linear-gradient(135deg,#22C55E,#16a34a);
  display:flex;align-items:center;justify-content:center;
  font-size:2.4rem;margin:0 auto 20px;
  box-shadow:0 8px 30px rgba(34,197,94,.35);
  animation:successPop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes successPop { from{transform:scale(0)} to{transform:scale(1)} }
.success-panel h3 { font-family:var(--font-title);font-size:1.6rem;color:#1E1B4B;margin-bottom:8px; }
.success-panel > p { color:#64748b;font-size:.95rem;font-weight:700;margin-bottom:20px; }
.download-btn {
  display:flex;align-items:center;justify-content:center;gap:10px;
  background:linear-gradient(135deg,#22C55E,#16a34a);
  color:white;padding:16px 32px;border-radius:16px;
  font-family:var(--font-title);font-size:1.1rem;text-decoration:none;
  margin:0 auto 16px;box-shadow:0 6px 20px rgba(34,197,94,.35);
  transition:transform .2s;max-width:320px;border:none;cursor:pointer;
}
.download-btn:hover { transform:translateY(-3px); }
.success-note  { font-size:.8rem;color:#94a3b8;font-weight:700;line-height:1.6; }
.confetti-row  { font-size:1.8rem;letter-spacing:6px;margin-bottom:12px; }
.upsell-box    { margin-top:20px;padding:14px;background:#f8faff;border-radius:14px; }
.upsell-box p  { font-size:.82rem;font-weight:800;color:#475569;margin-bottom:10px; }
.upsell-box a  { font-family:var(--font-title);font-size:.9rem;color:#A855F7;text-decoration:none; }
