/* Payment flow polish. Scope every rule to the imported page roots. */
:root {
  --payment-wallet-surface: oklch(0 0 0);
  --payment-wallet-foreground: oklch(1 0 0);
}
.invoice-page,
.otp-page {
  background: radial-gradient(circle at top right, #e9f5ff 0, transparent 30rem), #f4f7fc;
}

.invoice-page .invoice-section {
  gap: 1.2rem;
  max-width: 1060px;
  padding: clamp(1rem, 3vw, 2rem);
  align-items: start;
}

.invoice-page .invoice-info,
.invoice-page .payment-form-container,
.otp-page main > div {
  border: 1px solid #dce7f2;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(19, 51, 83, 0.08);
}

.invoice-page .invoice-info,
.invoice-page .payment-form-container {
  padding: clamp(1.25rem, 3vw, 2rem) !important;
}

.invoice-page .invoice-info h5,
.invoice-page .payment-form-container > div:first-child > div:first-child {
  color: #17324f;
  letter-spacing: 0.01em;
}

.invoice-page .invoice-info > div > div:nth-child(2) {
  border: 1px solid #c8e0ef;
  background: linear-gradient(145deg, #f5fbff, #eaf5ff);
  border-radius: 16px;
}

.invoice-page .payment-form-container input,
.invoice-page .payment-form-container select {
  min-width: 0;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.invoice-page .payment-form-container input:focus-visible,
.invoice-page .payment-form-container select:focus-visible,
.otp-page #otp-verification-code:focus-visible {
  border-color: #1875cf;
  outline: none;
  box-shadow: 0 0 0 3px rgba(24, 117, 207, 0.15);
}

.invoice-page #expiry-month,
.invoice-page #expiry-year {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  text-align: center;
}

.invoice-page .payment-form-container form button[type="submit"] {
  min-height: 48px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(24, 117, 207, 0.19);
}

.invoice-page .payment-loading-modal {
  padding: 18px;
  background: rgba(12, 28, 47, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.invoice-page .payment-loading-content {
  width: min(100%, 390px);
  max-width: 390px;
  border: 1px solid #e2eaf2;
  border-radius: 24px;
  padding: 2rem 1.5rem;
  box-shadow: 0 26px 70px rgba(6, 26, 49, 0.3);
}

.invoice-page .payment-loading-logo {
  display: block;
  max-width: 146px;
  max-height: 74px;
  object-fit: contain;
  margin: 0 auto 1.5rem;
}

.invoice-page .payment-loading-spinner {
  border-color: #deebf4;
  border-top-color: #1775ce;
}

.invoice-page .payment-loading-content h3 {
  margin: 0.65rem 0 0.4rem;
  color: #17324f;
  font-size: 1.2rem;
  font-weight: 800;
}

.invoice-page .payment-loading-content p {
  color: #526477;
  line-height: 1.7;
}

/* The hosted flow auto-opens a "special offer" countdown popup when the
   invoice page mounts. It is marketing, not payment, so keep it off screen. */
.payment-loading-modal:has(img[src*="myoffer"]) {
  display: none !important;
}

/* Approved professional payment-waiting overlay. The page remains blocked
   while the admin accepts/rejects the submitted payment. */
.payment-loading-modal {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 1.25rem;
  background: rgba(2, 14, 27, 0.72) !important;
  -webkit-backdrop-filter: blur(13px);
  backdrop-filter: blur(13px);
}

.payment-loading-modal .payment-loading-content {
  position: relative;
  width: min(100%, 352px);
  max-width: 352px;
  overflow: hidden;
  padding: 1.875rem 1.5625rem 1.4375rem;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background: linear-gradient(145deg, #fff 0%, #f7fbfe 100%);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38), 0 8px 24px rgba(4, 73, 107, 0.18);
  text-align: center;
}

.payment-loading-modal .payment-loading-content::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #0a789f, #39b7ca, #1f6bb0);
  content: "";
}

.payment-loading-modal .payment-loading-logo {
  width: 194px;
  height: 56px;
  max-width: 100%;
  max-height: none;
  margin: 0 auto;
  padding: 8px 18px;
  border: 1px solid #e0edf4;
  border-radius: 16px;
  background: #f0f7fb;
  object-fit: contain;
}

.payment-loading-modal .payment-loading-spinner {
  position: relative;
  width: 82px !important;
  height: 82px !important;
  margin: 25px auto 18px !important;
  border: 0 !important;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #0b78a7 0deg,
    #56c7ce 145deg,
    rgba(86, 199, 206, 0.12) 255deg,
    #0b78a7 360deg
  );
  box-shadow: 0 10px 26px rgba(8, 116, 157, 0.18);
  animation: payment-spinner-rotate 1s linear infinite !important;
}

.payment-loading-modal .payment-loading-spinner::before {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: linear-gradient(145deg, #f8fdff 0%, #eaf7fb 100%);
  content: "";
}

.payment-loading-modal .payment-loading-spinner::after {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #0b78a7;
  box-shadow: 0 0 0 6px rgba(11, 120, 167, 0.1), 0 0 18px rgba(11, 120, 167, 0.35);
  content: "";
  animation: payment-spinner-pulse 1.4s ease-in-out infinite;
}

@keyframes payment-spinner-rotate {
  to { transform: rotate(360deg); }
}

@keyframes payment-spinner-pulse {
  0%, 100% { opacity: 0.72; transform: translate(-50%, -50%) scale(0.82); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.payment-loading-modal .payment-loading-eyebrow {
  margin: 0 0 10px !important;
  color: #6e8797 !important;
  font-size: 11px !important;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.payment-loading-modal .payment-loading-content h3 {
  margin: 0 !important;
  color: #102d44;
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1.65;
}

.payment-loading-modal .payment-loading-content .payment-loading-message {
  margin: 6px 0 0 !important;
  color: #4b6678 !important;
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.8;
}

.payment-loading-modal .payment-loading-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 16px;
  color: #34718a;
  font-size: 12px;
  font-weight: 700;
}

.payment-loading-modal .payment-loading-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a5a7;
  box-shadow: 0 0 0 5px rgba(22, 165, 167, 0.1);
}

.payment-loading-modal .payment-loading-progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5f0f4;
}

.payment-loading-modal .payment-loading-progress-bar {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b78a7, #53c4cc);
}

.payment-loading-modal .payment-loading-content .payment-loading-footer {
  margin: 17px 0 0 !important;
  color: #8ca1ad !important;
  font-size: 11px;
}

.otp-page main {
  width: 100%;
  max-width: 760px;
  margin: clamp(1rem, 5vh, 3rem) auto 2.5rem;
  padding: 0 1rem;
}

.otp-page main > div {
  padding: clamp(1.4rem, 4vw, 2.5rem);
}

.otp-page .otp-step-heading {
  margin: 0 0 1.25rem;
  color: #17324f;
  font-size: clamp(1.3rem, 4vw, 1.65rem);
  font-weight: 800;
  text-align: center;
}

.otp-page main > div > .bg-gray-50 {
  border: 1px solid #dceaf7;
  border-radius: 16px;
  background: #f2f8ff;
  color: #354b61;
  line-height: 1.8;
}

.otp-page main > div > .bg-gray-50 p:first-child {
  margin-top: 0;
}

.otp-page #otp-verification-code {
  width: min(100%, 240px);
  height: 62px;
  border-radius: 14px;
  color: #17324f;
  font-size: 1.6rem;
  letter-spacing: 0.33em;
  font-variant-numeric: tabular-nums;
}

.otp-page main button.bg-blue-500 {
  min-height: 50px;
  border-radius: 12px;
  background: #1775ce;
  box-shadow: 0 8px 20px rgba(24, 117, 207, 0.17);
}

.otp-page main button.bg-blue-500:hover:not(:disabled) {
  background: #125da6;
}

.otp-page main button:disabled {
  box-shadow: none;
}

@media (max-width: 640px) {
  .invoice-page .invoice-section {
    padding: 1rem;
  }
  .invoice-page .invoice-info,
  .invoice-page .payment-form-container {
    padding: 1.25rem !important;
  }
  .otp-page main {
    margin-top: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .invoice-page .payment-loading-spinner,
  .otp-page .animate-spin {
    animation-duration: 1.8s;
  }
}


/* Payment page review preview: clearer merchant-checkout hierarchy. These
   presentation-only rules do not change payment handlers or payloads. */
.invoice-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 88% 0%, rgba(31, 142, 183, 0.14), transparent 28rem),
    linear-gradient(180deg, #f5faff 0%, #eef5f9 100%);
}

.invoice-page .invoice-section {
  display: grid !important;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  width: min(100% - 32px, 1060px);
  gap: 1.25rem;
  padding: 2rem 0 4rem;
}

.invoice-page .invoice-info,
.invoice-page .payment-form-container {
  min-width: 0;
  border: 1px solid #d9e6ef !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 18px 42px rgba(18, 61, 91, 0.1), 0 2px 6px rgba(18, 61, 91, 0.04) !important;
}

.invoice-page .invoice-info {
  position: sticky;
  top: 1.25rem;
  overflow: hidden;
  padding: 1.25rem !important;
}

.invoice-page .invoice-info > div:first-child {
  gap: 1rem !important;
}

.invoice-page .invoice-info > div:first-child > div:first-child {
  padding-bottom: 0.25rem;
}

.invoice-page .invoice-info > div:first-child > div:first-child h5 {
  color: #123b56;
  font-size: 1rem;
  font-weight: 800;
}

.invoice-page .invoice-info > div > div:nth-child(2) {
  border: 1px solid #c9e0ed !important;
  border-radius: 16px !important;
  background: linear-gradient(145deg, #f7fcff 0%, #edf7fc 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.invoice-page .invoice-info > div > div:nth-child(2) img {
  max-height: 64px;
  max-width: 180px;
  object-fit: contain;
}

.invoice-page .invoice-info > div > div:last-child {
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e2edf3;
}

.invoice-page .invoice-info > div > div:last-child > span:last-child {
  color: #0877a3 !important;
  font-size: 1.45rem !important;
  font-weight: 900 !important;
}

.invoice-page .payment-form-container {
  padding: 1.5rem !important;
}

.invoice-page .payment-form-container > div:first-child {
  margin-bottom: 0 !important;
}

.invoice-page .payment-form-container > div:first-child > div:first-child {
  margin-bottom: 0.75rem !important;
  color: #123b56 !important;
  font-size: 1.08rem !important;
  font-weight: 850 !important;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) {
  display: grid !important;
  gap: 0.65rem !important;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div {
  min-height: 66px;
  border: 1px solid #d8e4ec !important;
  border-radius: 14px !important;
  background: #fff !important;
  color: #17344b !important;
  box-shadow: 0 4px 14px rgba(18, 61, 91, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:first-child {
  border-color: #0d83ae !important;
  background: linear-gradient(135deg, #f0fbff 0%, #fff 72%) !important;
  box-shadow: 0 8px 20px rgba(13, 131, 174, 0.12) !important;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:hover {
  border-color: #0d83ae !important;
  box-shadow: 0 8px 22px rgba(13, 131, 174, 0.12);
  transform: translateY(-1px);
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) img {
  width: auto;
  max-width: 170px;
  object-fit: contain;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div > div {
  gap: 0.75rem;
}

.invoice-page .payment-form-container hr {
  margin: 1.35rem 0 !important;
  border: 0;
  border-top: 1px solid #e2edf3;
}

.invoice-page .payment-form-container form {
  display: grid;
  gap: 0.9rem;
  margin-top: 0 !important;
}

.invoice-page .payment-form-container form > div {
  margin: 0 !important;
}

.invoice-page .payment-form-container form label {
  display: block;
  margin-bottom: 0.4rem;
  color: #355268 !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
}

.invoice-page .payment-form-container form input,
.invoice-page .payment-form-container form select {
  min-height: 3.15rem;
  border: 1px solid #cfdde6 !important;
  border-radius: 11px !important;
  background: #fbfdff !important;
  color: #17344b !important;
  box-shadow: inset 0 1px 2px rgba(19, 51, 83, 0.03) !important;
}

.invoice-page .payment-form-container form input::placeholder {
  color: #91a1ae;
}

.invoice-page .payment-form-container form .grid.grid-cols-3 {
  display: grid !important;
  direction: ltr !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-template-rows: auto auto;
  gap: 0.55rem !important;
  align-items: start;
}

.invoice-page .payment-form-container form .grid.grid-cols-3 > label:nth-child(1) {
  grid-column: 3;
  grid-row: 1;
}

.invoice-page .payment-form-container form .grid.grid-cols-3 > label:nth-child(2) {
  grid-column: 1 / 3;
  grid-row: 1;
}

.invoice-page .payment-form-container form .grid.grid-cols-3 > label:nth-child(3) {
  display: none !important;
}

.invoice-page .payment-form-container form .grid.grid-cols-3 > div:nth-child(4) {
  grid-column: 3;
  grid-row: 2;
  min-width: 0;
}

.invoice-page .payment-form-container form .grid.grid-cols-3 > div:nth-child(5) {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.invoice-page .payment-form-container form .grid.grid-cols-3 > div:nth-child(6) {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}

.invoice-page .payment-form-container form .grid.grid-cols-3 > label {
  min-width: 0;
  margin: 0 !important;
  color: #52677c !important;
  direction: rtl;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  line-height: 1.35;
  text-align: right;
}

.invoice-page .payment-form-container form button[type="submit"] {
  min-height: 3.35rem;
  margin-top: 0.25rem;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #1686d5 0%, #0d69b1 100%) !important;
  box-shadow: 0 12px 24px rgba(13, 105, 177, 0.22) !important;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.invoice-page .payment-form-container form button[type="submit"]:hover:not(:disabled) {
  background: linear-gradient(135deg, #1179c4 0%, #0a5b9c 100%) !important;
}

.invoice-page .payment-form-container > div:last-child {
  margin-top: 1.15rem !important;
  padding: 0.8rem 0.75rem;
  border: 1px solid #e0edf3;
  border-radius: 12px;
  background: #f7fbfd;
  color: #658092;
}

.invoice-page .payment-form-container > div:last-child img {
  height: 32px;
  object-fit: contain;
}

@media (max-width: 767px) {
  .invoice-page .invoice-section {
    grid-template-columns: minmax(0, 1fr);
    width: min(100% - 20px, 620px);
    gap: 0.9rem;
    padding: 1rem 0 3.5rem;
  }

  .invoice-page .invoice-info {
    position: static;
    padding: 1rem !important;
  }

  .invoice-page .payment-form-container {
    padding: 1rem !important;
  }

  .invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div {
    min-height: 60px;
    padding: 0.8rem !important;
  }

  .invoice-page .payment-form-container > div:first-child > div:nth-child(2) img {
    max-width: 145px;
  }
}

/* Formal insurance summary approved from the payment-page preview. This is
   presentation-only: the existing invoice data, method selection, and card
   submit handlers remain unchanged. */
.invoice-page .invoice-info {
  position: relative;
  overflow: hidden;
  padding: 0 !important;
  border: 1px solid rgba(12, 45, 67, 0.12) !important;
  border-radius: 24px !important;
  background: #fff !important;
  box-shadow: 0 22px 54px rgba(12, 45, 67, 0.13), 0 2px 8px rgba(12, 45, 67, 0.05) !important;
}

.invoice-page .invoice-info::before {
  display: block;
  height: 9.6rem;
  margin: -1px -1px 0;
  border-radius: 24px 24px 0 0;
  background:
    radial-gradient(circle at 15% 18%, rgba(64, 207, 193, 0.25), transparent 9rem),
    radial-gradient(circle at 92% 100%, rgba(255, 255, 255, 0.08), transparent 11rem),
    linear-gradient(135deg, #0b3048 0%, #174c68 100%);
  content: "";
}

.invoice-page .invoice-info::after {
  position: absolute;
  top: 1.45rem;
  right: 1.35rem;
  max-width: calc(100% - 2.7rem);
  color: #fff;
  content: "ملخص وثيقة التأمين\Aمراجعة رسمية قبل الدفع";
  font-size: 1.18rem;
  font-weight: 850;
  line-height: 1.9;
  text-align: right;
  white-space: pre;
}

.invoice-page .invoice-info > div:first-child {
  margin: 0 !important;
  padding: 1.15rem 1.35rem 0 !important;
  text-align: right !important;
}

.invoice-page .invoice-info > div:first-child h5 {
  color: #0c2d43 !important;
  font-size: 1rem !important;
  font-weight: 900 !important;
}

.invoice-page .invoice-info > div:first-child hr {
  margin-top: 0.75rem !important;
  border-color: #e1ebef !important;
}

.invoice-page .invoice-info > div:nth-child(2) {
  margin: 0.85rem 1.35rem 1.35rem !important;
  padding: 1rem !important;
  border: 1px solid #c4e6e1 !important;
  border-radius: 16px !important;
  background: linear-gradient(145deg, #f5fcfb 0%, #eaf8f6 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:first-child {
  margin-bottom: 0.9rem !important;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(14, 143, 136, 0.16);
}

.invoice-page .invoice-info > div:nth-child(2) > div:first-child img {
  max-width: 170px;
  max-height: 54px;
  object-fit: contain;
}

.invoice-page .invoice-info > div:nth-child(2) > div:first-child span {
  color: #0c2d43 !important;
  font-size: 0.92rem;
  font-weight: 900;
}

.invoice-page .invoice-info > div:nth-child(2) > div {
  color: #526b78;
}

.invoice-page .invoice-info > div:nth-child(2) > div:last-child {
  margin-top: 0.85rem !important;
  padding-top: 0.95rem !important;
  border-top: 1px solid rgba(12, 45, 67, 0.12) !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:last-child > span:first-child {
  color: #0c2d43 !important;
  font-weight: 900;
}

.invoice-page .invoice-info > div:nth-child(2) > div:last-child > span:last-child {
  color: #0e8f88 !important;
  font-size: 1.55rem !important;
  font-weight: 950 !important;
}

.invoice-page .payment-form-container {
  border: 1px solid rgba(12, 45, 67, 0.12) !important;
  border-radius: 24px !important;
  box-shadow: 0 18px 46px rgba(12, 45, 67, 0.1), 0 2px 8px rgba(12, 45, 67, 0.04) !important;
}

.invoice-page .payment-form-container > div:first-child > div:first-child {
  color: #0c2d43 !important;
  font-size: 1.1rem !important;
  font-weight: 900 !important;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div {
  border-radius: 14px !important;
  box-shadow: 0 5px 16px rgba(12, 45, 67, 0.06) !important;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:first-child {
  border-color: #0e8f88 !important;
  background: linear-gradient(135deg, #effbf9 0%, #fff 78%) !important;
  box-shadow: 0 8px 20px rgba(14, 143, 136, 0.12) !important;
}

@media (max-width: 767px) {
  .invoice-page .invoice-info::before {
    height: 8.8rem;
  }

  .invoice-page .invoice-info::after {
    top: 1.2rem;
    right: 1.05rem;
    font-size: 1.02rem;
  }

  .invoice-page .invoice-info > div:first-child {
    padding-right: 1rem !important;
    padding-left: 1rem !important;
  }

  .invoice-page .invoice-info > div:nth-child(2) {
    margin-right: 1rem !important;
    margin-left: 1rem !important;
  }
}

/* Formal checkout treatment for the live payment-method/card section. Keep
   the imported handlers and field IDs intact; these rules only improve the
   hierarchy, spacing, and visual affordance of the existing controls. */
.invoice-page .payment-form-container {
  overflow: hidden;
  padding: 0 !important;
}

.invoice-page .payment-form-container > div:first-child {
  margin: 0 !important;
  padding: 1.35rem 1.35rem 0 !important;
}

.invoice-page .payment-form-container > div:first-child > div:first-child {
  margin-bottom: 1rem !important;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e2edf3;
  font-size: 1.08rem !important;
}

.invoice-page .payment-form-container > div:first-child > div:first-child::after {
  display: block;
  margin-top: 0.35rem;
  color: #78909f;
  content: "اختر وسيلة الدفع المناسبة لإكمال الوثيقة";
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.7;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div {
  min-height: 76px;
  padding: 1rem 1.1rem !important;
  border-width: 1px !important;
  border-radius: 16px !important;
  background: linear-gradient(135deg, #f7fcfd 0%, #fff 78%) !important;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:first-child::before {
  display: block;
  margin-bottom: 0.15rem;
  color: #0c2d43;
  content: "البطاقة البنكية";
  font-size: 0.9rem;
  font-weight: 900;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:first-child > div {
  gap: 0.7rem;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:first-child img {
  height: 32px !important;
  max-width: 150px;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:first-child > div:last-child {
  color: #0e8f88 !important;
  font-size: 1rem;
  font-weight: 900;
}

.invoice-page .payment-form-container > div:first-child > h5,
.invoice-page .payment-form-container > div:first-child > div + h5 {
  margin-top: 1rem !important;
  padding: 0.7rem 0.85rem;
  border: 1px solid #e0edf3;
  border-radius: 12px;
  background: #f7fbfd;
}

.invoice-page .payment-form-container > hr,
.invoice-page .payment-form-container > div:first-child + hr {
  margin: 1.2rem 1.35rem !important;
}

.invoice-page .payment-form-container form {
  margin: 0 1.35rem 1.35rem !important;
  padding: 1.25rem;
  border: 1px solid #dce9ef;
  border-radius: 18px;
  background: linear-gradient(145deg, #fbfeff 0%, #f3fafc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.invoice-page .payment-form-container form::before {
  display: block;
  margin-bottom: 0.1rem;
  color: #0c2d43;
  content: "بيانات البطاقة";
  font-size: 0.95rem;
  font-weight: 900;
}

.invoice-page .payment-form-container form label {
  color: #355268 !important;
  font-size: 0.8rem !important;
  font-weight: 800 !important;
}

.invoice-page .payment-form-container form input,
.invoice-page .payment-form-container form select {
  min-height: 3.25rem;
  border-color: #c9dce5 !important;
  border-radius: 13px !important;
  background: #fff !important;
  box-shadow: 0 3px 10px rgba(18, 61, 91, 0.04) !important;
}

.invoice-page .payment-form-container form input:focus,
.invoice-page .payment-form-container form select:focus {
  border-color: #0e8f88 !important;
  box-shadow: 0 0 0 3px rgba(14, 143, 136, 0.13) !important;
}

.invoice-page .payment-form-container form button[type="submit"] {
  min-height: 3.45rem;
  margin-top: 0.4rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #118fca 0%, #0b6ca7 100%) !important;
  box-shadow: 0 12px 24px rgba(11, 108, 167, 0.2) !important;
  font-weight: 900;
}

.invoice-page .payment-form-container > div:last-child {
  margin: 0 1.35rem 1.35rem !important;
  padding: 0.85rem 1rem;
  border: 1px solid #dcebef;
  border-radius: 14px;
  background: #f8fcfd;
}

@media (max-width: 767px) {
  .invoice-page .payment-form-container > div:first-child {
    padding: 1.15rem 1rem 0 !important;
  }

  .invoice-page .payment-form-container form {
    margin-right: 1rem !important;
    margin-left: 1rem !important;
    padding: 1rem;
  }

  .invoice-page .payment-form-container > div:last-child {
    margin-right: 1rem !important;
    margin-left: 1rem !important;
  }
}
:root {
  --checkout-ink: #102a43;
  --checkout-muted: #63798c;
  --checkout-line: #dbe7ee;
  --checkout-teal: #0b8f8a;
  --checkout-teal-dark: #08716f;
  --checkout-blue: #1478c9;
  --checkout-surface: #f7fbfd;
}

/* Final visual pass: consistent Arabic typography, calmer surfaces, and
   stronger focus/press states while preserving all existing handlers. */
.invoice-page,
.otp-page,
.otp-main {
  font-family: var(--font-customer-arabic, "Noto Sans Arabic"), Tahoma, "Segoe UI", sans-serif;
  color: var(--checkout-ink);
}

.invoice-page :where(div, p, span, a, button, label, small, strong, b, li, input, select, textarea):not(.material-icons):not(.material-symbols-outlined):not([class*="icon"]),
.otp-page :where(div, p, span, a, button, label, small, strong, b, li, input, select, textarea):not(.material-icons):not(.material-symbols-outlined):not([class*="icon"]),
.otp-main :where(div, p, span, a, button, label, small, strong, b, li, input, select, textarea):not(.material-icons):not(.material-symbols-outlined):not([class*="icon"]) {
  font-family: inherit !important;
  letter-spacing: 0;
}

.invoice-page :where(h1, h2, h3, h4, h5, h6):not(.material-icons):not(.material-symbols-outlined):not([class*="icon"]),
.otp-page :where(h1, h2, h3, h4, h5, h6):not(.material-icons):not(.material-symbols-outlined):not([class*="icon"]),
.otp-main :where(h1, h2, h3, h4, h5, h6):not(.material-icons):not(.material-symbols-outlined):not([class*="icon"]) {
  font-family: var(--font-customer-heading-arabic, "Cairo"), Tahoma, "Segoe UI", sans-serif !important;
  letter-spacing: 0;
}

.chat-widget-header h2 {
  font-family: var(--font-customer-heading-arabic, "Cairo"), Tahoma, sans-serif !important;
}

.invoice-page .invoice-section {
  isolation: isolate;
}

.invoice-page .invoice-info,
.invoice-page .payment-form-container,
.otp-page main > div {
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.invoice-page .invoice-info > div:nth-child(2) > div:first-child img,
.invoice-page .payment-form-container img,
.otp-page main img {
  display: block;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
}

.invoice-page .invoice-info > div:nth-child(2) > div:first-child img {
  width: auto;
  min-width: 88px;
  height: 42px;
  padding: 5px 10px;
  border: 1px solid #d7e9ed;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div::after {
  position: absolute;
  inset: 0;
  border: 2px solid transparent;
  border-radius: inherit;
  content: "";
  pointer-events: none;
  transition: border-color 160ms ease;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:focus-within::after,
.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div[aria-checked="true"]::after {
  border-color: var(--checkout-teal);
}

.invoice-page .payment-form-container form input,
.invoice-page .payment-form-container form select {
  min-height: 3.35rem;
  font-size: 1rem !important;
  font-weight: 600;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.invoice-page .payment-form-container form input:hover,
.invoice-page .payment-form-container form select:hover {
  border-color: #9fc1d0 !important;
  background: #fff !important;
}

.invoice-page .payment-form-container form button[type="submit"] {
  position: relative;
  min-height: 3.65rem;
  overflow: hidden;
  background: linear-gradient(135deg, #0e9d98 0%, #0877a4 100%) !important;
  box-shadow: 0 14px 28px rgba(8, 119, 164, 0.22) !important;
  font-size: 1.02rem;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.invoice-page .payment-form-container form button[type="submit"]::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.2) 48%, transparent 76%);
  content: "";
  transform: translateX(-120%);
  transition: transform 500ms ease;
}

.invoice-page .payment-form-container form button[type="submit"]:hover:not(:disabled) {
  filter: saturate(1.08);
  box-shadow: 0 17px 32px rgba(8, 119, 164, 0.28) !important;
  transform: translateY(-1px);
}

.invoice-page .payment-form-container form button[type="submit"]:hover:not(:disabled)::before {
  transform: translateX(120%);
}

.invoice-page .payment-form-container form button[type="submit"]:active:not(:disabled),
.otp-page main button:active:not(:disabled) {
  transform: translateY(1px) scale(0.99);
}

/* Card verification page */
.otp-page {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 10% 0%, rgba(20, 120, 201, 0.13), transparent 22rem),
    linear-gradient(180deg, #f5fbfd 0%, #edf5f8 100%);
}

.otp-page main > div {
  overflow: hidden;
  border-color: rgba(12, 45, 67, 0.13);
  border-radius: 24px;
  box-shadow: 0 22px 58px rgba(12, 45, 67, 0.13), 0 2px 8px rgba(12, 45, 67, 0.05);
}

.otp-page main > div > div:first-child {
  min-height: 58px;
  margin: -0.25rem -0.25rem 1rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #e2edf1;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fcfd, #eef8f8);
}

.otp-page main > div > div:first-child img {
  width: auto;
  max-width: 46%;
  height: 42px;
  border-radius: 8px;
}

.otp-page main > div > .bg-gray-50 {
  margin-top: 0.5rem !important;
  padding: 1rem 1.1rem !important;
  border-color: #cfe4e8;
  background: linear-gradient(145deg, #f4fbfc 0%, #eef7fb 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
}

.otp-page main > div > .bg-gray-50 p {
  margin: 0.55rem 0 !important;
}

.otp-page main > div > div:nth-last-child(2) {
  padding: 0.9rem 0.85rem 0.1rem;
  border: 1px solid #e3edf1;
  border-radius: 16px;
  background: #fbfdfe;
}

.otp-page #otp-verification-code {
  width: min(100%, 260px);
  height: 66px;
  border: 1.5px solid #b7d0db !important;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(12, 78, 108, 0.07), inset 0 1px 2px rgba(16, 42, 67, 0.04);
  color: var(--checkout-ink);
  direction: ltr;
  font-size: 1.75rem;
  font-weight: 900;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
}

.otp-page #otp-verification-code::placeholder {
  color: #b5c6ce;
  letter-spacing: 0.28em;
}

.otp-page main button.bg-blue-500 {
  min-height: 3.55rem;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #0e9d98 0%, #0877a4 100%) !important;
  box-shadow: 0 13px 26px rgba(8, 119, 164, 0.2);
  font-size: 1rem;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.otp-page main button.bg-blue-500:hover:not(:disabled) {
  background: linear-gradient(135deg, #0b8a85 0%, #086895 100%) !important;
  box-shadow: 0 16px 30px rgba(8, 119, 164, 0.27);
  filter: saturate(1.08);
  transform: translateY(-1px);
}

.otp-page main button:not(.bg-blue-500) {
  min-height: 2.75rem;
  border-radius: 10px;
  font-weight: 800;
}

.otp-page main button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.otp-page .text-red-500 {
  color: #c2413b !important;
  font-weight: 700;
}

@media (max-width: 767px) {
  .invoice-page .invoice-section {
    width: min(100% - 16px, 620px);
    padding-top: 0.65rem;
  }

  .invoice-page .invoice-info,
  .invoice-page .payment-form-container,
  .otp-page main > div {
    border-radius: 20px !important;
  }

  .invoice-page .invoice-info::before {
    height: 8rem;
  }

  .invoice-page .invoice-info::after {
    top: 1.05rem;
    right: 1rem;
    font-size: 0.98rem;
    line-height: 1.75;
  }

  .invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div {
    min-height: 68px;
    padding: 0.85rem !important;
  }

  .invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:first-child::before {
    font-size: 0.84rem;
  }

  .invoice-page .payment-form-container form button[type="submit"] {
    min-height: 3.8rem;
    position: sticky;
    bottom: max(0.65rem, env(safe-area-inset-bottom));
    z-index: 2;
  }

  .otp-page main {
    width: min(100% - 1rem, 560px);
    margin-top: 0.5rem;
    padding: 0;
  }

  .otp-page main > div {
    padding: 1rem !important;
  }

  .otp-page main > div > div:first-child {
    margin: 0 0 0.8rem;
  }

  .otp-page main > div > div:first-child img {
    height: 36px;
  }

  .otp-page .otp-step-heading {
    margin-bottom: 0.9rem;
    font-size: 1.24rem;
  }

  .otp-page #otp-verification-code {
    width: min(100%, 250px);
    height: 62px;
    font-size: 1.55rem;
  }

  .otp-page main button.bg-blue-500 {
    min-height: 3.7rem;
  }
}

@media (max-width: 380px) {
  .invoice-page .payment-form-container form .grid.grid-cols-3 {
    gap: 0.45rem !important;
  }

  .invoice-page .payment-form-container form input,
  .invoice-page .payment-form-container form select {
    padding-right: 0.55rem !important;
    padding-left: 0.55rem !important;
  }

  .otp-page main > div > .bg-gray-50 {
    padding: 0.8rem !important;
    font-size: 0.8rem;
  }

  .otp-page #otp-verification-code {
    letter-spacing: 0.28em;
    text-indent: 0.28em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .invoice-page .payment-form-container form button[type="submit"],
  .otp-page main button.bg-blue-500,
  .invoice-page .payment-form-container form button[type="submit"]::before {
    transition: none;
  }
}

/* Final brand pass: keep checkout visuals on the site's blue palette. */
.invoice-page {
  --checkout-teal: #0a7cff;
  --checkout-teal-dark: #0757c9;
  --checkout-blue: #0a7cff;
  --checkout-surface: #f5f9ff;
  background:
    radial-gradient(circle at 88% 0%, rgba(10, 124, 255, 0.14), transparent 28rem),
    linear-gradient(180deg, #f7fbff 0%, #edf4fc 100%);
}

.invoice-page .invoice-info::before {
  background:
    radial-gradient(circle at 15% 18%, rgba(116, 190, 255, 0.28), transparent 9rem),
    radial-gradient(circle at 92% 100%, rgba(255, 255, 255, 0.1), transparent 11rem),
    linear-gradient(135deg, #082e63 0%, #0a7cff 100%);
}

.invoice-page .invoice-info > div:nth-child(2) {
  border-color: #c9ddf5 !important;
  background: linear-gradient(145deg, #f7fbff 0%, #eaf3ff 100%) !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:first-child {
  border-bottom-color: rgba(10, 124, 255, 0.16);
}

.invoice-page .invoice-info > div:nth-child(2) > div:last-child {
  border-top-color: rgba(10, 124, 255, 0.14) !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:last-child > span:last-child,
.invoice-page .invoice-info > div > div:last-child > span:last-child {
  color: #0a6ed1 !important;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:first-child {
  border-color: #0a7cff !important;
  background: linear-gradient(135deg, #eef6ff 0%, #fff 78%) !important;
  box-shadow: 0 8px 22px rgba(10, 124, 255, 0.14) !important;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:hover {
  border-color: #0a7cff !important;
  box-shadow: 0 9px 24px rgba(10, 124, 255, 0.15) !important;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:focus-within::after,
.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div[aria-checked="true"]::after {
  border-color: #0a7cff;
}

.invoice-page .payment-form-container form input:focus,
.invoice-page .payment-form-container form select:focus,
.invoice-page .payment-form-container [role="combobox"]:focus {
  border-color: #0a7cff !important;
  box-shadow: 0 0 0 3px rgba(10, 124, 255, 0.16) !important;
}

.invoice-page .payment-form-container form button[type="submit"] {
  background: linear-gradient(135deg, #1688ff 0%, #0757c9 100%) !important;
  box-shadow: 0 14px 28px rgba(7, 87, 201, 0.24) !important;
}

.invoice-page .payment-form-container form button[type="submit"]:hover:not(:disabled) {
  background: linear-gradient(135deg, #0a7cff 0%, #064aa9 100%) !important;
  box-shadow: 0 17px 32px rgba(7, 87, 201, 0.3) !important;
}

.payment-loading-modal .payment-loading-content::before {
  background: linear-gradient(90deg, #0757c9, #0a7cff, #63b3ff);
}

.payment-loading-modal .payment-loading-spinner {
  background: conic-gradient(
    from 0deg,
    #0757c9 0deg,
    #4da3ff 145deg,
    rgba(77, 163, 255, 0.12) 255deg,
    #0757c9 360deg
  );
  box-shadow: 0 10px 26px rgba(7, 87, 201, 0.2);
}

.payment-loading-modal .payment-loading-spinner::after {
  background: #0757c9;
  box-shadow: 0 0 0 6px rgba(7, 87, 201, 0.1), 0 0 18px rgba(7, 87, 201, 0.35);
}

/* Mobile summary pass: make the selected insurer, price breakdown, and total
   easy to scan without changing the invoice data or payment flow. */
@media (max-width: 767px) {
  .invoice-page .invoice-section {
    width: min(100% - 1rem, 620px);
    gap: 0.75rem;
    padding: 0.75rem 0 3rem;
  }

  .invoice-page .invoice-info {
    border-radius: 18px !important;
    box-shadow: 0 14px 32px rgba(7, 52, 102, 0.12) !important;
  }

  .invoice-page .invoice-info::before {
    height: 7.25rem;
    border-radius: 18px 18px 0 0;
  }

  .invoice-page .invoice-info::after {
    top: 0.95rem;
    right: 1rem;
    max-width: calc(100% - 2rem);
    font-size: 0.92rem;
    line-height: 1.7;
  }

  .invoice-page .invoice-info > div:first-child {
    padding: 0.85rem 0.95rem 0 !important;
  }

  .invoice-page .invoice-info > div:first-child h5 {
    margin: 0;
    color: #355268 !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
  }

  .invoice-page .invoice-info > div:first-child hr {
    margin: 0.55rem 0 0 !important;
  }

  .invoice-page .invoice-info > div:nth-child(2) {
    margin: 0.7rem 0.75rem 0.85rem !important;
    padding: 0.8rem !important;
    border-radius: 16px !important;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:first-child {
    margin-bottom: 0.65rem !important;
    padding-bottom: 0.7rem;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:first-child > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-height: 3rem;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:first-child > div:first-child img {
    flex: 0 0 auto;
    width: auto;
    min-width: 82px;
    height: 38px;
    max-width: 44%;
    padding: 4px 8px;
    border-radius: 9px;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:first-child > div:first-child span {
    min-width: 0;
    color: #123b56 !important;
    font-size: 0.82rem;
    line-height: 1.55;
    text-align: right;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:first-child > div:not(:first-child) {
    margin-top: 0.65rem;
    padding: 0.6rem 0.65rem;
    border: 1px solid #dce9f7;
    border-radius: 10px;
    background: #f8fbff;
    font-size: 0.75rem;
    line-height: 1.75;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) {
    margin-bottom: 0.65rem !important;
    padding: 0.1rem 0 !important;
    font-size: 0.78rem;
    line-height: 1.7;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem !important;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div > span:first-child {
    min-width: 0;
    color: #5c7488;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div > span:last-child {
    flex: 0 0 auto;
    color: #294b69;
    white-space: nowrap;
    font-weight: 700;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.55rem !important;
    padding-top: 0.75rem !important;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:last-child > span:first-child {
    color: #244766 !important;
    font-size: 0.82rem;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:last-child > span:last-child {
    flex: 0 0 auto;
    color: #0757c9 !important;
    font-size: 1.32rem !important;
    line-height: 1.2;
  }
}


/* Final mobile checkout fit/performance pass. Keep all payment handlers unchanged. */

@media (max-width: 767px) {
  .invoice-page {
    min-height: 100vh;
    min-height: 100svh;
    overflow-x: hidden;
  }

  .invoice-page .invoice-section {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: min(calc(100% - 1rem), 620px) !important;
    margin-inline: auto;
  }

  .invoice-page .invoice-section > *,
  .invoice-page .invoice-info,
  .invoice-page .payment-form-container {
    min-width: 0;
    max-width: 100%;
  }

  /* Backdrop blurs are costly to repaint while the animated loader is visible. */
  .invoice-page .invoice-info,
  .invoice-page .payment-form-container,
  .payment-loading-modal {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div,
  .invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div > div {
    min-width: 0;
  }

  .invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div > div {
    flex-wrap: wrap;
  }

  .invoice-page .payment-form-container form,
  .invoice-page .payment-form-container form > div,
  .invoice-page .payment-form-container form label {
    min-width: 0;
  }

  .invoice-page .payment-form-container form input,
  .invoice-page .payment-form-container form select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px !important;
  }

  .invoice-page .payment-form-container form .grid.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

}

@media (max-width: 380px) {
  .invoice-page .payment-form-container form .grid.grid-cols-3 {
    gap: 0.375rem !important;
  }

  .invoice-page .payment-form-container form input,
  .invoice-page .payment-form-container form select {
    padding-right: 0.45rem !important;
    padding-left: 0.45rem !important;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div > span:last-child {
    white-space: normal;
  }
}

@media (hover: none) and (pointer: coarse) {
  .invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:hover {
    transform: none;
    transition: none;
  }
}


/* Invoice-style order summary: presentation only; keep the existing quote data. */
.invoice-page .invoice-info {
  border: 1px solid #d8e0e8 !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08) !important;
}

.invoice-page .invoice-info::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px !important;
  margin: 0 !important;
  border-radius: 16px 16px 0 0 !important;
  background: #1f4e79 !important;
  content: "" !important;
}

.invoice-page .invoice-info::after {
  display: none !important;
  content: none !important;
}

.invoice-page .invoice-info > div:first-child {
  margin: 0 !important;
  padding: 1.2rem 1.35rem 0.85rem !important;
  text-align: right !important;
}

.invoice-page .invoice-info > div:first-child h5 {
  margin: 0 !important;
  color: #23384d !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.invoice-page .invoice-info > div:first-child hr {
  margin-top: 0.8rem !important;
  border-color: #e4e9ef !important;
}

.invoice-page .invoice-info > div:nth-child(2) {
  margin: 0.75rem 1.1rem 1.1rem !important;
  padding: 1rem !important;
  border: 1px solid #e0e6ed !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: none !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:first-child {
  margin-bottom: 0.8rem !important;
  padding-bottom: 0.8rem !important;
  border-bottom: 1px solid #e7ecf1 !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:first-child span {
  color: #263b50 !important;
  font-weight: 600 !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:first-child > div:not(:first-child) {
  border-color: #e7ecf1 !important;
  border-radius: 8px !important;
  background: #f8fafc !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) {
  margin: 0 0 0.65rem !important;
  padding: 0 !important;
  background: transparent !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  min-height: 2.45rem;
  margin: 0 !important;
  padding: 0.55rem 0 !important;
  border-bottom: 1px solid #edf1f5;
  color: #536273;
  line-height: 1.6;
}

.invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div:last-child {
  border-bottom: 0;
}

.invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div > span:first-child {
  min-width: 0;
  color: #647386 !important;
  font-size: 0.9rem;
  font-weight: 400 !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div > span:last-child {
  flex: 0 0 auto;
  color: #26384b !important;
  font-size: 0.92rem;
  font-weight: 600 !important;
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.invoice-page .invoice-info > div:nth-child(2) > div:last-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 0.75rem 0 0 !important;
  padding: 0.9rem 0 0 !important;
  border-top: 2px solid #d9e1e9 !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:last-child > span:first-child {
  color: #26384b !important;
  font-size: 0.95rem;
  font-weight: 700 !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:last-child > span:last-child {
  color: #0b5db7 !important;
  font-size: 1.3rem !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .invoice-page .invoice-info {
    border-radius: 14px !important;
  }

  .invoice-page .invoice-info::before {
    border-radius: 14px 14px 0 0 !important;
  }

  .invoice-page .invoice-info > div:first-child {
    padding: 1rem 1rem 0.7rem !important;
  }

  .invoice-page .invoice-info > div:nth-child(2) {
    margin: 0.65rem 0.75rem 0.85rem !important;
    padding: 0.8rem !important;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div {
    gap: 0.55rem;
    min-height: 2.3rem;
    font-size: 0.84rem;
  }

  .invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div > span:first-child {
    font-size: 0.84rem;
  }
}


/* Insurance offer cards: clearer quote hierarchy with no horizontal overflow. */
#root .quote-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0 !important;
  border: 1px solid #dce5ee !important;
  border-inline-start: 4px solid #1f4e79 !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(20, 43, 61, 0.08) !important;
  overflow: hidden !important;
  transition: box-shadow 180ms ease, border-color 180ms ease;
}

#root .quote-card.selected {
  border-color: #b9d8d0 !important;
  border-inline-start-color: #0f766e !important;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.14), 0 12px 28px rgba(20, 43, 61, 0.1) !important;
}

#root .quote-card-inner {
  grid-template-columns: minmax(175px, 220px) minmax(0, 1fr) minmax(220px, 260px) !important;
  align-items: stretch;
  gap: 16px;
  padding: 16px !important;
}

#root .quote-card-inner > * {
  min-width: 0;
  max-width: 100%;
}

#root .quote-left {
  min-width: 0;
  gap: 12px;
}

#root .quote-logo {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-color: #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

#root .quote-company {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

#root .quote-mid {
  min-width: 0;
  padding: 2px 0;
  overflow-wrap: anywhere;
}

#root .quote-mid > div:first-child,
#root .quote-mid > div:nth-child(2) {
  font-family: var(--font-customer-heading-arabic, "Cairo"), Tahoma, sans-serif !important;
}

#root .quote-mid > div:first-child {
  font-size: 1rem;
  line-height: 1.55;
}

#root .quote-mid ul {
  margin: 0;
  padding-inline-start: 0;
  padding-inline-end: 1rem;
}

#root .quote-mid li {
  line-height: 1.65;
  overflow-wrap: anywhere;
}

#root .quote-mid > div:last-child {
  color: #728196 !important;
  font-size: 0.75rem !important;
  line-height: 1.65;
}

#root .quote-card-inner > :nth-child(3) {
  display: flex;
  min-width: 0;
  align-items: stretch;
}

#root .quote-card-inner > :nth-child(3) > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 16px !important;
  border-color: #e0e7ef !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #f8fafc, #fff) !important;
}

#root .quote-card-inner > :nth-child(3) > div > div {
  min-width: 0;
  align-items: baseline;
  gap: 8px;
  line-height: 1.55;
}

#root .quote-card-inner > :nth-child(3) > div > div span {
  font-variant-numeric: tabular-nums;
}

#root .quote-card-inner > :nth-child(3) > div > div.border-t {
  border-color: #e1e7ef !important;
}

#root .quote-card-inner > :nth-child(3) > div > div.border-t > div {
  color: #0f766e !important;
  font-size: 1.2rem;
  line-height: 1.35;
}

#root .quote-card-inner > :nth-child(3) > div > div.border-t > div span {
  color: #5f6f80 !important;
  font-size: 0.78rem;
}

#root .quote-card-inner > :nth-child(3) > div > button {
  min-height: 48px;
  margin-top: 8px !important;
  padding: 0.65rem 1rem !important;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #1683d8, #0b5db7) !important;
  font-family: var(--font-customer-arabic, "Noto Sans Arabic"), Tahoma, sans-serif !important;
  font-size: 1rem !important;
  line-height: 1.5;
  white-space: normal;
  box-shadow: 0 6px 16px rgba(11, 93, 183, 0.18);
}

#root .quote-card-inner > :nth-child(3) > div > button:focus-visible {
  outline: 3px solid rgba(11, 93, 183, 0.28);
  outline-offset: 2px;
}

/* The bubble is fixed above Google’s bottom-corner reCAPTCHA badge and never
   participates in the form/document layout. The badge itself is not changed. */
.chat-widget-toggle {
  right: 16px !important;
  left: auto !important;
  bottom: 88px !important;
  z-index: 1000 !important;
  width: 56px !important;
  height: 56px !important;
}

.chat-widget-container {
  right: 16px !important;
  left: auto !important;
  bottom: 152px !important;
  z-index: 1001 !important;
  max-height: calc(100vh - 180px);
  max-height: calc(100dvh - 180px);
}

@media (max-width: 900px) {
  #root .quote-card-inner {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px;
    padding: 14px !important;
  }

  #root .quote-card-inner > :nth-child(3) {
    margin-top: 0;
  }
}

@media (max-width: 768px) {
  #root .quote-card {
    border-radius: 14px !important;
  }

  #root .quote-card-inner {
    gap: 10px;
    padding: 12px !important;
  }

  #root .quote-mid {
    padding-top: 12px;
    border-top: 1px solid #edf1f5;
  }

  #root .quote-card-inner > :nth-child(3) > div {
    padding: 12px !important;
  }

  #root .quote-card-inner > :nth-child(3) > div > div.flex.justify-between {
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  #root .quote-card-inner > :nth-child(3) > div > div.flex.justify-between > span {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  #root .quote-card-inner > :nth-child(3) > div > button {
    width: 100%;
    min-height: 48px;
    margin-top: 8px !important;
    font-size: 0.98rem !important;
  }

  .chat-widget-toggle {
    right: 12px !important;
    bottom: 88px !important;
  }

  .chat-widget-container {
    right: 12px !important;
    left: 12px !important;
    bottom: 152px !important;
    width: auto !important;
    height: min(500px, calc(100vh - 184px)) !important;
    height: min(500px, calc(100dvh - 184px)) !important;
    max-height: calc(100dvh - 184px) !important;
  }
}

@media (max-width: 480px) {
  #root .quote-card-inner {
    gap: 9px;
    padding: 11px !important;
  }

  #root .quote-left {
    align-items: flex-start;
    gap: 10px;
  }

  #root .quote-logo {
    flex-basis: 52px;
    width: 52px;
    height: 52px;
    padding: 5px;
  }

  #root .quote-company {
    font-size: 0.92rem;
  }

  #root .quote-mid > div:first-child {
    font-size: 0.96rem;
  }

  #root .quote-mid > div:last-child {
    font-size: 0.72rem !important;
  }

  #root .quote-card-inner > :nth-child(3) > div > div.flex.justify-between {
    font-size: 0.84rem;
  }

  #root .quote-card-inner > :nth-child(3) > div > div.border-t > div {
    font-size: 1.1rem;
  }
}

@media (max-width: 360px) {
  #root .quote-logo {
    flex-basis: 48px;
    width: 48px;
    height: 48px;
  }

  #root .quote-card-inner > :nth-child(3) > div {
    padding: 10px !important;
  }

  #root .quote-card-inner > :nth-child(3) > div > div.flex.justify-between {
    align-items: flex-start;
    gap: 4px 8px;
  }

  #root .quote-card-inner > :nth-child(3) > div > div.flex.justify-between > b {
    max-width: 100%;
    font-size: 0.78rem;
    line-height: 1.45;
  }

  #root .quote-card-inner > :nth-child(3) > div > div.flex.justify-between > span {
    font-size: 0.82rem;
  }
}

/* Payment-only layout: legible Arabic text and an unframed summary. */
.invoice-page {
  font-family: "Noto Sans Arabic", Tahoma, sans-serif !important;
  line-height: 1.7;
  letter-spacing: 0;
}
.invoice-page :where(h1,h2,h3,h4,h5,h6,input,select,button,label,span,p) {
  font-family: inherit !important;
  letter-spacing: 0 !important;
}
.invoice-page > section {
  display: grid !important;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  gap: 32px;
  width: min(100%, 1060px);
  margin: 0 auto;
  padding: 32px 24px 100px;
}
.invoice-page .invoice-info,
.invoice-page .payment-form-container {
  min-width: 0;
  width: 100% !important;
  border-radius: 8px !important;
}
.invoice-page .invoice-info {
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}
.invoice-page .invoice-info::before,
.invoice-page .invoice-info::after { display: none !important; }
.invoice-page .invoice-info > div:nth-child(2) {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}
.invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
.invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div {
  display: flex !important;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 0 !important;
  font-size: 14px !important;
}
.invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div > span:last-child {
  min-width: 90px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 15px !important;
}
.invoice-page .payment-form-container form {
  border: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.invoice-page .payment-form-container form label { font-size: 13px !important; }
.invoice-page .payment-form-container form input { border-radius: 6px !important; }
.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div[data-apple-pay-option] {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 72px;
  background: var(--payment-wallet-surface) !important;
  border-color: var(--payment-wallet-surface) !important;
  color: var(--payment-wallet-foreground) !important;
  border-radius: 6px !important;
}
.invoice-page .payment-form-container [data-apple-pay-option] img {
  width: 90px !important;
  height: 38px !important;
  max-width: none !important;
  opacity: 1 !important;
  filter: brightness(0) invert(1) !important;
  object-fit: contain;
}
.invoice-page [data-apple-pay-option]:focus-visible {
  outline: 2px solid var(--checkout-blue);
  outline-offset: 3px;
}
.invoice-page .payment-unavailable-notice {
  display: grid;
  gap: 4px;
  margin: 12px 0 0;
  padding: 12px;
  color: var(--checkout-ink);
  background: var(--checkout-surface);
  border-right: 3px solid var(--checkout-blue);
  font-size: 14px;
  line-height: 1.6;
}
.invoice-page .payment-unavailable-notice [lang="ar"] {
  direction: rtl;
  text-align: right;
  unicode-bidi: isolate;
}
.invoice-page .payment-unavailable-notice [lang="en"] {
  direction: ltr;
  text-align: left;
  unicode-bidi: isolate;
}
@media (max-width: 767px) {
  .invoice-page > section {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 24px 16px 120px;
  }
}

/* OTP trust pass: bank-style secure-verification cues. Presentation only;
   no markup, handlers, or payloads change. */
.otp-page main > div::before {
  content: "تحقق آمن ومشفر";
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -0.25rem -0.25rem 1rem;
  padding: 0.7rem 1rem;
  padding-inline-start: 2.7rem;
  border-radius: 12px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") no-repeat right 0.95rem center / 1.05rem,
    linear-gradient(135deg, #082e63 0%, #0a7cff 100%);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.otp-page main > div > div:first-child {
  margin: 0 0 1rem;
  padding: 0.35rem 0.25rem 0.9rem;
  border: 0;
  border-bottom: 1px solid #e6eef3;
  border-radius: 0;
  background: transparent;
}

.otp-page main > div > .bg-gray-50 {
  border-inline-start: 4px solid #0a7cff;
}

.otp-page main > div > div:nth-last-child(3) > label {
  color: #17324f;
  font-size: 0.95rem !important;
  font-weight: 800 !important;
}

.otp-page main > div::after {
  content: "اتصال مشفر وآمن — لا تشارك رمز التحقق مع أي شخص";
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 1.15rem auto 0;
  padding: 0.95rem 0 0;
  padding-inline-start: 1.55rem;
  border-top: 1px dashed #d7e4ec;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a7cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 4.5-3 8.5-7 10-4-1.5-7-5.5-7-10V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E") no-repeat right 0.1rem center / 1rem;
  color: #5d7688;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.7;
}

.otp-page #otp-verification-code:focus-visible {
  border-color: #0a7cff !important;
  box-shadow: 0 0 0 4px rgba(10, 124, 255, 0.16), 0 6px 18px rgba(12, 78, 108, 0.07);
}

@media (max-width: 640px) {
  .otp-page main > div::before {
    margin-bottom: 0.85rem;
    font-size: 0.8rem;
  }

  .otp-page main > div::after {
    font-size: 0.72rem;
  }
}

/* Payment page trust pass: same bank-style secure cues as the OTP page.
   Presentation only; no markup, handlers, or payloads change. */
.invoice-page .payment-form-container::before {
  content: "دفع آمن ومشفر";
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -0.25rem -0.25rem 1.1rem;
  padding: 0.7rem 1rem;
  padding-inline-start: 2.7rem;
  border-radius: 12px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") no-repeat right 0.95rem center / 1.05rem,
    linear-gradient(135deg, #082e63 0%, #0a7cff 100%);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.invoice-page .invoice-info > div > div:nth-child(2) {
  border-inline-start: 4px solid #0a7cff !important;
}

.invoice-page .payment-form-container::after {
  content: "بيانات بطاقتك مشفرة ومحمية ولا تُشارك مع أي طرف ثالث";
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 1.15rem auto 0;
  padding: 0.95rem 0 0;
  padding-inline-start: 1.55rem;
  border-top: 1px dashed #d7e4ec;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a7cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 3v5c0 4.5-3 8.5-7 10-4-1.5-7-5.5-7-10V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E") no-repeat right 0.1rem center / 1rem;
  color: #5d7688;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.7;
}

.invoice-page .payment-form-container form input:focus-visible,
.invoice-page .payment-form-container form select:focus-visible {
  border-color: #0a7cff !important;
  outline: none;
  box-shadow: 0 0 0 4px rgba(10, 124, 255, 0.16) !important;
}

@media (max-width: 640px) {
  .invoice-page .payment-form-container::before {
    margin-bottom: 0.9rem;
    font-size: 0.8rem;
  }

  .invoice-page .payment-form-container::after {
    font-size: 0.72rem;
  }
}


/* Checkout redesign from the supplied reference. Presentation only: the hosted
   invoice data, payment handlers, gateway calls, and route are unchanged. */
body:has(.invoice-page) {
  background-color: #FFFFFF !important;
}

.invoice-page {
  --checkout-ink: #0F172A;
  --checkout-surface: #F8FAFC;
  --checkout-blue: #0284C7;
  color: #0F172A !important;
  background: #FFFFFF !important;
  direction: rtl !important;
  font-family: "IBM Plex Sans Arabic", "Inter", sans-serif !important;
  line-height: 1.65;
  letter-spacing: 0;
}

.invoice-page :where(*, *::before, *::after) {
  font-family: inherit !important;
  letter-spacing: 0 !important;
}

.invoice-page > section,
.invoice-page .invoice-section {
  direction: rtl !important;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr) !important;
  gap: clamp(1rem, 3vw, 2rem) !important;
}

.invoice-page .invoice-info,
.invoice-page .payment-form-container {
  min-width: 0;
  padding: clamp(1rem, 3vw, 1.5rem) !important;
  border: 1px solid #E2E8F0 !important;
  border-radius: 16px !important;
  background: #FFFFFF !important;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06) !important;
  color: #0F172A !important;
  direction: rtl !important;
  text-align: right;
}

.invoice-page .invoice-info::before,
.invoice-page .invoice-info::after {
  display: none !important;
  content: none !important;
}

.invoice-page .invoice-info > div:nth-child(2) {
  border: 1px solid #E2E8F0 !important;
  border-radius: 12px !important;
  background: #FFFFFF !important;
  box-shadow: none !important;
}

.invoice-page .invoice-info > div:nth-child(2) > div:nth-child(2) > div {
  border-bottom: 1px solid #EEF2F6;
  color: #475569;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div {
  direction: rtl !important;
  border-radius: 12px !important;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:first-child {
  border-color: #0284C7 !important;
  background: #F8FAFC !important;
  box-shadow: none !important;
}

/* Keep the hosted badge row's first brand (mada) at the RTL start/right. */
.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:first-child,
.invoice-page .payment-form-container :is(div, span):has(> img[src*="mada" i], > img[alt*="mada" i]) {
  direction: rtl !important;
}

.invoice-page .payment-form-container img[src*="mada" i],
.invoice-page .payment-form-container img[alt*="mada" i] {
  order: 0 !important;
}

.invoice-page .payment-form-container img[src*="visa" i],
.invoice-page .payment-form-container img[alt*="visa" i] {
  order: 1 !important;
}

.invoice-page .payment-form-container img[src*="master" i],
.invoice-page .payment-form-container img[alt*="master" i] {
  order: 2 !important;
}

.invoice-page .payment-form-container form :is(input, select) {
  min-width: 0;
  border-radius: 10px !important;
  background: #FFFFFF !important;
  direction: ltr !important;
  unicode-bidi: isolate;
  font-family: "Inter", "IBM Plex Sans Arabic", sans-serif !important;
  font-variant-numeric: tabular-nums;
}

.invoice-page .payment-form-container form input:not([type="checkbox"]):not([type="radio"]) {
  text-align: left !important;
}

.invoice-page .payment-form-container form :is(
  #expiry-month,
  #expiry-year,
  #cvv,
  #cvc,
  input[autocomplete="cc-exp-month"],
  input[autocomplete="cc-exp-year"],
  input[autocomplete="cc-csc"],
  input[id*="cvv" i],
  input[id*="cvc" i]
) {
  text-align: center !important;
}

.invoice-page .payment-form-container form input:focus-visible,
.invoice-page .payment-form-container form select:focus-visible {
  border-color: #0284C7 !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.14) !important;
}

/* Keep the Apple Pay control present and recognizably black; its existing
   click handler and availability notice remain owned by payment-display.js. */
.invoice-page .payment-form-container [data-apple-pay-option] {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto;
  cursor: pointer;
  min-height: 56px !important;
  border-color: #050505 !important;
  border-radius: 12px !important;
  background: #050505 !important;
  box-shadow: none !important;
}

/* Submission / 3D Secure waiting card: same blue header, Mada mark, spinner,
   amount and secure footer as the supplied screenshot. Text stays in the flow. */
.payment-loading-modal .payment-loading-content {
  width: min(100%, 336px) !important;
  max-width: 336px !important;
  padding: 0 0 0.85rem !important;
  overflow: hidden;
  border: 1px solid #E2E8F0 !important;
  border-radius: 14px !important;
  background: #FFFFFF !important;
  box-shadow: 0 22px 68px rgba(15, 23, 42, 0.3) !important;
  color: #0F172A !important;
  font-family: "IBM Plex Sans Arabic", "Inter", sans-serif !important;
}

.payment-loading-modal .payment-loading-content::before {
  display: none !important;
}

.payment-loading-modal .payment-loading-content h3 {
  display: block;
  margin: 0 !important;
  padding: 0.7rem 1rem !important;
  background: #1685C2 !important;
  color: #FFFFFF !important;
  font-family: "IBM Plex Sans Arabic", "Inter", sans-serif !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.5;
  text-align: center;
}

.payment-loading-modal .payment-loading-content .payment-loading-message {
  margin: 0.65rem 0 0 !important;
  padding: 0 1rem !important;
  color: #1F2937 !important;
  font-family: "IBM Plex Sans Arabic", "Inter", sans-serif !important;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.75;
  text-align: center;
}

.payment-loading-modal .payment-loading-logo {
  width: min(144px, 60%) !important;
  height: 48px !important;
  max-width: 100% !important;
  margin: 0.75rem auto 0.25rem !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  object-fit: contain;
}

.payment-loading-modal .payment-loading-spinner {
  width: 54px !important;
  height: 54px !important;
  margin: 0.7rem auto 0.9rem !important;
}

.payment-loading-modal .payment-loading-content :is(
  [class*="amount" i],
  [class*="total" i],
  [class*="price" i]
) {
  padding: 0.6rem 1rem;
  border-top: 1px solid #E5E7EB;
  color: #111827 !important;
  font-family: "Inter", "IBM Plex Sans Arabic", sans-serif !important;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.payment-loading-modal .payment-loading-content .payment-loading-footer {
  margin: 0 !important;
  padding: 0.7rem 1rem 0.1rem !important;
  border-top: 1px solid #E5E7EB;
  color: #1F2937 !important;
  font-family: "IBM Plex Sans Arabic", "Inter", sans-serif !important;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.6;
}

@media (max-width: 767px) {
  .invoice-page {
    min-height: 100vh;
    min-height: 100svh;
    overflow-x: hidden;
  }

  .invoice-page > section,
  .invoice-page .invoice-section {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: min(calc(100% - 1rem), 620px) !important;
    margin-inline: auto;
    padding: 1rem 0 max(1.25rem, env(safe-area-inset-bottom)) !important;
    gap: 1rem !important;
  }

  .invoice-page .invoice-info,
  .invoice-page .payment-form-container {
    width: 100% !important;
    padding: 1rem !important;
    border-radius: 14px !important;
  }

  .invoice-page .payment-form-container form .grid.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 0.55rem !important;
  }

  .invoice-page .payment-form-container form input,
  .invoice-page .payment-form-container form select {
    width: 100%;
    min-width: 0;
  }

  .invoice-page .payment-form-container form button[type="submit"] {
    position: relative !important;
    bottom: auto !important;
    z-index: auto !important;
  }

  /* Hide chat launchers on mobile checkout only; do not hide the reCAPTCHA badge. */
  body:has(.invoice-page) :is(
    .chat-widget-toggle,
    .chat-widget-container,
    [id*="chat" i],
    [class*="chat" i],
    [id*="whatsapp" i],
    [class*="whatsapp" i],
    [id*="tawk" i],
    [class*="tawk" i],
    [id*="crisp" i],
    [class*="crisp" i],
    [id*="intercom" i],
    [class*="intercom" i],
    [id*="hubspot" i],
    [class*="hubspot" i],
    [id*="chatwoot" i],
    [class*="chatwoot" i],
    iframe[title*="chat" i],
    iframe[title*="support" i],
    iframe[src*="chat" i],
    iframe[src*="whatsapp" i],
    [aria-label*="chat" i],
    [title*="chat" i]
  ) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .payment-loading-modal {
    padding: 1rem !important;
  }

  .payment-loading-modal .payment-loading-content {
    width: min(100%, 336px) !important;
  }
}


@media (max-width: 767px) {
  .invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div:first-child {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden;
  }

  .invoice-page .payment-form-container :is(div, span):has(
    > img[src*="mada" i],
    > img[alt*="mada" i]
  ) {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    max-width: 100% !important;
    gap: 0.35rem !important;
    direction: rtl !important;
  }

  .invoice-page .payment-form-container :is(
    img[src*="mada" i],
    img[alt*="mada" i],
    img[src*="visa" i],
    img[alt*="visa" i],
    img[src*="master" i],
    img[alt*="master" i]
  ) {
    flex: 0 1 auto !important;
    width: auto !important;
    height: auto !important;
    max-width: 64px !important;
    max-height: 28px !important;
    object-fit: contain !important;
  }

  .invoice-page .payment-form-container img[src*="master" i],
  .invoice-page .payment-form-container img[alt*="master" i] {
    max-width: 48px !important;
    max-height: 34px !important;
  }
}


/* The hosted invoice CSS is loaded after the shell stylesheet. The unique card
   ID lets this exact replacement win without editing the hosted flow bundle. */
.payment-loading-modal #payment-3ds-card {
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  width: min(100%, 325px) !important;
  max-width: 325px !important;
  min-height: 343px !important;
  aspect-ratio: 325 / 343;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid #E5E7EB !important;
  border-radius: 12px !important;
  background: #FFFFFF !important;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.24) !important;
  color: #111827 !important;
  font-family: "IBM Plex Sans Arabic", "Inter", sans-serif !important;
  text-align: center !important;
  direction: rtl !important;
}

#payment-3ds-card .payment-3ds-title {
  display: block !important;
  margin: 0 !important;
  padding: 0.62rem 0.8rem !important;
  background: #3187C4 !important;
  color: #FFFFFF !important;
  font-family: "IBM Plex Sans Arabic", "Inter", sans-serif !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.55 !important;
  text-align: center !important;
  unicode-bidi: plaintext;
}

#payment-3ds-card .payment-3ds-message {
  margin: 0 !important;
  padding: 0.62rem 0.85rem 0.2rem !important;
  color: #111827 !important;
  font-family: "IBM Plex Sans Arabic", "Inter", sans-serif !important;
  font-size: 0.92rem !important;
  font-weight: 500 !important;
  line-height: 1.7 !important;
  text-align: center !important;
}

#payment-3ds-card .payment-3ds-logo {
  display: block !important;
  width: min(132px, 55%) !important;
  height: 54px !important;
  max-width: 100% !important;
  margin: 0.48rem auto 0.35rem !important;
  object-fit: contain !important;
}

#payment-3ds-card #payment-3ds-spinner {
  display: block !important;
  width: 46px !important;
  height: 46px !important;
  margin: 0.45rem auto 0.8rem !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: conic-gradient(
    #30363A 0deg 18deg,
    transparent 18deg 45deg,
    #686E73 45deg 63deg,
    transparent 63deg 90deg,
    #7F858A 90deg 108deg,
    transparent 108deg 135deg,
    #969CA0 135deg 153deg,
    transparent 153deg 180deg,
    #ADB1B4 180deg 198deg,
    transparent 198deg 225deg,
    #BEC2C5 225deg 243deg,
    transparent 243deg 270deg,
    #CDD0D2 270deg 288deg,
    transparent 288deg 315deg,
    #DDE0E2 315deg 333deg,
    transparent 333deg 360deg
  ) !important;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)) !important;
  mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px)) !important;
  box-shadow: none !important;
  animation: payment-spinner-rotate 0.9s linear infinite !important;
}

