:root {
  /* Color palette - CSS custom properties for maintainability */
  --rps-bg: #18232f;
  --rps-input-bg: #293847;
  --rps-input-text: #e0e7f0;
  --rps-label: #e0e7f0;
  --rps-border: #3c475d;
  --rps-primary: #3aa0ff;
  --rps-primary-hover: #2a8be6;
  --rps-progress: #3aa0ff;
  --rps-dp-day-size: 44px;
  --rps-dp-font-size: 0.95rem;
}

/* Performance: Use contain for layout optimization */
.rps-form {
  background: var(--rps-bg);
  border-radius: 5px;
  padding: 28px;
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  font-size: 1rem;
  color: var(--rps-input-text);
  contain: layout style;
}

.rps-progress {
  margin-bottom: 24px;
  position: relative;
}

.rps-progress__bar {
  height: 6px;
  background: rgba(124, 58, 237, 0.15);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.rps-progress__bar span {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 33%;
  background: var(--rps-progress);
  border-radius: inherit;
  transition: width 0.4s ease;
  will-change: width;
}

.rps-progress__steps {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-top: 12px;
  color: var(--rps-label);
}

.rps-progress__steps span.active {
  color: var(--rps-primary);
  font-weight: 600;
}

.rps-form__wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rps-step {
  display: none;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.rps-step.active {
  display: block;
}

.rps-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
  position: relative; /* allow absolutely-positioned required star */
}

.rps-field label {
  font-weight: 600;
  color: var(--rps-label);
  margin-bottom: 8px;
}

/* small red star shown for required fields */
.rps-required-star {
  color: #ff6b6b;
  margin-left: 6px;
  font-weight: 700;
}


/* when the star follows an input (placeholder-only UI), position it inside the input */
.rps-field input[required] + .rps-required-star,
.rps-field textarea[required] + .rps-required-star,
.rps-field select[required] + .rps-required-star {
  position: absolute;
  right: 12px;
  top: 12px;
  pointer-events: none;
  font-size: 1rem;
}

.rps-field input,
.rps-field textarea,
.rps-field select {
  border-radius: 5px;
  border: 1px solid var(--rps-border);
  padding: 12px 14px;
  font-size: 1rem;
  background: var(--rps-input-bg);
  color: var(--rps-input-text);
  transition: border 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  /* Security: Prevent layout breaking from long inputs */
  overflow: hidden;
  text-overflow: ellipsis;
}

.rps-field textarea {
  /* Security: Allow text wrapping in textarea */
  overflow: auto;
  text-overflow: clip;
  resize: vertical;
  min-height: 80px;
  max-height: 300px;
}

.rps-field input:focus,
.rps-field textarea:focus,
.rps-field select:focus {
  outline: none;
  border-color: var(--rps-primary);
  box-shadow: 0 0 0 4px rgba(58,160,255,0.12);
}

/* placeholder color */
.rps-field input::placeholder,
.rps-field textarea::placeholder {
  color: rgba(224,231,240,0.65);
}

.rps-field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--rps-input-text) 50%),
    linear-gradient(135deg, var(--rps-input-text) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% - 4px), calc(100% - 14px) calc(50% - 4px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
  cursor: pointer;
}

.rps-field--inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
}

/* Base consent field styling */
.rps-field--consent {
  margin-bottom: 1rem;
}

.rps-field--consent.rps-error {
  border-color: #dc3545;
}

/* Consent checkbox/label - more readable than other small notes */
.rps-consent {
  font-size: 0.95rem; /* increase consent text for readability */
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.rps-consent * {
  font-size: inherit;
}

/* Required star positioning inside consent */
.rps-consent .rps-required-star {
  display: inline-block !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  margin-left: 2px;
  vertical-align: baseline !important;
  color: #dc3545;
}

.rps-consent-text {
  flex: 1 !important;
  display: inline !important;
}

/* Checkbox styling */
.rps-consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: #3aa0ff;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .rps-consent input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }
}

/* Error and helper messages slightly smaller and readable */
.rps-consent-error {
  font-size: 0.8125rem;
  line-height: 1.2;
  color: #dc3545;
  margin-top: 0.25rem;
  display: block;
}

