body {
  background: linear-gradient(135deg, #2a3e85, #1e2a5f);
  margin: 0 auto;
  width: 600px;
  font-family: "Inter", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: table;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.container {
  background-color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 32px;
  border-radius: 16px 16px 0 0;
  width: 100%;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column !important;
}

.container * {
  font-size: 16px;
  box-sizing: border-box;
}

.container .form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.container .form-row.top-row {
  margin-top: 20px;
}

.container .form-row .form-column {
  flex: 1;
  margin-right: 12px;
  display: flex;
  flex-direction: column;
}

.container .form-row .form-column:last-child {
  margin-right: 0;
}

.field-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-group label {
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  order: -1;
  margin-bottom: 4px;
}

.container .form-row .field {
  box-sizing: border-box;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  height: 56px;
  padding: 16px;
  width: 100%;
  transition: all 0.2s ease;
  background-color: #ffffff;
  font-size: 16px;
  color: #1a202c;
}

.field:focus,
.field:hover {
  border-color: #2a3e85;
  outline: none;
  box-shadow: 0 0 0 3px rgba(42, 62, 133, 0.1);
}

.field:focus + label,
.field:not(:placeholder-shown) + label {
  color: #2a3e85;
  transform: translateY(-2px);
}

.input-errors {
  font-size: 13px;
  color: #dc3545;
  margin-top: 4px;
  font-weight: 500;
  min-height: 20px;
}

.container .button-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  margin-top: 24px;
}

.container .button-container button {
  background: linear-gradient(135deg, #2a3e85, #1e2a5f);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  display: block;
  height: 52px;
  width: 140px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.container .button-container button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

#payment-request-button {
  width: 85%;
  height: 40px;
  margin: 0 auto;
}

@media (min-width: 300px) {
  body {
    width: auto;
  }
}

hr {
  margin: 30px 0;
  border: none;
  border-top: 1px solid #dee0e1;
}

.hr span {
  font-size: 10px;
  background-color: #fff;
  padding: 0 10px;
}

.clover-privacy-link {
  font-family: Roboto, "Open Sans", sans-serif;
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s ease-in-out infinite;
  margin: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.submit-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 62, 133, 0.25);
}

.submit-button:active:not(:disabled) {
  transform: translateY(0);
}

.container label {
  display: block;
  margin-bottom: 8px;
  color: #4a5568;
  font-size: 14px;
  font-weight: 500;
}

.cards-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cart-summary-card,
.payment-method-card {
  background-color: #f8fafc;
  border-radius: 14px;
  padding: 28px;
  border: 2px solid #e2e8f0;
  width: 100%;
}

.cart-summary-card h1,
.payment-method-card h1 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 28px;
  color: #1a202c;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.cart-summary-card h1::before {
  content: "🛒";
  display: block;
  font-size: 32px;
  margin-bottom: 16px;
}

.payment-method-card > h1:first-of-type::before {
  content: "💳";
  display: block;
  font-size: 32px;
  margin-bottom: 16px;
}

.clover-footer {
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.secure-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #64748b;
  font-size: 14px;
}

.secure-badge img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.form-row-columns {
  display: flex;
  gap: 12px;
  width: 100%;
}

.authorization-row,
.acceptance-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  margin: 20px 0;
  padding: 0;
}

.authorization-label,
.acceptance-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 20px;
  color: #4a5568;
  cursor: pointer;
  min-height: 24px;
}

.authorization-label input[type="checkbox"],
.acceptance-label input[type="checkbox"] {
  margin: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  transition: all 0.2s ease;
  flex-shrink: 0;
  vertical-align: middle;
  margin-top: -2px;
}

.authorization-label input[type="checkbox"]:checked,
.acceptance-label input[type="checkbox"]:checked {
  background-color: #2a3e85;
  border-color: #2a3e85;
}

.authorization-label input[type="checkbox"]:checked::after,
.acceptance-label input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  color: white;
  font-size: 14px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.authorization-label span,
.acceptance-label span {
  flex: 1;
  display: inline;
  vertical-align: middle;
  padding-top: 2px;
}

.authorization-label a,
.acceptance-label a {
  color: #2a3e85;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.authorization-label a:hover,
.acceptance-label a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  body {
    width: 100%;
    padding: 16px;
  }

  .container {
    padding: 24px;
  }

  .payment-method-card {
    padding: 20px;
  }

  .form-row-columns {
    flex-direction: column;
    gap: 16px;
  }

  .container .form-row .form-column {
    margin-right: 0;
  }

  .container .button-container button {
    width: 100%;
  }

  .authorization-label,
  .acceptance-label {
    max-width: 100%;
  }
}