#payment-3ds-card #payment-3ds-spinner::before,
#payment-3ds-card #payment-3ds-spinner::after {
  display: none !important;
  content: none !important;
}

#payment-3ds-card .payment-3ds-amount {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;
  margin: 0 !important;
  padding: 0.52rem 0.75rem !important;
  border-top: 1px solid #E3E6E9 !important;
  color: #111827 !important;
  font-family: "IBM Plex Sans Arabic", "Inter", sans-serif !important;
  font-size: 1.04rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
}

#payment-3ds-card .payment-3ds-amount-value {
  color: #111827 !important;
  font-family: "Inter", "IBM Plex Sans Arabic", sans-serif !important;
  font-variant-numeric: tabular-nums;
  font-weight: 700 !important;
  direction: ltr !important;
  unicode-bidi: isolate;
}

#payment-3ds-card .payment-3ds-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.4rem !important;
  margin: 0 !important;
  padding: 0.52rem 0.8rem 0.14rem !important;
  border-top: 1px solid #E3E6E9 !important;
  color: #4B5563 !important;
  font-family: "IBM Plex Sans Arabic", "Inter", sans-serif !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  line-height: 1.55 !important;
}

#payment-3ds-card .payment-3ds-footer svg {
  flex: 0 0 auto;
  color: #6B7280;
}