.rps-button {
  background: var(--rps-primary);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 12px 28px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
  /* Security: Prevent text selection for better UX */
  user-select: none;
  -webkit-user-select: none;
  /* Performance: Optimize hover transforms */
  will-change: transform;
}

.rps-button:hover {
  transform: translateY(-1px);
  background: var(--rps-primary-hover);
}

/* Security: Disabled state prevents interaction */
.rps-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

/* Gradient primary next button with microphone icon */
.rps-button--primary-gradient {
  background: linear-gradient(90deg,#1e88ff,#2aa0ff);
  box-shadow: 0 8px 24px rgba(42,138,230,0.24);
  border: 1px solid rgba(255,255,255,0.06);
}
.rps-button--primary-gradient:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}
.rps-button__icon {
  vertical-align: middle;
  margin-right: 8px;
  display: inline-block;
}

.rps-icon {
  display:inline-block;
  font-size:1rem;
  line-height:1;
  vertical-align:middle;
  margin-left:6px;
}

.rps-secure-note {
  color: rgba(224,231,240,0.9);
}

.rps-deposit-note small {
  color: rgba(224,231,240,0.95);
  font-size: 0.95rem;
}
.rps-deposit-warning small {
  color: rgba(224,231,240,0.78);
  font-size: 0.85rem;
}

.rps-button--ghost {
  background: transparent;
  color: var(--rps-input-text);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: none;
}

/* Payment method tabs (replace radio inputs) */
.rps-payment-tabs__list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap; /* allow wrap on small screens */
}
.rps-payment-tabs__list .rps-pay-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0; /* grow/shrink equally */
  min-width: 160px; /* reasonable minimum before wrapping */
}
.rps-payment-tab {
  background: transparent;
  color: var(--rps-input-text);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  flex: 1 1 0; /* grow/shrink equally like pay items */
  min-width: 160px;
}
.rps-payment-tab:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.rps-payment-tab--active {
  /* default active uses primary gradient to match primary buttons */
  background: linear-gradient(90deg,#1e88ff,#2aa0ff);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.06);
}
/* PayPal-specific active style to use PayPal gold + blue text */
.rps-payment-tab--active[data-method="paypal"], .rps-payment-tab--active[data-method='paypal'] {
  background: #f6c94a; /* PayPal-like gold */
  color: #003087; /* PayPal blue */
}

/* Helper text shown when payment methods are disabled */
.rps-payment-helper {
  color: rgba(224,231,240,0.75);
  font-size: 0.9rem;
}

/* Disabled tab appearance */
.rps-payment-tab[disabled], .rps-payment-tab[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  background: transparent;
  color: rgba(224,231,240,0.7);
  border: 1px solid rgba(255,255,255,0.03);
}

/* disabled button appearance */
.rps-button--disabled,
.rps-button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
  filter: grayscale(0.05);
}

/* Fixed footer primary button */
.rps-fixed-footer {
  position: static; /* not sticky any more */
  width: 100%;
  background: transparent;
  padding-top: 18px;
  display: flex;
  justify-content: center; /* center the button in the footer */
}
.rps-fixed-footer__inner {
  width: 100%;
  max-width: 880px;
  padding: 0 18px 0 18px;
  display: flex;
  justify-content: space-between; /* back left, primary right */
  align-items: center;
}

/* when only the primary button is present align it to the right */
.rps-fixed-footer__inner.rps-footer--single {
  justify-content: flex-end;
}

/* add space above footer so it doesn't hug the form */
.rps-fixed-footer {
  margin-top: 18px;
}
.rps-fixed-footer #rps-fixed-primary {
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
}

/* ensure back and primary align and have space */
#rps-fixed-back {
  margin-right: 12px;
  min-width: 120px;
}
#rps-fixed-primary {
  min-width: 200px;
}

/* hide in-step primary gradient buttons to avoid duplicate actions */
.rps-step__actions .rps-button--primary-gradient {
  display: none;
}

@media (max-width: 640px) {
  .rps-fixed-footer__inner {
    flex-direction: column;
    gap: 8px;
  }
  #rps-fixed-back, #rps-fixed-primary {
    width: 100%;
  }
}