/* Ensure the form takes priority in ordering */
#payment-form {
  order: 1;
}

.cart-columns {
  display: flex;
  gap: 24px;
  justify-content: space-between;
}

.cart-column {
  flex: 1;
  background-color: #f8fafc;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
}

.cart-column h2 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: #1a202c;
  font-weight: 600;
  text-align: center;
}

.cart-items {
  min-height: 100px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 16px;
}

.cart-total {
  padding-top: 16px;
}

.subtotal,
.tax-line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #64748b;
  font-size: 14px;
}

.with-tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted #64748b;
}

.tooltip {
  visibility: hidden;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1a202c;
  color: white;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  width: 240px;
  font-size: 12px;
  line-height: 1.4;
  z-index: 1;
  margin-bottom: 8px;
  white-space: normal;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #1a202c transparent transparent transparent;
}

.with-tooltip:hover .tooltip {
  visibility: visible;
}

.total {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  font-weight: 600;
  color: #1a202c;
}

.total + .total {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

.next-payment {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #e2e8f0;
  font-size: 14px;
  color: #64748b;
}

.cart-item {
  display: flex;
  flex-direction: column;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  width: 100%;
}

.cart-item-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.cart-item-name {
  font-weight: 500;
  color: #333;
  flex-grow: 1;
  padding-right: 20px;
}

.cart-item-price {
  font-weight: 500;
  color: #333;
  text-align: right;
  min-width: 80px;
}

/* Line items styles */
.line-items-container {
  width: 100%;
  margin-top: 4px;
}

.line-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.9em;
  color: #666;
  width: 100%;
}

.line-item-name {
  padding-left: 20px;
  flex-grow: 1;
  padding-right: 20px;
}

.line-item-price {
  color: #666;
  text-align: right;
  min-width: 80px;
}

@media (max-width: 768px) {
  .cards-container {
    gap: 16px;
  }

  .cart-summary-card,
  .payment-method-card {
    padding: 20px;
  }

  .cart-columns {
    flex-direction: column;
    gap: 16px;
  }

  .cart-column {
    width: 100%;
  }

  .form-row-columns {
    flex-direction: column;
    gap: 16px;
  }

  .field {
    height: 48px;
    padding: 12px;
  }
}

/* Donation specific styles */
.donation-summary-card {
  background-color: #f8fafc;
  border-radius: 14px;
  padding: 28px;
  border: 2px solid #e2e8f0;
  width: 100%;
}

.donation-summary-card h1 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 28px;
  color: #1a202c;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.donation-summary-card h1::before {
  content: "💝";
  display: block;
  font-size: 32px;
  margin-bottom: 16px;
}

/* Shipping Address heading styling */
.shipping-address-heading {
  text-align: center;
  margin-top: 0;
  margin-bottom: 28px;
  color: #1a202c;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.shipping-address-heading::before {
  content: "📦";
  display: block;
  font-size: 32px;
  margin-bottom: 16px;
}

.donation-amount-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.donation-button {
  background-color: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  font-size: 18px;
  font-weight: 600;
  color: #2a3e85;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 56px;
}

.donation-button:hover {
  border-color: #2a3e85;
  background-color: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(42, 62, 133, 0.15);
}

.donation-button.active {
  background-color: #2a3e85;
  border-color: #2a3e85;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(42, 62, 133, 0.25);
}

.donation-button:active {
  transform: translateY(0);
}

input[type="text"],
input[type="number"] {
  box-sizing: border-box;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  height: 56px;
  padding: 16px;
  width: 100%;
  transition: all 0.2s ease;
  background-color: #ffffff;
  font-size: 16px;
  color: #1a202c;
  font-family: "Inter", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

input[type="text"]:focus,
input[type="number"]:focus {
  border-color: #2a3e85;
  outline: none;
  box-shadow: 0 0 0 3px rgba(42, 62, 133, 0.1);
}

input[type="text"]:invalid:not(:focus):not(:placeholder-shown),
input[type="number"]:invalid:not(:focus):not(:placeholder-shown) {
  border-color: #dc3545;
}

.address-divider {
  margin: 24px 0;
  border: none;
  border-top: 2px solid #e2e8f0;
}

@media (max-width: 640px) {
  .donation-amount-buttons {
    grid-template-columns: 1fr;
  }
}