/* Subscription Form Frontend Styles */

/* iOS-Specific Fixes */
@supports (-webkit-touch-callout: none) {
  /* Prevent iOS zoom on input focus */
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px !important;
  }

  /* Smooth scroll behavior on iOS */
  body {
    -webkit-overflow-scrolling: touch;
  }

  /* Date field - Better touch targets for iOS */
  #first_delivery_date {
    min-height: 48px;
  }

  /* iOS Select/Dropdown - Native iOS Picker */
  select {
    position: relative;
    padding-right: 40px;
    cursor: pointer;
    min-height: 48px; /* Better touch target for iOS */
    -webkit-appearance: none;
    appearance: none;
    background-color: #fff;
  }

  /* Dropdown arrow using CSS border trick (guaranteed to work) */
  select {
    background-image: linear-gradient(45deg, transparent 50%, #6b7280 50%),
      linear-gradient(135deg, #6b7280 50%, transparent 50%);
    background-position: calc(100% - 20px) calc(50% - 2px),
      calc(100% - 15px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
  }

  /* Remove default arrow on iOS */
  select::-ms-expand {
    display: none;
  }

  /* Active/focus states for iOS */
  select:focus {
    background-color: #fff;
    border-color: #708a7c;
    box-shadow: 0 0 0 3px rgba(112, 138, 124, 0.1);
  }

  /* Improve tap targets for iOS */
  .product-card,
  button,
  label {
    -webkit-tap-highlight-color: rgba(112, 138, 124, 0.1);
  }

  /* Prevent iOS Safari from adding rounded corners to inputs */
  input,
  textarea,
  select,
  button {
    -webkit-border-radius: 0;
    border-radius: 6px; /* Use our custom radius */
  }

  /* Better input handling on iOS */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea {
    -webkit-appearance: none;
    appearance: none;
  }

  /* Fix iOS card element (Stripe) */
  #card-element {
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
  }

  /* Smooth transitions for iOS */
  * {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

.subscription-form-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 10px;
}

.subscription-form {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0f0f0;
}

/* ======================================
   2-COLUMN LAYOUT (Stripe-like)
   ====================================== */

/* Checkout Container - Flexbox 2-column layout */
.checkout-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Desktop: 2-column layout */
@media (min-width: 900px) {
  .checkout-container {
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
    padding: 32px;
  }

  /* LEFT COLUMN: Product + Pricing (40%) */
  .checkout-left {
    flex: 0 0 360px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
  }

  /* RIGHT COLUMN: Shipping + Payment (60%) */
  .checkout-right {
    flex: 1;
    min-width: 0;
  }
}

/* Mobile: Stacked layout */
@media (max-width: 899px) {
  .checkout-left,
  .checkout-right {
    width: 100%;
  }
}

.form-section {
  padding: 24px;
  border-bottom: 1px solid #f0f0f0;
}

.form-section:last-child {
  border-bottom: none;
}

/* Desktop: Adjust padding */
@media (min-width: 900px) {
  .checkout-left .form-section {
    padding: 16px 0;
    border: none;
  }

  .checkout-left .form-section:first-child {
    padding-top: 0;
  }

  .checkout-right .form-section {
    padding: 24px 10px;
    border: none;
    border-top: 1px solid #f0f0f0;
  }

  .checkout-right .form-section:first-child {
    border-top: none;
    padding-top: 0;
  }
}

.form-section h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  color: #1a1a1a;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Desktop: Compact headings in left column */
@media (min-width: 900px) {
  .checkout-left .form-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
  }
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #1a1a1a;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px; /* Prevent iOS zoom (minimum 16px) */
  transition: all 0.2s ease;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
  color: #1a1a1a;
  line-height: 1.5;
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
  border-color: #c4c4c4;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #708a7c;
  box-shadow: 0 0 0 3px rgba(112, 138, 124, 0.1);
  background: #fff;
}

/* Product Cards */
/* ========================================
   PRODUCT CARDS - Premium E-Commerce Style
   ======================================== */

.product-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-card {
  position: relative;
  cursor: pointer;
  display: block;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.product-card-content {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Custom Radio Button - Top Right */
.product-radio {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 24px;
  height: 24px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  background: #ffffff;
  transition: all 0.2s ease;
  z-index: 2;
}

.product-radio::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Hover Effect */
.product-card:hover .product-card-content {
  border-color: #708a7c;
  box-shadow: 0 4px 12px rgba(112, 138, 124, 0.1);
  transform: translateY(-1px);
}

.product-card:hover .product-radio {
  border-color: #708a7c;
}

/* Selected State */
.product-card input[type="radio"]:checked + .product-card-content {
  border-color: #708a7c;
  background: linear-gradient(to right, #f9fafb 0%, #ffffff 100%);
  box-shadow: 0 4px 16px rgba(112, 138, 124, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.product-card
  input[type="radio"]:checked
  + .product-card-content
  .product-radio {
  border-color: #708a7c;
  background: #708a7c;
  border-width: 2px;
}

.product-card
  input[type="radio"]:checked
  + .product-card-content
  .product-radio::after {
  transform: translate(-50%, -50%) scale(1);
}

/* Product Image Container */
.product-image {
  position: relative;
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  background: #f9fafb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

/* Product Details */
.product-details {
  flex: 1;
  padding-left: 20px;
  padding-right: 50px;
}

.product-name {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: -0.2px;
  line-height: 1.3;
}

.product-card
  input[type="radio"]:checked
  + .product-card-content
  .product-name {
  color: #708a7c;
}

.product-description {
  margin: 0 0 10px 0;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  font-weight: 400;
}

.product-price {
  font-size: 24px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.product-card
  input[type="radio"]:checked
  + .product-card-content
  .product-price {
  background: linear-gradient(135deg, #708a7c 0%, #5a7263 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .product-card-content {
    flex-direction: column;
    text-align: center;
    padding: 24px 20px;
  }

  .product-radio {
    top: 12px;
    right: 12px;
  }

  .product-image {
    width: 100%;
    height: 160px;
    margin-bottom: 16px;
  }

  .product-details {
    padding-left: 0;
    padding-right: 0;
  }

  .product-name {
    font-size: 17px;
  }

  .product-price {
    font-size: 22px;
  }
}

/* Form Divider */
.form-divider {
  position: relative;
  text-align: center;
  margin: 32px 0 28px 0;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent 0%,
    #e5e7eb 20%,
    #d1d5db 50%,
    #e5e7eb 80%,
    transparent 100%
  );
}

.divider-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Two column layout */
.form-row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Date Field with Icon (Native & Clean) */
.date-field-wrapper {
  position: relative;
  width: 100%;
}

.date-field-wrapper input {
  width: 100%;
  padding-right: 45px;
  cursor: pointer;
}

.date-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  pointer-events: none;
  user-select: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.date-field-wrapper:hover .date-icon {
  opacity: 1;
}

/* jQuery UI Datepicker - Clean Native Style */
.ui-datepicker {
  width: 280px !important;
  padding: 8px !important;
  border: 1px solid #708a7c !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  border-radius: 6px !important;
  font-size: 14px !important;
}

.ui-datepicker-header {
  background: #708a7c !important;
  border: none !important;
  color: white !important;
  padding: 8px !important;
  border-radius: 4px !important;
  margin-bottom: 8px !important;
  position: relative !important;
}

.ui-datepicker-title {
  color: white !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  line-height: 24px !important;
}

.ui-datepicker-prev,
.ui-datepicker-next {
  cursor: pointer !important;
  width: 24px !important;
  height: 24px !important;
  top: 8px !important;
}

.ui-datepicker-prev {
  left: 4px !important;
}

.ui-datepicker-next {
  right: 4px !important;
}

.ui-datepicker-prev:before {
  content: "‹" !important;
  color: white !important;
  font-size: 20px !important;
  font-weight: bold !important;
  display: block !important;
  text-align: center !important;
  line-height: 24px !important;
}

.ui-datepicker-next:before {
  content: "›" !important;
  color: white !important;
  font-size: 20px !important;
  font-weight: bold !important;
  display: block !important;
  text-align: center !important;
  line-height: 24px !important;
}

.ui-datepicker-prev span,
.ui-datepicker-next span {
  display: none !important;
}

.ui-datepicker table {
  width: 100% !important;
  font-size: 13px !important;
}

.ui-datepicker th {
  color: #666 !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  padding: 4px 2px !important;
}

.ui-datepicker td {
  padding: 1px !important;
}

.ui-state-default {
  text-align: center !important;
  padding: 6px !important;
  border-radius: 4px !important;
  border: 1px solid transparent !important;
  background: white !important;
  display: block !important;
}

.ui-state-hover {
  background: #f0f7f4 !important;
  border-color: #708a7c !important;
}

.ui-state-active {
  background: #708a7c !important;
  color: white !important;
  font-weight: 600 !important;
}

.ui-state-disabled {
  opacity: 0.3 !important;
  cursor: not-allowed !important;
}

/* Gift Toggle Switch - Inline Version */
.gift-toggle-wrapper-inline {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 0;
}

.gift-toggle-wrapper-inline > label:first-child {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.gift-toggle-vertical {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.toggle-label-left,
.toggle-label-right {
  font-size: 13px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 32px;
  text-align: center;
  transition: color 0.3s, font-weight 0.3s;
}

/* Highlight active label */
.toggle-label-left.active,
.toggle-label-right.active {
  color: #708a7c;
  font-weight: 700;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: all 0.3s ease;
  border-radius: 24px;
}

.slider:hover {
  background-color: #b8b8b8;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: all 0.3s ease;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input:checked + .slider {
  background-color: #708a7c;
}

input:checked + .slider:hover {
  background-color: #5f7769;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* Shipping Type Selector (Radio buttons) */
/* Billing Same as Shipping Checkbox (Stripe Style) */
.billing-same-checkbox {
  margin: 0 0 24px 0;
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #eef2f6 100%);
  border: 2px solid #708a7c;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(112, 138, 124, 0.1);
  transition: all 0.3s ease;
}

.billing-same-checkbox:hover {
  border-color: #5a7263;
  box-shadow: 0 4px 12px rgba(112, 138, 124, 0.15);
  transform: translateY(-1px);
}

.billing-same-checkbox label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
  padding: 0;
}

.billing-same-checkbox input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 0 14px 0 0;
  cursor: pointer;
  accent-color: #708a7c;
  flex-shrink: 0;
  transform: scale(1.1);
}

.billing-same-checkbox span {
  user-select: none;
  color: #2c3e50;
  letter-spacing: 0.3px;
}

/* Hidden fields for autocomplete (in DOM but not visible) */
.autocomplete-hidden-fields {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Billing Fields (Hidden by default) */
.billing-fields {
  margin-top: 20px;
  padding: 20px;
  border-top: 1px solid #e0e0e0;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fafbfc;
  display: none;
}

/* Desktop: Less prominent in 2-column */
@media (min-width: 900px) {
  .billing-fields {
    padding: 16px;
    background: #fff;
    border: 1px solid #e0e0e0;
  }
}

/* Pricing Summary */
.pricing-summary {
  background: #fafbfc;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 16px;
}

.pricing-summary h3 {
  color: #333;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

/* Desktop: Pricing summary in right column */
@media (min-width: 900px) {
  .checkout-right .pricing-summary {
    background: #f8faf9;
    padding: 16px;
  }
}

.pricing-details {
  background: white;
  padding: 14px 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e5e5;
}

.pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: none;
  font-size: 14px;
  color: #333;
}

.pricing-row span:last-child {
  font-weight: 600;
  font-size: 15px;
  color: #333;
}

.pricing-row.tax-row {
  padding: 6px 0;
  font-size: 13px;
  color: #666;
  font-style: italic;
}

.pricing-row.tax-row span:last-child {
  font-size: 13px;
  font-weight: 500;
  color: #666;
}

.pricing-row.total-row {
  padding: 10px 0;
  margin-top: 2px;
  border-top: 1px solid #e5e5e5;
  font-size: 15px;
}

.pricing-row.total-row span:last-child strong {
  font-size: 17px;
}

.pricing-row.recurring-row {
  padding: 10px 0;
  font-size: 15px;
}

.pricing-row.recurring-row span:last-child strong {
  font-size: 17px;
}

.pricing-row.grand-total-row {
  border-top: 2px solid #333;
  margin-top: 6px;
  padding-top: 12px;
  font-size: 16px;
}

.pricing-row.grand-total-row span:last-child strong {
  font-size: 20px;
  color: #333;
}

.pricing-divider {
  height: 1px;
  background: #e5e5e5;
  margin: 10px 0;
}

.payment-note {
  font-size: 11px;
  color: #666;
  font-weight: normal;
  font-style: italic;
}

/* Payment Section - Enhanced Styling */
.payment-section {
  background: linear-gradient(135deg, #f0f7f4 0%, #e8f3ed 100%);
  border: 1px solid #9ec5b0;
  position: relative;
  margin-top: -1px;
}

.payment-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #5f7769, #708a7c, #9ec5b0);
  border-radius: 8px 8px 0 0;
}

.payment-description {
  margin: -5px 0 18px 0;
  font-size: 14px;
  color: #5f7769;
  font-weight: 500;
}

.card-wrapper {
  position: relative;
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(112, 138, 124, 0.12);
  border: 1px solid #d4f1e0;
  transition: all 0.3s ease;
}

.card-wrapper:hover {
  box-shadow: 0 4px 12px rgba(112, 138, 124, 0.18);
  border-color: #9ec5b0;
}

/* Stripe Card Element - Enhanced Styling */
.stripe-card-element {
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: #fafbfc;
  min-height: 50px;
  transition: all 0.3s ease;
  font-size: 16px; /* Prevent iOS zoom */
  -webkit-tap-highlight-color: transparent;
}

.stripe-card-element:hover {
  background: white;
  border-color: #9ec5b0;
}

.stripe-card-element.StripeElement--focus {
  background: white;
  border-color: #708a7c;
  box-shadow: 0 0 0 4px rgba(112, 138, 124, 0.15);
}

.stripe-card-element.StripeElement--invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.card-icons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

.card-icon {
  font-size: 22px;
  opacity: 0.6;
}

.secure-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #5f7769;
  font-weight: 600;
  background: #e8f3ed;
  padding: 5px 12px;
  border-radius: 16px;
}

.card-errors {
  color: #dc3545;
  font-size: 14px;
  font-weight: 500;
  margin-top: 12px;
  min-height: 20px;
  display: block;
  padding: 8px 12px;
  background: #fff5f5;
  border-radius: 6px;
  border-left: 3px solid #dc3545;
}

.card-errors:empty {
  display: none;
}

.payment-section .payment-note {
  margin: 16px 0 0 0;
  font-size: 12px;
  color: #666;
  text-align: center;
  font-style: italic;
}

/* Form Actions */
.form-actions {
  padding: 25px;
  text-align: center;
}

.submit-button {
  background: linear-gradient(135deg, #708a7c 0%, #5f7769 100%);
  color: white;
  border: none;
  padding: 16px 42px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 220px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(112, 138, 124, 0.3);
  letter-spacing: 0.3px;
}

.submit-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #5f7769 0%, #4d6356 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(112, 138, 124, 0.4);
}

.submit-button:hover:not(:disabled) .button-text {
  color: #ffffff !important;
}

.submit-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(112, 138, 124, 0.3);
}

.submit-button:disabled {
  cursor: not-allowed;
  transform: none;
  opacity: 0.7;
}

/* Processing state with loading bar */
.submit-button.processing {
  background: #5f7769;
  pointer-events: none;
  cursor: wait;
}

.submit-button.processing::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, #9ec5b0, #d4f1e0, #9ec5b0);
  animation: loadingBar 2s ease-in-out infinite;
}

@keyframes loadingBar {
  0% {
    width: 0;
    left: 0;
  }
  50% {
    width: 100%;
    left: 0;
  }
  100% {
    width: 0;
    left: 100%;
  }
}

.button-text {
  display: inline-block;
}

.button-loader {
  display: none;
}

.submit-button.processing .button-text {
  display: none;
}

.submit-button.processing .button-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Spinner animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.submit-button.processing .button-loader::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Processing Overlay - Modern Glassmorphism */
.processing-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: fadeIn 0.3s ease;
}

.processing-overlay.show {
  display: flex;
}

.processing-content {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  padding: 40px;
  max-width: 480px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: scaleIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.processing-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(112, 138, 124, 0.2);
  border-top-color: #708a7c;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 24px;
}

.processing-text {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.processing-subtext {
  font-size: 14px;
  color: #64748b;
  margin: 0;
}

.processing-content.success {
  border-color: rgba(34, 197, 94, 0.3);
}

.processing-content.success .processing-spinner {
  display: none;
}

.processing-content.success::before {
  content: "✓";
  display: block;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-size: 32px;
  line-height: 60px;
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: successPulse 0.6s ease;
}

.processing-content.error {
  border-color: rgba(239, 68, 68, 0.3);
}

.processing-content.error .processing-spinner {
  display: none;
}

.processing-content.error::before {
  content: "✕";
  display: block;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: 32px;
  line-height: 60px;
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: errorShake 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes successPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes errorShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

/* Form Messages - Global form-level error/success messages */
.form-messages {
  margin-top: 16px;
  padding: 14px;
  border-radius: 6px;
  display: none;
  font-size: 14px;
}

.form-messages.show {
  display: block;
}

.form-messages.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-messages.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Field Validation Errors */
.field-error {
  display: none !important;
  color: #dc3545;
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
  padding: 6px 10px;
  background: #fff5f5;
  border-left: 3px solid #dc3545;
  border-radius: 3px;
  line-height: 1.4;
}

.field-error.show {
  display: block !important;
  animation: slideDown 0.3s ease;
  visibility: visible !important;
  opacity: 1 !important;
}

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

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: #dc3545 !important;
  background: #fff5f5 !important;
  border-width: 2px !important;
  transition: all 0.2s ease !important;
}

.form-group.has-error input:focus,
.form-group.has-error select:focus,
.form-group.has-error textarea:focus {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.25) !important;
  background: #fff !important;
}

.form-group.has-error label {
  color: #dc3545 !important;
  font-weight: 600 !important;
  transition: color 0.2s ease !important;
}

/* Error pulse animation for scroll-to-error */
@keyframes errorPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 20px 5px rgba(220, 53, 69, 0.3);
  }
}

/* Responsive - Tablet */
@media (max-width: 900px) {
  .subscription-form-wrapper {
    max-width: 100%;
    padding: 16px 8px;
  }

  .form-section {
    padding: 20px 16px;
  }

  .form-section h3 {
    font-size: 17px;
  }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .subscription-form-wrapper {
    padding: 12px 6px;
  }

  .form-section {
    padding: 18px 14px;
  }

  .form-section h3 {
    font-size: 16px;
    margin-bottom: 14px;
  }

  .form-row-two {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .form-group {
    margin-bottom: 14px;
  }

  .gift-toggle-wrapper-inline {
    margin-top: 0;
  }

  .submit-button {
    width: 100%;
    min-width: auto;
    padding: 14px 32px;
    font-size: 15px;
  }

  .pricing-details {
    padding: 14px;
  }

  .pricing-row {
    font-size: 14px;
    padding: 8px 0;
  }

  .pricing-row span:last-child {
    font-size: 15px;
  }

  .pricing-row.grand-total-row span:last-child strong {
    font-size: 20px;
  }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
  .form-section {
    padding: 16px 12px;
  }

  .form-group label {
    font-size: 13px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 14px;
    padding: 9px 10px;
  }

  .toggle-label-left,
  .toggle-label-right {
    font-size: 12px;
  }

  .card-wrapper {
    padding: 16px;
  }

  .stripe-card-element {
    padding: 14px;
    font-size: 15px;
  }

  .secure-badge {
    font-size: 11px;
    padding: 5px 10px;
  }

  .payment-description,
  .payment-section .payment-note {
    font-size: 12px;
  }
}

/* Print Styles */
@media print {
  .submit-button,
  .stripe-card-element {
    display: none;
  }

  .subscription-form {
    box-shadow: none;
  }
}
