/* PopupCraft Pro – Frontend CSS v3 */

/* ── Overlay ── */
.pc-overlay {
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100% !important; height: 100% !important;
  background: rgba(0,0,0,0.7) !important;
  z-index: 2147483647 !important; /* max z-index */
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 12px !important;
  box-sizing: border-box !important;
  opacity: 0;
  transition: opacity 0.4s ease !important;
}
/* JS sets display then adds active for fade */
.pc-overlay.pc-show {
  display: flex !important;
}
.pc-overlay.pc-show.pc-active {
  opacity: 1 !important;
}

/* Position variants */
.pc-overlay.pc-br { align-items: flex-end !important; justify-content: flex-end !important; padding: 20px !important; }
.pc-overlay.pc-bl { align-items: flex-end !important; justify-content: flex-start !important; padding: 20px !important; }
.pc-overlay.pc-tc { align-items: flex-start !important; justify-content: center !important; padding-top: 70px !important; }

/* ── Popup Box ── */
.pc-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  max-width: 700px;
  width: 100%;
  transform: scale(0.85) translateY(30px);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
  max-height: 90vh;
  overflow-y: auto;
}
.pc-overlay.pc-show.pc-active .pc-box {
  transform: scale(1) translateY(0) !important;
}

/* ── Left Panel ── */
.pc-left {
  flex: 0 0 42%;
  min-height: 340px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pc-left img.pc-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.pc-left .pc-img-overlay {
  position: absolute; inset: 0;
}
.pc-left .pc-left-txt {
  position: relative; z-index: 2;
  text-align: center; color: #fff; padding: 20px;
}
.pc-left .pc-left-txt .pc-badge-emoji { font-size: 42px; display: block; margin-bottom: 8px; }
.pc-left .pc-left-txt strong { font-size: 20px; display: block; font-weight: 900; }
.pc-left .pc-left-txt span { font-size: 13px; opacity: 0.9; display: block; margin-top: 6px; }

/* ── Right Panel ── */
.pc-right {
  flex: 1;
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.pc-right h2 {
  font-size: 22px; font-weight: 900;
  line-height: 1.2; margin: 0;
  font-family: inherit;
}
.pc-right .pc-sub { font-size: 13px; color: #64748b; margin: 0; }

/* Form fields */
.pc-form { display: flex; flex-direction: column; gap: 8px; }
.pc-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pc-form input,
.pc-form select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #f8fafc;
  color: #1e293b;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.pc-form input:focus, .pc-form select:focus { border-color: #6366f1; background: #fff; }
.pc-phone-row { display: flex; gap: 6px; }
.pc-phone-flag {
  background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 8px;
  padding: 10px 10px; font-size: 13px; white-space: nowrap; color: #475569;
}
.pc-consent-row { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: #64748b; line-height: 1.4; }
.pc-consent-row input { width: auto !important; margin-top: 2px; flex-shrink: 0; accent-color: #6366f1; }
.pc-submit {
  width: 100%; padding: 13px;
  border: none; border-radius: 10px;
  font-size: 14px; font-weight: 800;
  cursor: pointer; font-family: inherit;
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
  margin-top: 2px;
}
.pc-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,0.4); }
.pc-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* Close button */
.pc-close {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.95);
  border: none; border-radius: 50%;
  font-size: 15px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 100; box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  transition: transform 0.15s;
  line-height: 1; padding: 0;
}
.pc-close:hover { transform: scale(1.15) rotate(90deg); }

/* Success state */
.pc-success {
  display: none;
  text-align: center;
  padding: 10px 0 20px;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.pc-success.show { display: flex; }
.pc-success-icon { font-size: 52px; }
.pc-success h3 { font-size: 20px; font-weight: 800; color: #1e293b; margin: 0; }
.pc-success p { font-size: 13px; color: #64748b; margin: 0; }

/* ── MOBILE ── */
@media (max-width: 640px) {
  .pc-box { flex-direction: column; max-width: 100%; border-radius: 14px; }
  .pc-left { flex: none; min-height: 150px; width: 100%; }
  .pc-right { padding: 20px 16px; }
  .pc-row2 { grid-template-columns: 1fr; }
  .pc-right h2 { font-size: 18px; }
}

/* ── TABLET ── */
@media (min-width: 641px) and (max-width: 1023px) {
  .pc-box { max-width: 560px; }
  .pc-left { flex: 0 0 38%; min-height: 280px; }
  .pc-right { padding: 24px 20px; }
}