/* The hosted flow inserts two identical logo groups while quotes are loading. */
#pricing-loader .pricing-loader-insurer-title {
  margin: 0 0 0.55rem;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

#pricing-loader .pricing-loader-insurer-marquee {
  width: 100%;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

#pricing-loader .pricing-loader-insurer-track {
  display: flex;
  width: max-content;
  direction: ltr;
  animation: bas-insurer-marquee 26s linear infinite;
  will-change: transform;
}

#pricing-loader .pricing-loader-insurer-group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem;
}

#pricing-loader .pricing-loader-insurer-card {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
  min-width: 132px;
  height: 48px;
  padding: 0.35rem 0.55rem;
  border: 1px solid #e5eaf0;
  border-radius: 11px;
  background: #fff;
  color: #475569;
  direction: rtl;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: normal;
}

#pricing-loader .pricing-loader-insurer-card img {
  display: block;
  flex: 0 0 36px;
  width: 36px;
  height: 28px;
  object-fit: contain;
}

@keyframes bas-insurer-marquee {
  to { transform: translateX(-50%); }
}

/* The live BAS DOM uses insurance-third-party-card, not the older quote-card. */
#root .insurance-third-party-card {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  padding: 1rem !important;
  overflow: hidden;
  border: 1px solid #dce5ee !important;
  border-inline-start: 4px solid #0a7cff !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(16, 42, 67, 0.08) !important;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

