/* =======================================================================
   IPT Billing Modal Styles (cleaned + consolidated)
   - Removed duplicates / conflicting re-definitions
   - Tightened Terms overlay spacing + scroll behavior
   ======================================================================= */

/* ----------------------------
   Base modal layout
   ---------------------------- */
.ipt-billing-modal-body{
  position: relative;
  min-height: 390px;
  font-size: 0.9rem;
  background-color: #f3f4f6;
}

.ipt-billing-modal .modal-header{
  border-bottom: 1px solid #e5e5e5;
}

.modal-header,
.modal-footer{
  background-color: #fff !important;
}

.modal-content{
  background-color: #f3f4f6 !important;
}

/* Make modal a bit wider on desktop */
.modal-dialog.modal-lg{
  max-width: 960px;
}

/* ----------------------------
   Top summary card
   ---------------------------- */
.ipt-billing-summary-card{
  background-color: #f8f5ff;
  border-radius: 8px;
  padding: 8px 14px;
  border-left: 4px solid #7236d9;
  margin-bottom: 18px;
}

.ipt-billing-device-title{
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ipt-billing-device-badges{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ipt-billing-device-title-text{
  font-weight: 600;
  font-size: 14pt;
  display: inline-block;
}

.ipt-billing-intro{ margin-bottom: 4px; }

.ipt-billing-trial-copy{
  font-size: 0.8rem;
  color: #555;
}

/* Trial pill */
.ipt-billing-chip-trial{
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: #7236d9;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  margin-bottom: 0;
}

/* Apply License pill / PRO pill */
.ipt-billing-apply-badge,
.ipt-billing-pro-badge{
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #e8f7ea;
  color: #488700;
  border: 1px solid rgba(72,135,0,0.25);
  letter-spacing: 0.5px;
}

.ipt-billing-pro-badge{ margin-left: 8px; }

/* Optional: highlight service card when PRO is selected */
.ipt-billing-card-pro{
  border-color: rgba(72,135,0,0.55) !important;
  box-shadow: 0 4px 12px rgba(72,135,0,0.14) !important;
}

/* ----------------------------
   Main two-column sections
   ---------------------------- */
.ipt-billing-main-sections{
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.ipt-billing-column{
  flex: 1 1 0;
  min-width: 260px;
}

/* Card styling for service/payment panels */
.ipt-billing-card{
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid #e1e3f0;
  box-shadow: 0 4px 12px rgba(15,23,42,0.08);
  padding: 10px 14px 12px 14px;
  position: relative;
}

.ipt-billing-card-header{ margin-bottom: 8px; }

.ipt-billing-card-pill{
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  background-color: #f1e8ff;
  color: #3f268e;
  margin-bottom: 4px;
}

.ipt-billing-card-pill-secondary{
  background-color: #eef2ff;
  color: #343b8f;
}

.ipt-billing-card-subtitle{
  font-size: 0.8rem;
  color: #555;
}

.ipt-billing-card-body{ margin-top: 4px; }

.ipt-billing-section-header{
  font-weight: 600;
  margin-bottom: 4px;
}

.ipt-billing-service-price{
  font-weight: 500;
  margin-top: 4px;
}

.ipt-billing-service-marketing{ line-height: 1.2; }

/* Generic select styling with caret */
.ipt-billing-select,
#iptBillingPaymentSelect{
  max-width: 100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%237236d9' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 10px 6px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 1.75rem;
}

#iptBillingPaymentHint{ 
	font-size: 0.8rem; 
	margin-top: 6px; 
	padding-left: 6px;
}

.ipt-billing-cloud-addon .form-check-label{
  font-weight: 400;
  color: #6b7280;
  font-size: 0.85rem;
}

/* ----------------------------
   Footer layout + primary button
   ---------------------------- */
.ipt-billing-footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ipt-billing-footer-left{
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.ipt-billing-footer-note{
  font-size: 0.8rem;
  color: #555;
}

.ipt-billing-footer-right{
  display: flex;
  gap: 8px;
}

.ipt-billing-modal .btn-primary{
  background-color: #7236d9;
  border-color: #7236d9;
}
.ipt-billing-modal .btn-primary:hover{
  background-color: #5f2bb7;
  border-color: #5f2bb7;
}

/* ----------------------------
   Payment method / new card UI
   ---------------------------- */
.ipt-billing-newcard-box{
  border-radius: 6px;
  border: 1px dashed #cbd0e6;
  background-color: #f8fafc;
  padding: 8px 10px;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Card brand pills */
.ipt-card-pill{
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
}
.ipt-card-pill-visa{ background-color: #1a1f71; }
.ipt-card-pill-mastercard{ background: linear-gradient(90deg,#eb001b 0%,#f79e1b 100%); }
.ipt-card-pill-amex{ background-color: #2e77bb; }
.ipt-card-pill-discover{ background-color: #f58220; }
.ipt-card-pill-generic{ background-color: #4b5563; }

.ipt-billing-payment-group{ position: relative; }

/* Make space on the right for the card pill(s) */
#iptBillingPaymentSelect{ padding-right: 4.5rem; }

.ipt-billing-card-icons{
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-102%);
  display: flex;
  gap: 4px;
  pointer-events: none;
  z-index: 10;
}

#iptBillingQuoteNoteHelp{
  font-size: 0.8rem;
  color: #788079;
  opacity: 0.85;
}

/* Stripe element + fields */
.ipt-stripe-card-element{
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  background: #fff;
}

.ipt-billing-newcard-fields{ margin-bottom: 8px; }
.ipt-billing-newcard-fields .ipt-billing-field{ margin-bottom: 6px; }
.ipt-billing-newcard-fields label{
  font-size: 0.8rem;
  margin-bottom: 2px;
  display: block;
  color: #555;
}

/* ----------------------------
   Toggle switch
   ---------------------------- */
.ipt-switch{
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  margin: 0;
}
.ipt-switch input{
  opacity: 0;
  width: 0;
  height: 0;
}
.ipt-switch-slider{
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #d1d5db;
  transition: 0.2s;
  border-radius: 999px;
}
.ipt-switch-slider:before{
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background-color: #fff;
  transition: 0.2s;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ipt-switch input:checked + .ipt-switch-slider{ background-color: #7236d9; }
.ipt-switch input:checked + .ipt-switch-slider:before{ transform: translateX(20px); }
.ipt-switch input:disabled + .ipt-switch-slider{
  opacity: 0.55;
  cursor: not-allowed;
}

/* Trial toggle card states */
.ipt-billing-trial-toggle-card.is-muted{
  background: #f8fafc;
  border-color: #e5e7eb;
  box-shadow: none;
  opacity: 0.78;
  padding-top: 8px;
  padding-bottom: 8px;
}
.ipt-billing-trial-toggle-card.is-muted .ipt-switch-slider{ background-color: #e5e7eb; }

.ipt-billing-trial-toggle-copy{
  font-size: 0.82rem;
  color: #6b7280;
  line-height: 1.2;
  padding-left: 5px;
  padding-right: 12px;
}

.ipt-billing-trial-toggle-card.is-active{
  background: #fff;
  border-color: rgba(114,54,217,0.35);
  box-shadow: 0 4px 12px rgba(114,54,217,0.10);
  opacity: 1;
}
.ipt-billing-trial-toggle-card.is-active .ipt-billing-trial-toggle-copy{ color: #374151; }

/* ----------------------------
   Alerts / banners (consistent)
   ---------------------------- */
#iptBillingError,
#iptBillingSuccessMessage,
#iptBillingTermsError,
#iptStripeCardError,
#iptStripeCardSuccess{
  border-radius: 10px;
  padding: 10px 12px;
  box-sizing: border-box;
}

/* Modal banners (inside main modal) */
#iptBillingError{
  margin: 12px 18px;
}

#iptBillingError .ipt-billing-alert-inner{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
#iptBillingError .ipt-billing-alert-msg{
  flex: 1;
  min-width: 0;
}
#iptBillingError .ipt-billing-alert-close{
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  padding: 0 6px;
  cursor: pointer;
  opacity: 0.75;
}
#iptBillingError .ipt-billing-alert-close:hover{ opacity: 1; }

/* Stripe inline banners */
#iptStripeCardError,
#iptStripeCardSuccess{
  margin-left: 0;
  margin-right: 0;
  border-radius: 8px;
  padding: 10px 12px;
}

/* Terms overlay banner (dense) */
#iptBillingTermsError{
  margin: 0 0 8px 0 !important;
  padding: 10px 12px;
  border-radius: 10px;
}

/* Optional: highlight invalid field */
.ipt-billing-field-invalid{
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 .15rem rgba(220,53,69,.15);
}

/* ----------------------------
   Success UI (single definition)
   ---------------------------- */
#iptBillingSuccessMessage{
  margin: 14px 18px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,.08);
  background: #dbeee4; /* clean green */
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  overflow: hidden;
  text-align: left;
}

#iptBillingSuccessMessage strong,
#iptBillingSuccessMessage b{ font-weight: 700; }

#iptBillingSuccessMessage .ipt-billing-success-title,
#iptBillingSuccessMessage h1,
#iptBillingSuccessMessage h2,
#iptBillingSuccessMessage h3{
  margin: 0 0 8px 0;
  font-size: 16px;
  line-height: 1.2;
}

#iptBillingSuccessMessage p,
#iptBillingSuccessMessage div{ line-height: 1.35; }

/* Reduce huge vertical spacing if markup uses <br><br> */
#iptBillingSuccessMessage br + br{ display: none; }

/* Footer polish */
#iptBillingModal .modal-footer{
  padding: 10px 18px 14px 18px;
}
#iptBillingModal .modal-footer .btn{
  border-radius: 10px;
  padding: 8px 14px;
}
#iptBillingModal .modal-body{ padding-bottom: 10px; }