/* inline helper message shown under fixed footer buttons */
.rps-fixed-help {
  margin-top: 20px;
  color: rgba(255, 5, 5, 0.78);
  font-size: 0.72rem; /* slightly smaller */
  text-align: center; /* centered under the primary button */
  display: block;
  line-height: 1;
  white-space: nowrap; /* keep on one line */
}

@media (max-width: 640px) {
  .rps-fixed-help {
    text-align: center; /* center on small screens under stacked buttons */
    padding-right: 0;
  }
}

.rps-summary {
  border-radius: 12px;
  border: 1px solid var(--rps-border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--rps-input-bg);
}

/* Custom file upload UI */
.rps-file-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rps-file-button-wrapper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rps-file-input {
  /* Visually hide native input but keep it focusable and accessible */
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  white-space: nowrap !important;
}

.rps-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(90deg,#1e88ff,#2aa0ff);
  color: #fff;
  padding: 12px 24px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  min-height: 48px;
  box-shadow: none;
  border: none;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  width: fit-content;
  text-transform: none;
  letter-spacing: 0.3px;
  /* Security: Prevent text selection */
  user-select: none;
  -webkit-user-select: none;
  /* Performance: Optimize transforms */
  will-change: transform;
  /* Performance: GPU acceleration */
  transform: translateZ(0);
}

.rps-file-button svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.rps-file-button:hover {
  transform: translateY(-2px);
  box-shadow: none;
  background: linear-gradient(90deg,#3a98ff,#3aaeff);
}

.rps-file-info {
  color: rgba(224,231,240,0.9);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rps-file-info__name {
  font-weight: 600;
}

.rps-file-info__note {
  color: rgba(224,231,240,0.65);
  font-size: 0.85rem;
}

.rps-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.rps-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.rps-file-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}

.rps-file-item__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  /* Security: Prevent content overflow */
  overflow: hidden;
}

.rps-file-item__name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(224,231,240,0.95);
  /* Security: Prevent extremely long filenames from breaking layout */
  max-width: 100%;
  word-break: break-all;
}

.rps-file-item__size {
  font-size: 0.8rem;
  color: rgba(224,231,240,0.6);
}

.rps-file-item__remove {
  background: rgba(220,38,38,0.15);
  color: #ff6b6b;
  border: 1px solid rgba(220,38,38,0.3);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 12px;
  transition: all 0.2s ease;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  /* Security: Prevent accidental clicks */
  user-select: none;
  -webkit-user-select: none;
  /* Performance: Optimize hover effect */
  will-change: transform;
}

.rps-file-item__remove:hover {
  background: rgba(220,38,38,0.25);
  border-color: rgba(220,38,38,0.5);
  transform: scale(1.1);
}

@media (max-width: 640px) {
  .rps-file-button {
    width: 100%;
  }
}

.rps-summary div {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
  color: var(--rps-input-text);
}

.rps-summary strong {
  color: var(--rps-input-text);
}

.rps-summary .rps-discount-row {
  color: #059669;
}
.rps-summary .rps-discount-row span,
.rps-summary .rps-discount-row strong {
  color: #059669;
}

.rps-card-errors {
  color: #dc2626;
  margin-top: 8px;
  min-height: 20px;
}

/* stripe card element container style */
.rps-card-element {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 5px;
  border: 1px solid var(--rps-border);
  background: var(--rps-input-bg);
  color: var(--rps-input-text);
}

/* headings and step labels should be visible */
.rps-step h3,
.rps-progress__steps,
.rps-progress__steps span {
  color: var(--rps-input-text);
}

.rps-summary strong {
  color: var(--rps-input-text);
}

.rps-step__actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.rps-confirmation {
  border: 1px solid rgba(5, 150, 105, 0.25);
  background: rgba(16, 185, 129, 0.1);
  border-radius: 10px;
  padding: 16px;
}

.rps-alert-host {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.rps-alert {
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--rps-input-text);
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  transition: opacity 0.3s ease;
}

.rps-alert--success {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
}