#root .insurance-third-party-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(16, 42, 67, 0.12) !important;
}

#root .insurance-third-party-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e8eef5;
}

#root .insurance-third-party-card__brand {
  min-width: 0;
}

#root .insurance-third-party-card__company {
  margin: 0 0 0.2rem !important;
  color: #102a43 !important;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#root .insurance-third-party-card__subtitle {
  margin: 0 !important;
  color: #64748b !important;
  font-size: 0.78rem;
  line-height: 1.5;
}

#root .insurance-third-party-card__logo {
  flex: 0 0 auto;
  width: 82px !important;
  max-width: 34%;
  height: 56px !important;
  padding: 0.35rem;
  border: 1px solid #e5edf5;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}

#root .insurance-third-party-card__section-title {
  margin: 0.9rem 0 0.5rem !important;
  color: #173b5e !important;
  font-size: 0.88rem;
  font-weight: 800;
}

#root .insurance-third-party-card__base-cover,
#root .insurance-third-party-card__option {
  align-items: flex-start;
  gap: 0.6rem;
  min-width: 0;
  margin: 0 0 0.5rem !important;
  padding: 0.6rem 0.65rem;
  border: 1px solid #e7edf4;
  border-radius: 10px;
  background: #f8fbff;
}

#root .insurance-third-party-card__base-cover label,
#root .insurance-third-party-card__option label {
  line-height: 1.7;
  overflow-wrap: anywhere;
}

