/* ============================================================
   MargBooks — Shared Demo Modal CSS
   Matches screenshot exactly
   ============================================================ */

/* ---- Overlay ---- */
.mb-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.60);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mb-modal-overlay.is-open {
  display: flex;
}

/* ---- Box ---- */
.mb-modal {
  background: #ffffff;
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: mbModalIn 0.22s ease;
  position: relative;
  font-family: 'Poppins', sans-serif;
}

@keyframes mbModalIn {
  from { opacity: 0; transform: scale(0.92) translateY(-12px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);     }
}

/* ---- Header bar (teal) ---- */
.mb-modal-header {
  background: #1a73e8;
  padding: 14px 20px 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mb-modal-header-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
}

.mb-modal-header-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: #fff;
}

.mb-modal-header-text {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.3;
}

.mb-modal-close {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  line-height: 1;
}

.mb-modal-close:hover {
  background: rgba(255, 255, 255, 0.38);
}

/* ---- Body ---- */
.mb-modal-body {
  padding: 10px 24px 10px;
}

/* Star badge */
.mb-modal-star-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fffbea;
  border: 1px solid #f5e07a;
  border-radius: 22px;
  padding: 5px 16px;
  font-size: 10px;
  font-weight: 600;
  color: #7a5c00;
  margin-bottom: 10px;
}

.mb-modal-star-badge .star { color: #f5a623; font-size: 14px; }

/* Title */
.mb-modal-title {
  font-size: 21px;
  font-weight: 800;
  color: #1a73e8;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.3;
}

/* Description */
.mb-modal-desc {
  font-size: 12px;
  color: #666;
  text-align: center;
  line-height: 1.65;
  margin-bottom: 18px;
  max-width: 430px;
  margin-left: auto;
  margin-right: auto;
}

/* Stats row */
.mb-modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: #f5f8f8;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid #ebebeb;
}

.mb-modal-stat {
  padding: 13px 12px;
  text-align: center;
  border-right: 1px solid #e0e0e0;
}

.mb-modal-stat:last-child {
  border-right: none;
}

.mb-modal-stat-num {
  font-size: 18px;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.1;
  margin-bottom: 3px;
}

.mb-modal-stat-lab {
  font-size: 11.5px;
  color: #888;
  font-weight: 500;
}

/* Form */
.mb-modal-form { width: 100%; }

/* Name + Phone row */
.mb-modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.mb-modal-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.mb-modal-input-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  color: #aaa;
  pointer-events: none;
  z-index: 1;
}

.mb-modal-input {
  width: 100%;
  padding: 12px 14px 12px 36px;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  color: #333;
  outline: none;
  background: #fff;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.mb-modal-input::placeholder { color: #bbb; }
.mb-modal-input:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }

/* Phone input with flag */
.mb-modal-phone-wrap {
  display: flex;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
  background: #fff;
}

.mb-modal-phone-wrap:focus-within {
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

.mb-modal-flag-select {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  background: #f5f8f8;
  border: none;
  border-right: 1px solid #e0e0e0;
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Poppins', sans-serif;
  outline: none;
}

.mb-modal-phone-input {
  flex: 1;
  padding: 12px 12px;
  border: none;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  color: #333;
  outline: none;
  background: transparent;
  min-width: 0;
}

.mb-modal-phone-input::placeholder { color: #bbb; }

/* Business selector */
.mb-modal-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  color: #555;
  outline: none;
  background: #fff;
  margin-bottom: 14px;
  transition: border-color 0.18s, box-shadow 0.18s;
  cursor: pointer;
  appearance: auto;
}

.mb-modal-select:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }

/* Primary CTA button */
.mb-modal-btn-primary {
  width: 100%;
  padding: 14px 20px;
  background: #1a73e8;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: background 0.18s;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.2px;
}

.mb-modal-btn-primary:hover { background: #1558b0; }

/* OR divider */
.mb-modal-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.mb-modal-or::before,
.mb-modal-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.mb-modal-or span {
  font-size: 13px;
  color: #aaa;
  font-weight: 500;
  white-space: nowrap;
}

/* WhatsApp button */
.mb-modal-btn-wa {
  width: 100%;
  padding: 14px 20px;
  background: #1c1c1c;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: background 0.18s;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  text-decoration: none;
  letter-spacing: 0.2px;
}

.mb-modal-btn-wa:hover { background: #2d2d2d; }

.mb-modal-wa-icon {
  width: 22px;
  height: 22px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

/* Trust badges */
.mb-modal-trust-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: nowrap;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  margin-bottom: 8px;
}

.mb-modal-trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #555;
  font-weight: 500;
  white-space: nowrap;
  padding: 0 10px;
  border-right: 1px solid #e0e0e0;
}

.mb-modal-trust-item:last-child { border-right: none; }
.mb-modal-trust-item .ti-icon { font-size: 14px; color: #1a73e8; }

.mb-modal-expert {
  text-align: center;
  font-size: 12px;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.mb-modal-expert .clock-icon { font-size: 13px; }

/* ---- Responsive ---- */
@media (max-width: 540px) {
  .mb-modal-body { padding: 18px 16px 20px; }
  .mb-modal-title { font-size: 18px; }
  .mb-modal-row { grid-template-columns: 1fr; }
  .mb-modal-trust-row { flex-wrap: wrap; gap: 6px; }
  .mb-modal-trust-item { border-right: none; padding: 0 6px; }
  .mb-modal-header-text { font-size: 13px; }
}


/* ============================================================
   MODAL-BG / MODAL-BOX  (used across all pages)
   ============================================================ */

.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.60);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-bg.open {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  animation: modalBoxIn 0.22s ease;
  position: relative;
  font-family: 'Poppins', sans-serif;
}

@keyframes modalBoxIn {
  from { opacity: 0; transform: scale(0.92) translateY(-14px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* Close button */
.modal-x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.22);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  line-height: 1;
  font-family: 'Poppins', sans-serif;
  transition: background 0.15s;
}
.modal-x:hover { background: rgba(255,255,255,0.40); }

/* Top coloured bar */
.modal-top-bar {
  background: #1a73e8;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 14px 48px 14px 20px;
  line-height: 1.3;
}

/* Inner padding */
.modal-box h2 {
  padding: 14px 20px 2px;
}

.modal-box p {
  padding: 0 20px 10px;
}

.modal-box form {
  padding: 4px 20px 20px;
}

/* Responsive */
@media (max-width: 480px) {
  .modal-box { border-radius: 10px; }
  .modal-top-bar { font-size: 12px; padding: 12px 44px 12px 16px; }
}
