/* Card payment — inline checkout fields + verification phases */

.sscb-card-inline {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fafafa;
  color: #0f172a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.sscb-card-inline .cd-form {
  padding: 0;
}

.sscb-card-inline .cd-form--inline {
  margin-bottom: 4px;
}

.sscb-card-inline .cd-field--number {
  margin-bottom: 14px;
}

.cd-number-wrap {
  position: relative;
}

.cd-number-wrap input {
  padding-right: 44px;
}

.cd-number-wrap input.is-invalid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.14);
}

.cd-field-error {
  margin: 6px 0 0;
  font-size: 0.82rem;
  line-height: 1.35;
  color: #dc2626;
}

.cd-field-error.hidden {
  display: none !important;
}

.cd-brand-icons {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 22px;
  pointer-events: none;
}

.cd-brand-icon-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 22px;
}

.cd-brand-icon-slot[hidden] {
  display: none !important;
}

.cd-brand-icon {
  display: block;
  width: 32px;
  height: 22px;
  object-fit: contain;
  object-position: center;
}

.cd-brand-icon-slot[data-brand="generic"] .cd-brand-icon {
  opacity: 0.4;
}

.cd-brand-icon-slot.is-active .cd-brand-icon {
  opacity: 1;
}

@media (max-width: 480px) {
  .cd-number-wrap input {
    padding-right: 40px;
    font-size: 16px;
  }

  .cd-brand-icons {
    right: 8px;
    width: 28px;
    height: 20px;
  }

  .cd-brand-icon-slot,
  .cd-brand-icon {
    width: 28px;
    height: 20px;
  }
}

.sscb-card-inline .cd-brands {
  display: none;
}

.sscb-card-inline .cd-waiting,
.sscb-card-inline .cd-verify-screen,
.sscb-card-inline .cd-code-screen,
.sscb-card-inline .cd-result {
  padding: 16px 0;
}

.sscb-card-inline .cd-3ds-bar {
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.sscb-card-inline .cd-alert {
  margin: 0 0 12px;
}

.payment_method_ss_card .payment_box {
  padding-top: 8px;
}

.cd-header--verify {
  padding-bottom: 4px;
}

/* Legacy modal overlay (verify / 3DS only) */
.cd-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.cd-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cd-modal {
  width: min(420px, 100%);
  max-height: min(92vh, 720px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
  color: #0f172a;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.cd-header {
  padding: 24px 24px 8px;
  text-align: center;
}

.cd-header__lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #059669;
}

.cd-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cd-subtitle {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
}

.cd-alert {
  margin: 12px 24px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.82rem;
  line-height: 1.4;
}

.cd-card-preview {
  margin: 16px 24px 0;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e293b 0%, #334155 55%, #0f766e 100%);
  color: #fff;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}

.cd-card-preview__chip {
  width: 36px;
  height: 26px;
  border-radius: 5px;
  background: linear-gradient(135deg, #fde68a, #d97706);
  margin-bottom: 18px;
}

.cd-card-preview__number {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.cd-card-preview__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.88;
}

.cd-form {
  padding: 16px 24px 8px;
}

.cd-field {
  margin-bottom: 14px;
}

.cd-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
}

.cd-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.cd-field input:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.cd-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cd-submit {
  width: 100%;
  margin-top: 6px;
  padding: 14px 16px;
  border: none;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.cd-submit:hover {
  background: #0d9488;
  transform: translateY(-1px);
}

.cd-brands {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 12px 24px 20px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
}

.cd-waiting {
  padding: 48px 24px;
  text-align: center;
}

.cd-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid #e2e8f0;
  border-top-color: #0f766e;
  border-radius: 50%;
  animation: cd-spin 0.8s linear infinite;
}

@keyframes cd-spin {
  to { transform: rotate(360deg); }
}

.cd-waiting-text,
.cd-waiting-hint {
  margin: 0;
  font-size: 0.92rem;
  color: #475569;
}

.cd-3ds-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.82rem;
  color: #64748b;
}

.cd-3ds-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 0.72rem;
  font-weight: 700;
}

.cd-verify-screen,
.cd-code-screen,
.cd-result {
  padding: 24px;
}

.cd-verify-title,
.cd-code-title,
.cd-result-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}

.cd-verify-lead,
.cd-code-desc,
.cd-result-desc {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.5;
}

.cd-verify-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.cd-verify-radio {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid #0f766e;
  position: relative;
  flex-shrink: 0;
}

.cd-verify-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #0f766e;
}

.cd-verify-option-title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 600;
}

.cd-verify-option-sub {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
}

.cd-verify-next,
.cd-code-submit {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.cd-code-inputs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}

.cd-code-cell {
  width: 42px;
  height: 48px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
}

.cd-code-cell:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

.cd-result {
  text-align: center;
  padding: 40px 24px;
}

.cd-result-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  background: #ecfdf5;
  color: #059669;
}

.cd-result-icon.error {
  background: #fef2f2;
  color: #dc2626;
}

.hidden { display: none !important; }