.rps-alert--error {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

.rps-alert.is-exiting {
  opacity: 0;
}

@media (max-width: 640px) {
  .rps-form {
    padding: 20px;
  }
  .rps-field--inline {
    grid-template-columns: 1fr;
  }
  .rps-step__actions {
    flex-direction: column;
  }
}

/* Apply Poppins consistently but allow element-level font-size overrides below */
.rps-form, .rps-form * {
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.4;
}
/* use border-box inside the form so padding doesn't cause overflow on small screens */
.rps-form, .rps-form * , .rps-form *::before, .rps-form *::after {
  box-sizing: border-box;
}

/* Base font-size for the form — most text will inherit this */
.rps-form {
  font-size: 1rem;
}

/* Make the summary panel slightly smaller to fit the layout */
.rps-summary,
.rps-summary * {
  font-size: 0.875rem;
  line-height: 1.3;
}
.rps-summary strong {
  font-size: 0.875rem;
  font-weight: 700;
}

/* Consent text and small notes should be smaller than the base */
.rps-secure-note,
.rps-deposit-note small,
.rps-deposit-warning small {
  /* set consistent small-note size; using rem keeps this relative to the form base */
  font-size: 0.70rem;
  line-height: 1.3;
}

/* Error and helper messages slightly smaller and readable */
.rps-card-errors {
  font-size: 0.8125rem;
  line-height: 1.2;
}

/* Keep very small UI bits (like small tags inside summary) readable but compact */
.rps-deposit-note small,
.rps-deposit-warning small {
  font-size: 0.8125rem;
}

/* Additional mobile tweaks to prevent overflow of buttons and helper text */
@media (max-width: 640px) {
  /* allow buttons to shrink on very small screens */
  #rps-fixed-back,
  #rps-fixed-primary {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .rps-button {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* helper text should wrap instead of forcing horizontal scroll */
  .rps-fixed-help {
    white-space: normal;
    padding-left: 12px;
    padding-right: 12px;
    word-break: break-word;
  }
}

/* PayPal button container tweaks so the PayPal smart button sits well with the form
   and matches the form width/radius. The SDK renders its own markup; these rules
   are intentionally conservative but help the button align visually. */
#rps-paypal-button-container {
  width: 100%;
  max-width: none;
}
#rps-paypal-button-container > * { width: 100% !important; }

/* Keep Google/Apple Pay button width consistent with tabs/PayPal */
#rps-payment-request-button { width: 100% !important; }

/* Divider under coupon */
.rps-divider {
  border: none;
  border-top: 1px solid rgba(224,231,240,0.18);
  margin: 12px 0 10px 0;
}