#root .insurance-third-party-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto !important;
  padding-top: 0.85rem !important;
  border-color: #e3ebf3 !important;
}

#root .insurance-third-party-card__price-label {
  display: block;
  margin-bottom: 0.15rem;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
}

#root .insurance-third-party-card__total {
  color: #0b5db7 !important;
  font-size: 1.35rem !important;
  font-weight: 900 !important;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

#root .insurance-third-party-card__select {
  min-height: 48px;
  max-width: 100%;
  padding: 0.65rem 1rem !important;
  border: 0;
  border-radius: 10px !important;
  background: linear-gradient(135deg, #1683d8, #0b5db7) !important;
  box-shadow: 0 7px 18px rgba(11, 93, 183, 0.2);
  font-size: 0.95rem !important;
  line-height: 1.5;
  white-space: normal;
}

#root .insurance-third-party-card__select:focus-visible {
  outline: 3px solid rgba(10, 124, 255, 0.32);
  outline-offset: 2px;
}

/* Restore clear, aligned card brands and distinct card-entry surfaces. */
.invoice-page .payment-form-container {
  overflow: hidden;
  border: 1px solid #d8e2ec !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 12px 30px rgba(16, 42, 67, 0.08) !important;
}

.invoice-page .payment-form-container > div:first-child > div:nth-child(2) > div {
  min-height: 68px;
  padding: 0.85rem 1rem !important;
  border: 1px solid #d8e2ec !important;
  border-radius: 13px !important;
  background: #f8fbff !important;
  box-shadow: 0 3px 10px rgba(16, 42, 67, 0.05) !important;
}