/* ----------------------------
   TERMS OVERLAY (dense + modal-friendly)
   - header/footer pinned, body scrolls
   ---------------------------- */

/* Visibility toggles (single source of truth) */
#iptBillingTermsOverlay,
#iptBillingSuccessOverlay{
  display: none !important;
}
#iptBillingTermsOverlay.is-visible,
#iptBillingSuccessOverlay.is-visible{
  display: flex !important;
}

/* Overlay backdrop */
.ipt-billing-terms-overlay,
.ipt-billing-success-overlay{
  position: absolute;
  inset: 0;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: rgba(15,23,42,0.35);
  overflow: hidden;
}

/* Box */
.ipt-billing-terms-box,
.ipt-billing-success-box{
  width: min(760px, 100%);
  max-height: calc(100% - 20px);
  background: #fff;
  border: 1px solid #e6e8f2;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(15,23,42,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header */
.ipt-billing-terms-head{
  padding: 10px 12px;
  border-bottom: 1px solid #eef0f6;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ipt-terms-head-left{
  display: flex;
  align-items: center;
  gap: 8px;
}

.ipt-terms-icon{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f0ff;
  color: #4b2bbd;
  border: 1px solid rgba(114,54,217,0.16);
}

.ipt-terms-title{
  font-weight: 900;
  color: #111827;
  font-size: 0.98rem;
  line-height: 1.1;
}

.ipt-terms-subtitle{
  margin-top: 1px;
  font-size: 0.80rem;
  color: #6b7280;
}

/* Body scroll */
.ipt-billing-terms-body{
  padding: 10px 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

/* Footer pinned */
.ipt-billing-terms-foot{
  border-top: 1px solid #eef0f6;
  padding: 8px 12px 10px 12px;
  margin: 0;
}

.ipt-billing-terms-ack{
  margin: 0 0 8px 0;
  font-size: 0.82rem;
  color: #374151;
}

.ipt-billing-terms-actions{
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ipt-billing-terms-actions .btn{
  border-radius: 10px;
  padding: 7px 12px;
}

#iptBillingTermsBackBtn{ margin-right: 8px; }

/* Terms content density */
#iptBillingTermsService{
  font-weight: 900;
  font-size: 0.92rem;
}

#iptBillingTermsService .ipt-terms-card-head{
  margin-bottom: 6px;
}

#iptBillingTermsSteps,
#iptBillingTermsPayment,
#iptBillingTermsTiming{
  display: none !important;
}