/* Loading Overlay - Optimized for performance and security */
.rps-loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(24, 35, 47, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-in;
  /* Security: Prevent interaction with underlying content */
  pointer-events: all;
  /* Performance: Use hardware acceleration */
  transform: translateZ(0);
  will-change: opacity;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.rps-loading-content {
  text-align: center;
  padding: 40px;
  background: rgba(41, 56, 71, 0.8);
  border-radius: 12px;
  border: 1px solid rgba(58, 160, 255, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  max-width: 400px;
}

/* Loader container to hold both spinner and checkmark */
.rps-loader-container {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
}

/* Performance: Optimize spinner animation with GPU acceleration */
.rps-spinner {
  width: 60px;
  height: 60px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 4px solid rgba(58, 160, 255, 0.2);
  border-top-color: #3aa0ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  will-change: transform;
  transition: opacity 0.3s ease;
}

@keyframes spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Success checkmark animation */
.rps-success-checkmark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.rps-success-checkmark.active {
  opacity: 1;
}

.rps-checkmark-svg {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: block;
  animation: scaleIn 0.3s ease-in-out forwards;
}

.rps-checkmark-circle {
  opacity: 0;
  animation: fadeIn 0.3s ease-in-out forwards;
}

.rps-checkmark-check {
  stroke-dasharray: 85;
  stroke-dashoffset: 85;
  animation: drawCheck 0.5s ease-in-out 0.2s forwards;
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes drawCheck {
  0% {
    stroke-dashoffset: 85;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.rps-loading-text {
  color: #e0e7f0;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  transition: color 0.3s ease;
}

.rps-loading-text.success {
  color: #4caf50;
}

.rps-loading-subtext {
  color: rgba(224, 231, 240, 0.7);
  font-size: 0.9rem;
  display: block;
  transition: color 0.3s ease;
}

.rps-loading-subtext.success {
  color: rgba(76, 175, 80, 0.8);
}

/* Receipt/Summary as Step 3 */
.rps-receipt-content {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease-in;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Receipt Header */
.rps-receipt-header {
  text-align: center;
  padding: 40px 30px 30px;
  background: transparent;
  border-bottom: 2px solid rgba(58, 160, 255, 0.2);
  border-radius: 0;
  overflow: visible;
  position: relative;
}

.rps-receipt-checkmark {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  width: 100px;
  height: 100px;
  animation: scaleIn 0.5s ease-out;
}

.rps-receipt-checkmark-svg {
  width: 100px;
  height: 100px;
  display: block;
}

.rps-receipt-checkmark-circle {
  animation: fadeIn 0.3s ease-in-out forwards;
}

.rps-receipt-checkmark-check {
  stroke-dasharray: 85;
  stroke-dashoffset: 85;
  animation: drawCheck 0.5s ease-in-out 0.3s forwards;
}

.rps-receipt-title {
  color: #4caf50;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 10px 0;
  letter-spacing: -0.5px;
}

.rps-receipt-subtitle {
  color: rgba(224, 231, 240, 0.8);
  font-size: 1rem;
  margin: 0;
  line-height: 1.5;
}

/* Receipt Body */
.rps-receipt-body {
  padding: 30px;
  background: transparent;
  overflow: hidden;
}

.rps-receipt-section-title {
  color: #3aa0ff;
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(58, 160, 255, 0.3);
}

.rps-receipt-section {
  margin-bottom: 15px;
}

.rps-receipt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(224, 231, 240, 0.1);
}

.rps-receipt-row:last-child {
  border-bottom: none;
}

.rps-receipt-label {
  color: rgba(224, 231, 240, 0.7);
  font-size: 0.95rem;
  font-weight: 500;
}

.rps-receipt-value {
  color: #e0e7f0;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: right;
}

.rps-receipt-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(58, 160, 255, 0.3) 50%, transparent 100%);
  margin: 20px 0;
}

/* Pricing Section with emphasis */
.rps-receipt-pricing .rps-receipt-row {
  padding: 10px 0;
}

.rps-receipt-total-row {
  margin-top: 10px;
  padding-top: 15px !important;
  border-top: 2px solid rgba(58, 160, 255, 0.3) !important;
  border-bottom: none !important;
}

.rps-receipt-total-label {
  color: #3aa0ff !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
}

.rps-receipt-total-value {
  color: #3aa0ff !important;
  font-size: 1.3rem !important;
  font-weight: 700 !important;
}

.rps-receipt-paid {
  color: #4caf50 !important;
  font-weight: 700 !important;
  font-size: 1.05rem !important;
}

.rps-receipt-discount-label {
  color: #4caf50 !important;
}

.rps-receipt-discount-value {
  color: #4caf50 !important;
}

/* Receipt Footer */
.rps-receipt-footer {
  padding: 40px 30px;
  background: transparent;
  border-top: 2px solid rgba(58, 160, 255, 0.2);
  border-radius: 0;
  text-align: center;
}

.rps-receipt-footer-text {
  color: rgba(224, 231, 240, 0.9);
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}

.rps-receipt-footer-text strong {
  color: #3aa0ff;
  font-weight: 600;
}

.rps-receipt-finish-btn {
  margin-top: 20px;
  padding: 14px 32px;
  background: linear-gradient(135deg, #3aa0ff 0%, #2d8ae0 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(58, 160, 255, 0.3);
}

.rps-receipt-finish-btn:hover {
  background: linear-gradient(135deg, #2d8ae0 0%, #1f6fc4 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(58, 160, 255, 0.4);
}

.rps-receipt-finish-btn:active {
  transform: translateY(0);
}

.rps-receipt-finish-btn svg {
  transition: transform 0.3s ease;
}

.rps-receipt-finish-btn:hover svg {
  transform: translateX(3px);
}

.rps-receipt-continue-btn {
  margin-top: 20px;
  padding: 14px 32px;
  background: linear-gradient(135deg, #3aa0ff 0%, #2d8ae0 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(58, 160, 255, 0.3);
}

.rps-receipt-continue-btn:hover {
  background: linear-gradient(135deg, #2d8ae0 0%, #1f6fc4 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(58, 160, 255, 0.4);
}

.rps-receipt-continue-btn:active {
  transform: translateY(0);
}

.rps-receipt-continue-btn svg {
  transition: transform 0.3s ease;
}

.rps-receipt-continue-btn:hover svg {
  transform: translateX(3px);
}

/* Responsive Design for Receipt */
@media (max-width: 640px) {
  .rps-receipt-page {
    padding: 20px 15px;
  }
  
  .rps-receipt-container {
    max-width: 100%;
  }
  
  .rps-receipt-header {
    padding: 60px 20px 30px;
  }
  
  .rps-receipt-title {
    font-size: 1.5rem;
  }
  
  .rps-receipt-subtitle {
    font-size: 0.9rem;
  }
  
  .rps-receipt-body {
    padding: 20px;
  }
  
  .rps-receipt-section-title {
    font-size: 1rem;
  }
  
  .rps-receipt-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 0;
  }
  
  .rps-receipt-value {
    text-align: left;
    margin-top: 5px;
    font-size: 1rem;
  }
  
  .rps-receipt-total-value {
    font-size: 1.2rem !important;
  }
  
  .rps-receipt-footer {
    padding: 30px 20px;
  }
}

/* Flatpickr theme overrides to match the form */
.flatpickr-calendar {
  background: #18232f; /* requested calendar background */
  border: 1px solid var(--rps-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45);
  font-family: inherit;
  color: #ffffff; /* day numbers default */
  font-size: 1rem;
}
.flatpickr-innerContainer,
.flatpickr-days,
.flatpickr-days .dayContainer {
  background: #18232f !important; /* ensure grid background is dark */
}
.flatpickr-months,
.flatpickr-weekdays {
  background: #1f8aff; /* header/banner */
  color: #ffffff;
}
.flatpickr-months .flatpickr-month,
.flatpickr-weekday { color: #ffffff !important; }
.flatpickr-current-month .numInputWrapper input,
.flatpickr-current-month .flatpickr-monthDropdown-months { color: #ffffff; }
.flatpickr-day {
  color: #ffffff !important; /* numbers white */
  border-radius: 6px;
  width: var(--rps-dp-day-size);
  height: var(--rps-dp-day-size);
  line-height: var(--rps-dp-day-size);
  font-size: var(--rps-dp-font-size);
}
.flatpickr-day:hover {
  background: rgba(58,160,255,0.15);
  border-color: var(--rps-primary);
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: #1f8aff; /* match banner */
  border-color: #1f8aff;
  color: #fff;
}
.flatpickr-day.today {
  border-color: #1f8aff;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.nextMonthDay,
.flatpickr-day.prevMonthDay {
  color: rgba(255,255,255,0.35) !important;
  background: transparent !important;
}

/* Optional: slightly larger cells on wider screens */
@media (min-width: 1024px) {
  :root {
    --rps-dp-day-size: 48px;
  }
}
.flatpickr-calendar .flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-calendar select.flatpickr-monthDropdown-months,
.flatpickr-calendar .numInputWrapper input {
  color: #ffffff;
}

/* Month dropdown background and text colors */
.flatpickr-calendar select.flatpickr-monthDropdown-months {
  background: #18232f !important;
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,0.15);
}
.flatpickr-calendar select.flatpickr-monthDropdown-months option {
  background: #18232f !important;
  color: #ffffff !important;
}
/* Year input next to month dropdown */
.flatpickr-calendar .numInputWrapper input {
  background: #18232f !important;
  color: #ffffff !important;
  border: 1px solid rgba(255,255,255,0.15);
}
