/* Base Styles - Stripe Design System */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Ubuntu', sans-serif;
  line-height: 1.6;
  color: #242d60;
  background: #f6f9fc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 20px;
}

.container {
  max-width: 600px;
  margin: 50px auto;
  background: #ffffff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.hidden {
  display: none;
}

/* Typography */
h1 {
  font-size: 28px;
  font-weight: 600;
  color: #242d60;
  margin-bottom: 20px;
  text-align: center;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  color: #242d60;
  margin-bottom: 15px;
  text-align: center;
}

p {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: #525f7f;
  margin-bottom: 10px;
}

/* Form intro text */
.intro-text {
  text-align: center;
  margin-bottom: 30px;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  background-color: #fefefe;
  padding: 12px 16px;
  margin-bottom: 30px;
}
.notice p {
  margin: 0;
  font-weight: bold;
}

/* Installment note in price breakdown */
.installment-note {
  color: #525f7f;
}

/* Disabled radio option */
.radio-group label.disabled {
  opacity: 0.5;
}

/* Images */
.site-logo {
  width: 100%;
  margin-bottom: 2em;
}

/* Form Styles */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #242d60;
  margin-bottom: 8px;
}

input:not([type="radio"]),
input[type="text"],
input[type="tel"],
input[type="email"],
select {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  background: #ffffff;
  color: #242d60;
  font-family: sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:not([type="radio"]):focus,
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
select:focus {
  outline: none;
  border-color: #635bff;
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}


/* Helper Text */
.helper-text {
  display: block;
  font-size: 13px;
  color: #525f7f;
  margin-top: 6px;
  line-height: 1.4;
}

.helper-text .loading-text {
  color: #635bff;
}

.helper-text .error-text {
  color: #dc3545;
}

.helper-text .loading-dot {
  display: inline-block;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-group label {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 400;
}

.radio-group label:hover {
  border-color: #635bff;
  background: #fafbfc;
}

.radio-group input[type="radio"] {
  margin-right: 12px;
  cursor: pointer;
}

button {
  width: 100%;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background: #635bff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

button:hover {
  background: #5146e5;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background: #cbd5e0;
  cursor: not-allowed;
  transform: none;
}

/* Checkout Page Specific */
#checkout {
  width: 100%;
  margin-top: 20px;
}

body.checkout-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 40px 20px;
}

body.checkout-page .container {
  max-width: 800px;
}

/* Loading State */
.loading-section {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  border: 4px solid #f3f4f6;
  border-top: 4px solid #635bff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Success State */
.success-section {
  text-align: center;
}

.success-icon {
  text-align: center;
  margin-bottom: 30px;
}

.success-icon svg {
  width: 80px;
  height: 80px;
  fill: #20a937;
}

h1.success-title {
  color: #20a937;
}

.message {
  text-align: center;
  margin-bottom: 30px;
  font-size: 16px;
  color: #525f7f;
}

.email-info {
  background: #f6f9fc;
  padding: 20px;
  border-radius: 6px;
  margin-bottom: 30px;
  text-align: center;
}

.email-info p {
  margin-bottom: 5px;
  color: #525f7f;
}

.email-info strong {
  color: #635bff;
  font-weight: 600;
}

.info-box {
  background: #e6f4ff;
  /* border-left: 4px solid #635bff; */
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 4px;
}

.info-box p {
  margin-bottom: 10px;
  color: #242d60;
}

.info-box p:last-child {
  margin-bottom: 0;
}

.info-box strong {
  color: #242d60;
  font-weight: 600;
}

.contact-info {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e3e8ee;
  color: #525f7f;
  font-size: 14px;
}

.contact-info p {
  margin-bottom: 5px;
}

.contact-info a {
  color: #635bff;
  text-decoration: none;
  font-weight: 500;
}

.contact-info a:hover {
  text-decoration: underline;
}

/* Price Breakdown Section */
.price-breakdown {
  background: #f6f9fc;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  color: #525f7f;
  font-size: 15px;
}

.breakdown-row:not(:last-child) {
  border-bottom: 1px solid #e3e8ee;
}

.breakdown-row.total-row {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 2px solid #242d60;
  font-size: 18px;
  color: #242d60;
}

.breakdown-row.total-row #total-amount {
  text-align: right;
}

.breakdown-row span {
  line-height: 1.4;
}

.breakdown-row small {
  display: block;
  font-size: 13px;
  margin-top: 4px;
}

#custom-amount-input {
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Choices.js Custom Styling */
.choices {
  margin-bottom: 0;
  font-size: 16px;
}

.choices__inner {
  padding: 12px 16px;
  border: 1px solid #cbd5e0;
  border-radius: 6px !important;
  background: #ffffff;
  min-height: 48px;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.choices__inner:focus,
.choices.is-focused .choices__inner {
  border-color: #635bff;
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}

.choices__input {
  background-color: transparent;
  font-size: 16px;
  color: #242d60;
  padding: 0;
  margin-bottom: 0;
}

.choices__placeholder {
  opacity: 0.5;
  color: #525f7f;
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
  background: #ffffff;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
  padding: 12px 16px;
  font-size: 16px;
  color: #242d60;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background-color: #f6f9fc;
  color: #635bff;
}

.choices__item--choice {
  transition: background-color 0.15s ease;
}

.choices[data-type*='select-one'] .choices__input {
  padding: 0;
  margin-bottom: 0;
}

.choices__list--single {
  padding: 0;
}

.choices__item--selectable {
  cursor: pointer;
}

/* No results and no choices text */
.choices__item--disabled {
  color: #525f7f;
  padding: 12px 16px;
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 640px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 24px;
    margin: 20px auto;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 18px;
  }

  button {
    padding: 12px 20px;
  }

  .breakdown-row {
    font-size: 14px;
  }

  .breakdown-row.total-row {
    font-size: 16px;
  }

  /* Choices.js mobile adjustments */
  .choices__list--dropdown,
  .choices__list[aria-expanded] {
    max-height: 300px;
    overflow-y: auto;
  }

  .choices__list--dropdown .choices__item,
  .choices__list[aria-expanded] .choices__item {
    padding: 14px 16px;
  }
}
