/* Compact 3-step credit-check modal — phone-sized like Figma (~360px) */
.ccs-root {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.ccs-root[hidden] { display: none !important; }
.ccs-root.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ccs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.ccs-root.is-open .ccs-backdrop { opacity: 1; }
.ccs-modal {
  position: relative;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  padding: 14px 16px 16px;
  font-family: Vazirmatn, IRANSansX, IRANSans, Tahoma, sans-serif;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.5;
  -webkit-overflow-scrolling: touch;
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}
.ccs-root.is-open .ccs-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .ccs-root,
  .ccs-backdrop,
  .ccs-modal {
    transition: none !important;
  }
  .ccs-modal {
    transform: none;
  }
}

.ccs-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 28px;
  margin-bottom: 10px;
}
.ccs-close {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
}
.ccs-close:hover { color: #334155; background: #f1f5f9; }
.ccs-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  text-align: center;
  color: #0f172a;
  line-height: 1.4;
  padding: 0 28px;
}

.ccs-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  margin: 0 2px 12px;
}
.ccs-stepper__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: #94a3b8;
  z-index: 1;
}
.ccs-stepper__dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  color: #94a3b8;
}
.ccs-stepper__label {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.ccs-stepper__line {
  flex: 1;
  height: 1.5px;
  background: #e2e8f0;
  margin-top: 11px;
  min-width: 12px;
}
.ccs-stepper__item.is-active { color: #2563eb; }
.ccs-stepper__item.is-active .ccs-stepper__dot {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}
.ccs-stepper__item.is-done { color: #2563eb; }
.ccs-stepper__item.is-done .ccs-stepper__dot {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
  font-size: 0;
}
.ccs-stepper__item.is-done .ccs-stepper__dot::after {
  content: "✓";
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.ccs-stepper__item.is-done + .ccs-stepper__line { background: #2563eb; }

.ccs-panel[hidden] { display: none !important; }
.ccs-sub {
  margin: 0 0 10px;
  font-size: 0.78rem;
  color: #64748b;
  text-align: right;
  line-height: 1.65;
}

.ccs-fields { display: grid; gap: 8px; margin-bottom: 12px; }
.ccs-field-wrap { display: grid; gap: 4px; }
.ccs-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
  margin: 0;
}
.ccs-req { color: #ef4444; font-weight: 800; }
.ccs-field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  min-height: 40px;
  transition: border-color .15s, box-shadow .15s;
}
.ccs-field:focus-within {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.ccs-field__icon {
  color: #94a3b8;
  font-size: 0.9rem;
  order: 2;
  flex-shrink: 0;
}
.ccs-field input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 0.82rem;
  padding: 9px 0;
  color: #0f172a;
  order: 1;
  min-width: 0;
}
.ccs-field input::placeholder { color: #94a3b8; }

.ccs-section-label {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #334155;
}

.ccs-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px 10px;
  margin-bottom: 10px;
}
.ccs-check,
.ccs-terms {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.78rem;
  color: #334155;
  cursor: pointer;
  user-select: none;
  line-height: 1.45;
}
.ccs-check input,
.ccs-terms input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
.ccs-check__box {
  width: 15px;
  height: 15px;
  border: 1.5px solid #cbd5e1;
  border-radius: 3px;
  background: #fff;
  flex-shrink: 0;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, border-color .12s;
}
.ccs-check input:checked + .ccs-check__box,
.ccs-terms input:checked + .ccs-check__box {
  background: #2563eb;
  border-color: #2563eb;
}
.ccs-check input:checked + .ccs-check__box::after,
.ccs-terms input:checked + .ccs-check__box::after {
  content: "";
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translate(-0.5px, -0.5px);
}
.ccs-check input:focus-visible + .ccs-check__box,
.ccs-terms input:focus-visible + .ccs-check__box {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.ccs-terms {
  margin: 2px 0 12px;
  color: #475569;
  font-size: 0.76rem;
}
.ccs-terms a { color: #2563eb; text-decoration: none; font-weight: 600; }
.ccs-terms a:hover { text-decoration: underline; }

.ccs-btn {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-weight: 800;
  font-size: 0.86rem;
  padding: 11px 14px;
  cursor: pointer;
  transition: background .12s;
}
.ccs-btn:hover { background: #1d4ed8; }
.ccs-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.ccs-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 100%;
  margin-top: 8px;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px;
}
.ccs-back:hover { color: #2563eb; }
.ccs-error {
  margin: 0 0 8px;
  font-size: 0.76rem;
  color: #dc2626;
  text-align: center;
}
.ccs-error[hidden] { display: none !important; }

.ccs-otp-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 0.76rem;
  color: #1e40af;
}
.ccs-otp-banner i { color: #2563eb; font-size: 0.95rem; }
.ccs-otp {
  display: flex;
  justify-content: center;
  gap: 6px;
  direction: ltr;
  margin: 2px 0 8px;
}
.ccs-otp input {
  width: 38px;
  height: 40px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  background: #fff;
  color: #0f172a;
}
.ccs-otp input:focus {
  outline: 0;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.ccs-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
  cursor: pointer;
  padding: 2px;
}
.ccs-link:disabled { color: #94a3b8; cursor: default; }

.ccs-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.ccs-amount {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 8px 2px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
}
.ccs-amount.is-selected {
  border-color: #2563eb;
  color: #2563eb;
  background: #eff6ff;
}
.ccs-field--custom { margin-bottom: 12px; min-height: 40px; }

.ccs-summary {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 12px 0;
  margin-bottom: 12px;
  overflow: hidden;
}
.ccs-summary__head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  color: #1e40af;
  margin-bottom: 8px;
  font-size: 0.82rem;
}
.ccs-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  margin-bottom: 7px;
  color: #475569;
}
.ccs-summary__row strong { color: #334155; font-weight: 700; }
.ccs-summary__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 2px -12px 0;
  padding: 9px 12px;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
}
.ccs-summary__total strong {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
}
.ccs-benefits {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.ccs-benefits li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: #334155;
}
.ccs-benefits i { color: #16a34a; font-size: 0.88rem; }
.ccs-hint {
  margin: 0 0 10px;
  font-size: 0.7rem;
  color: #94a3b8;
  text-align: right;
  line-height: 1.55;
}

body.ccs-open { overflow: hidden; }

/* SweetAlert above the credit-check modal */
.swal2-container.cc-swal-container,
.swal2-container {
  z-index: 20000 !important;
}
.swal2-popup.cc-swal {
  direction: rtl;
  border-radius: 16px;
  padding: 1.2rem 1.1rem 1rem;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
  font-family: Vazirmatn, IRANSansX, IRANSans, Tahoma, sans-serif;
}
.swal2-popup.cc-swal .cc-swal__title {
  font-size: 1.02rem;
  font-weight: 800;
  color: #0f172a;
}
.swal2-popup.cc-swal .cc-swal__text {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.7;
}
.swal2-popup.cc-swal .cc-swal__confirm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  margin: 0.35rem 0.25rem 0;
  padding: 0.65rem 1.1rem;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.swal2-popup.cc-swal .cc-swal__confirm:hover { filter: brightness(1.05); }

@media (max-width: 400px) {
  .ccs-root { padding: 12px; align-items: center; justify-content: center; }
  .ccs-modal {
    width: 100%;
    max-width: 360px;
    max-height: 90vh;
    border-radius: 14px;
    padding: 12px 14px 14px;
  }
  .ccs-amounts { grid-template-columns: repeat(2, 1fr); }
  .ccs-amount { font-size: 0.78rem; padding: 9px 4px; }
  .ccs-otp input { width: 36px; height: 38px; }
}