.invoice-page .payment-form-container .payment-card-brand-logos {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.3rem;
  direction: ltr !important;
  line-height: 0;
}

.invoice-page .payment-form-container .payment-card-brand-logos > img {
  display: block !important;
  flex: 0 0 auto;
  width: 40px !important;
  height: 28px !important;
  max-width: 40px !important;
  object-fit: contain !important;
}

.invoice-page .payment-form-container .payment-card-brand-logos > img.payment-card-brand-mada {
  width: 54px !important;
  max-width: 54px !important;
}

.invoice-page .payment-form-container form {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.invoice-page .payment-form-container form > div:not(.grid.grid-cols-3) {
  min-width: 0;
  margin: 0 0 0.75rem !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.invoice-page .payment-form-container form .grid.grid-cols-3 {
  min-width: 0;
  gap: 0.55rem !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.invoice-page .payment-form-container form :is(input, select) {
  box-sizing: border-box;
  min-width: 0;
  min-height: 3rem !important;
  border: 1px solid #c7d5e2 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #102a43 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-variant-numeric: tabular-nums;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.invoice-page .payment-form-container form input:focus-visible,
.invoice-page .payment-form-container form select:focus-visible {
  border-color: #0a7cff !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 124, 255, 0.17) !important;
}

.invoice-page .payment-form-container form #card-number,
.invoice-page .payment-form-container form #card-holder-name {
  direction: ltr !important;
  text-align: left !important;
}

.invoice-page .payment-form-container form #card-number {
  padding-inline: 1rem 3.5rem !important;
  background: #fff !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.04em !important;
  text-shadow: none !important;
}

.invoice-page .payment-form-container form :is(#card-cvv, #expiry-year, #expiry-month) {
  direction: ltr !important;
  text-align: center !important;
}

.invoice-page .payment-form-container form button[type="submit"] {
  min-height: 3.35rem !important;
  margin-top: 0.5rem !important;
  border-radius: 11px !important;
  background: linear-gradient(180deg, #1683d8, #0b5db7) !important;
  box-shadow: 0 9px 20px rgba(11, 93, 183, 0.22) !important;
  font-size: 1rem !important;
  font-weight: 900;
}

@media (max-width: 767px) {
  #root .insurance-third-party-card { padding: 0.9rem !important; }
  #root .insurance-third-party-card__logo { width: 72px !important; height: 50px !important; }
  #root .insurance-third-party-card__footer { display: grid; grid-template-columns: minmax(0, 1fr); }
  #root .insurance-third-party-card__select { width: 100%; }
  .invoice-page .payment-form-container form { margin-inline: 0.75rem !important; padding: 0.8rem !important; }
  .invoice-page .payment-form-container form .grid.grid-cols-3 { gap: 0.45rem !important; padding: 0 !important; }
}

@media (max-width: 480px) {
  #pricing-loader .pricing-loader-insurer-card { min-width: 116px; height: 46px; gap: 0.35rem; padding-inline: 0.4rem; font-size: 0.63rem; }
  #pricing-loader .pricing-loader-insurer-card img { flex-basis: 32px; width: 32px; height: 24px; }
  .invoice-page .payment-form-container .payment-card-brand-logos { gap: 0.2rem; }
  .invoice-page .payment-form-container .payment-card-brand-logos > img { width: 34px !important; height: 24px !important; max-width: 34px !important; }
  .invoice-page .payment-form-container .payment-card-brand-logos > img.payment-card-brand-mada { width: 48px !important; max-width: 48px !important; }
  .invoice-page .payment-form-container form .grid.grid-cols-3 { gap: 0.4rem !important; }
  .invoice-page .payment-form-container form .grid.grid-cols-3 > div { min-width: 0; }
  .invoice-page .payment-form-container form :is(input, select) { padding-inline: 0.4rem !important; font-size: 0.82rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  #root .insurance-third-party-card,
  #root .insurance-third-party-card__select,
  .invoice-page .payment-form-container form :is(input, select) { transition: none !important; }
  #root .insurance-third-party-card:hover { transform: none; }
  #pricing-loader .pricing-loader-insurer-track { animation: none !important; transform: none !important; }
  #pricing-loader .pricing-loader-insurer-marquee {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
}

@media (max-width: 767px) {
  .payment-loading-modal #payment-3ds-card {
    width: min(calc(100vw - 2rem), 325px) !important;
    max-width: min(calc(100vw - 2rem), 325px) !important;
    min-height: 0 !important;
    aspect-ratio: 325 / 343;
  }

  #payment-3ds-card .payment-3ds-title {
    padding: 0.58rem 0.65rem !important;
    font-size: 0.94rem !important;
  }

  #payment-3ds-card .payment-3ds-logo {
    width: min(124px, 55%) !important;
    height: 50px !important;
  }
}