#iptBillingTermsBatching.ipt-terms-footnote{
  border: 0;
  background: transparent;
  padding: 0 2px;
  margin-top: 2px;
}

#iptBillingTermsBatching .ipt-terms-footnote-text{
  font-size: 0.78rem;
  line-height: 1.25;
  color: #6b7280;
}

#iptBillingTermsBatching strong{
  font-weight: 700;
}

/* Terms layout */
.ipt-terms-layout{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ipt-terms-card{
  border: 1px solid #e6e8f2;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: none;
}

.ipt-terms-card--summary{
  border-color: rgba(114,54,217,0.22);
  background: linear-gradient(180deg, #fbf9ff 0%, #ffffff 100%);
}

.ipt-terms-card--muted{
  background: #f8fafc;
  border-style: dashed;
  border-color: #d7daea;
}

.ipt-terms-card h6{
  font-size: 0.88rem;
  font-weight: 900;
  margin: 0 0 6px 0;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ipt-terms-pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.70rem;
  font-weight: 400; 
  letter-spacing: 0.2px;
  border: 1px solid transparent;
  white-space: nowrap;
  text-transform: uppercase;
}

.ipt-terms-pill--trial{
  background: #f1e8ff;
  color: #3f268e;
  border-color: rgba(114,54,217,0.25);
}
.ipt-terms-pill--billing{
  background: #eaf2ff;
  color: #1f3a8a;
  border-color: rgba(31,58,138,0.20);
}
.ipt-terms-pill--card{
  background: #e8f7ea;
  color: #1f5f2a;
  border-color: rgba(31,95,42,0.18);
}
.ipt-terms-pill--terms{
  background: #fff7e6;
  color: #8a4b00;
  border-color: rgba(138,75,0,0.18);
}
.ipt-terms-pill--service{
  background: #7236d9;
  color: #fff;
  border-color: rgba(114,54,217,0.35);
}

.ipt-terms-titleline{
  font-size: 0.88rem;
  line-height: 1.38;
  color: #111827;
}
.ipt-terms-titleline strong{ font-weight: 900; }

.ipt-terms-list{
  margin: 6px 0 0 0;
  padding: 0 0 0 18px;
  color: #4b5563;
  font-size: 0.84rem;
  line-height: 1.35;
}
.ipt-terms-list li{ margin: 4px 0; }

.ipt-terms-meta-row{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ipt-terms-meta{
  flex: 1 1 260px;
  border: 1px solid #eef0f6;
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 0.84rem;
  color: #374151;
}
.ipt-terms-meta b,
.ipt-terms-meta strong{ font-weight: 900; }

.ipt-terms-footnote{
  font-size: 0.82rem;
  color: #6b7280;
  padding-left: 2px;
}
.ipt-terms-footnote a{
  color: #7236d9;
  font-weight: 700;
  text-decoration: none;
}
.ipt-terms-footnote a:hover{ text-decoration: underline; }

/* Compact "What happens next" row */
.ipt-terms-steps{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #eef0f6;
}
.ipt-terms-steps .ipt-terms-steps-label{
  font-size: 0.80rem;
  font-weight: 900;
  color: #111827;
  margin-right: 2px;
}

.ipt-terms-step{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fbfbfe;
  border: 1px solid #eef0f6;
  flex: 0 0 auto;
}

.ipt-terms-step-num{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.72rem;
  background: #f1e8ff;
  color: #3f268e;
  border: 1px solid rgba(114,54,217,0.16);
}

.ipt-terms-step-text{
  font-size: 0.80rem;
  color: #374151;
  line-height: 1.1;
  white-space: nowrap;
}
.ipt-terms-step-text strong{ font-weight: 900; }

.ipt-terms-summary-head{
  display: flex;
  align-items: center;
  justify-content: flex-start; /* was space-between */
  gap: 8px;
  margin: 0 0 6px 0;
}

.ipt-terms-summary-pills{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ipt-terms-summary-left,
.ipt-terms-summary-right{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ipt-billing-success-overlay{
  display:none;
  padding: 14px;
}

.ipt-billing-success-overlay.is-visible{
  display:block;
}

.ipt-success-card{
  background:#ecfdf3;
  border:1px solid #b7ebc6;
  border-left:6px solid #2ea44f;
  border-radius:12px;
  padding:14px 16px;
  display:flex;
  gap:12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.10);
}

.ipt-success-icon{
  width:34px;
  height:34px;
  border-radius:10px;
  background:#d6f5e1;
  color:#1f7a37;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  flex: 0 0 auto;
}

.ipt-success-title{
  font-weight:700;
  font-size: 13.5pt;
  color:#0f172a;
  margin:0;
  line-height:1.2;
}

.ipt-success-subtitle{
  margin-top:2px;
  font-size: 0.88rem;
  color:#334155;
}

.ipt-success-message{
  margin-top:10px;
  color:#0f172a;
  font-size:0.9rem;
}

.ipt-success-list{
  margin:0;
  padding-left: 18px;
}

.ipt-success-list li{
  margin: 4px 0;
  color:#0f172a;
}

.ipt-success-actions{
  margin-top: 12px;
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}

.ipt-success-btn-primary{
  background:#7236d9;
  border-color:#7236d9;
  color:#fff;
}

.ipt-success-btn-primary:hover{
  filter: brightness(0.95);
  color:#fff;
}

.ipt-success-btn-secondary{
  background:#fff;
  border:1px solid #c7b6ff;
  color:#4b2bbd;
}

.ipt-success-btn-secondary:hover{
  background:#f6f1ff;
}

/* Billing Confirmation toast container -> bottom-right */
#iptBillingFlashContainer{
	position: fixed !important;
	right: 18px !important;
	bottom: 18px !important;
	top: auto !important;
	left: auto !important;

	z-index: 2147483000 !important; /* above most UI */
	width: 420px;
	max-width: calc(100vw - 36px);

	pointer-events: none; /* let clicks pass through except on the alert */
}

/* allow clicking close button */
#iptBillingFlashContainer .alert{
	pointer-events: auto;
	margin: 0;
}
  
@media (max-width: 520px){
	#iptBillingFlashContainer{ left: 12px !important; right: 12px !important; width: auto; }
}
/* Responsive */
@media (max-width: 768px){
  .ipt-billing-main-sections{ flex-direction: column; }

  .ipt-billing-footer{
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .ipt-billing-footer-right{
    width: 100%;
    justify-content: flex-end;
  }
}

/* Small-height viewports: slightly tighter */
@media (max-height: 720px){
  .ipt-billing-terms-overlay,
  .ipt-billing-success-overlay{
    padding: 8px;
  }
  .ipt-billing-terms-head{ padding: 9px 10px; }
  .ipt-billing-terms-body{ padding: 9px 10px; }
  .ipt-terms-layout{ gap: 7px; }
}




.btn-gradient-success {
    background: linear-gradient(to bottom, #6214a8, #410975) !important;
    border: none !important;
    color: white !important;
    transition: background 0.3s ease;
}

.btn-gradient-success:hover {
    /* Optional: Slightly shift the gradient on hover */
    background: linear-gradient(to bottom, #410975, #6214a8) !important;
}

.btn-success-purple {
    background-color: #6f2dbd;
    border-color: #6f2dbd;
    color: #fff;
}

.btn-success-purple:hover,
.btn-success-purple:focus {
    background-color: #5a23a0;
    border-color: #5a23a0;
    color: #fff;
}

.btn-success-purple:active {
    background-color: #4a1c86;
    border-color: #4a1c86;
}
