/* Anthropic-inspired Checkout Styles */

.checkout-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.checkout-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Mobile: Show order summary in form column between plan and payment */
.checkout-summary-mobile {
  display: block;
  margin-bottom: 1.5rem;
}

/* Desktop order summary - hidden on mobile */
.checkout-summary-column {
  display: none; /* Hidden by default on mobile */
}

/* Desktop: Hide mobile order summary, show desktop version */
@media (min-width: 1024px) {
  .checkout-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 3rem;
    align-items: start;
  }
  
  .checkout-form-column {
    min-width: 0; /* Prevent grid overflow */
  }
  
  .checkout-summary-mobile {
    display: none; /* Hide mobile version on desktop */
  }
  
  .checkout-summary-column {
    display: block; /* Show desktop version on desktop */
    position: sticky;
    top: 2rem;
  }
}

/* Section Titles */
.checkout-section-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 1rem 0;
  padding: 0;
}

/* Plan Selection */
.checkout-plan-selection {
  margin-bottom: 1.5rem;
}

.plan-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.plan-option {
  display: flex;
  align-items: flex-start;
  padding: 1rem;
  border: 1.5px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #ffffff;
}

.plan-option:hover {
  border-color: #4a90e2;
  background: #f8f9fa;
}

.plan-option-selected {
  border-color: #4a90e2;
  background: #f0f7ff;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.plan-radio {
  margin: 0.25rem 0.75rem 0 0;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #4a90e2;
}

.plan-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.plan-name {
  font-weight: 600;
  font-size: 1rem;
  color: #1a1a1a;
}

.plan-price {
  font-weight: 600;
  font-size: 1rem;
  color: #1a1a1a;
  white-space: nowrap;
}

.plan-price .plan-period {
  font-weight: 400;
  font-size: 0.875rem;
  color: #666;
  margin-left: 0;
}

.plan-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.plan-badge-savings {
  background: #e8f5e9;
  color: #2e7d32;
}

.plan-badge-upgrade {
  background: #fff3e0;
  color: #e65100;
}

.plan-description {
  font-size: 0.875rem;
  color: #666;
}

.plan-features {
  margin-top: 0.5rem;
}

.plan-features-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.plan-features-list li {
  font-size: 0.875rem;
  color: #666;
  padding-left: 1.25rem;
  position: relative;
}

.plan-features-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #4a90e2;
  font-weight: 600;
}

/* Order Details Box */
.checkout-order-details-box {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}

.checkout-order-details-box .checkout-section-title {
  margin-top: 0;
  margin-bottom: 0.875rem;
  font-size: 1.125rem;
}

/* Legacy class name support */
.checkout-order-details {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}

.checkout-order-details .checkout-section-title {
  margin-top: 0;
  margin-bottom: 1rem;
}

.order-details-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.5rem;
}

.order-detail-item {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.order-detail-item:last-child {
  border-bottom: none;
}

.order-detail-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.9375rem;
}

.order-detail-label {
  color: #666;
  flex: 1;
}

.order-detail-value {
  color: #1a1a1a;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  margin-left: 1rem;
}

.order-detail-sub-item {
  margin-top: 0.25rem;
  padding-left: 0;
}

.order-detail-sub-text {
  font-size: 0.8125rem;
  color: #666;
  line-height: 1.4;
  display: block;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.order-detail-adjustment {
  color: #2e7d32;
}

.order-detail-adjustment .order-detail-value {
  color: #2e7d32;
}

.order-detail-subtotal {
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

.order-detail-total {
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 2px solid #1a1a1a;
  font-weight: 600;
}

.order-detail-total .order-detail-label {
  color: #1a1a1a;
  font-weight: 600;
}

.order-detail-total .order-detail-value {
  color: #1a1a1a;
  font-weight: 600;
  font-size: 1.125rem;
}

/* Payment Method Box */
.checkout-payment-box {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}

.checkout-payment-box .checkout-section-title {
  margin-top: 0;
  margin-bottom: 0.875rem;
  font-size: 1.125rem;
}

.checkout-payment-box #payment-element {
  margin-bottom: 0;
  padding: 0;
  border: none;
}

.checkout-promo-in-payment {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f0f0f0;
  margin-bottom: 0;
}

.checkout-promo-in-payment .checkout-promo-code {
  margin: 0;
}

.checkout-promo-in-payment .promo-code-toggle {
  margin: 0;
  padding: 0.625rem 0.75rem;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  background: #ffffff;
  font-size: 0.9375rem;
  color: #666;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.checkout-promo-in-payment .promo-code-toggle:hover {
  border-color: #4a90e2;
  color: #4a90e2;
}

/* Auto-renewal Info */
.auto-renewal-info {
  display: flex;
  gap: 0.75rem;
  padding: 0.875rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
  margin-bottom: 1.25rem;
}

.auto-renewal-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.auto-renewal-content {
  flex: 1;
}

.auto-renewal-text {
  margin: 0;
  font-size: 0.875rem;
  color: #666;
  line-height: 1.5;
}

.auto-renewal-text strong {
  color: #1a1a1a;
  font-weight: 600;
}

/* Account Information Box */
.checkout-account-box {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
}

.checkout-account-box .checkout-section-title {
  margin-top: 0;
  margin-bottom: 0.875rem;
  font-size: 1.125rem;
}

/* Form Section (legacy support) */
.checkout-section {
  margin-bottom: 1.5rem;
}

.form-fields {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

/* Horizontal layout for form fields on desktop */
.form-fields-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
}

@media (min-width: 768px) {
  .form-fields-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
  }
  
  .fieldwrapper-full {
    grid-column: 1 / -1;
  }
}

.fieldwrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fieldwrapper label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1a1a1a;
}

.checkout-input {
  padding: 0.625rem 0.75rem;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: border-color 0.2s ease;
  background-color: #ffffff;
  color: #1a1a1a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.checkout-input::placeholder {
  color: #aab7c4;
  opacity: 1;
}

.checkout-input:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.checkout-input:disabled {
  background-color: #f8f9fa;
  color: #6c757d;
  cursor: not-allowed;
}

/* Payment Element Container */
#payment-element {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  margin-bottom: 0;
}

.form-errors {
  font-size: 0.875rem;
  color: #d32f2f;
  margin-top: 0.5rem;
  min-height: 1.5rem;
}

/* Agreement Checkbox */
.checkout-agreement {
  margin: 1.25rem 0;
}

.agreement-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

.agreement-checkbox input[type="checkbox"] {
  margin-top: 0.25rem;
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: #4a90e2;
  flex-shrink: 0;
}

.agreement-text {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.5;
}

.agreement-text a {
  color: #4a90e2;
  text-decoration: underline;
}

.agreement-text a:hover {
  color: #357abd;
}

/* Submit Button */
.checkout-submit-btn {
  width: 100%;
  padding: 1rem;
  background: #4a90e2;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.checkout-submit-btn:hover:not(.disabled):not(:disabled) {
  background: #357abd;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.checkout-submit-btn:active:not(.disabled):not(:disabled) {
  transform: translateY(0);
}

.checkout-submit-btn.disabled,
.checkout-submit-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.checkout-submit-btn .sending-cont {
  display: none;
}

.checkout-submit-btn.btn-form-sending .active-cont {
  display: none;
}

.checkout-submit-btn.btn-form-sending .sending-cont {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Promo Code */
.checkout-promo-code {
  margin-bottom: 1.5rem;
}

.promo-code-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: transparent;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 0.9375rem;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
}

.promo-code-toggle:hover {
  border-color: #4a90e2;
  color: #4a90e2;
}

.promo-code-arrow {
  transition: transform 0.2s ease;
  font-size: 0.75rem;
  color: #999;
}

.promo-code-arrow-open {
  transform: rotate(180deg);
}

.promo-code-form {
  margin-top: 0.75rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e5e5e5;
}

.promo-code-input-group {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.promo-code-input {
  flex: 1;
  margin: 0;
}

.promo-code-apply-btn {
  padding: 0.75rem 1.5rem;
  background: #4a90e2;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.promo-code-apply-btn:hover:not(:disabled) {
  background: #357abd;
}

.promo-code-apply-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
  opacity: 0.6;
}

.promo-code-error {
  color: #d32f2f;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.promo-code-success {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #2e7d32;
  font-size: 0.875rem;
  font-weight: 500;
}

.promo-code-remove {
  background: transparent;
  border: none;
  color: #4a90e2;
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.promo-code-remove:hover {
  color: #357abd;
}

/* Mobile: Reduce vertical spacing and optimize layout */
@media (max-width: 767px) {
  .checkout-container {
    padding: 1rem 0.75rem;
  }
  
  .checkout-content {
    gap: 1.25rem;
  }
  
  .checkout-plan-selection {
    margin-bottom: 1rem;
  }
  
  .checkout-summary-mobile {
    margin-bottom: 1rem;
  }
  
  .checkout-account-box,
  .checkout-payment-box,
  .checkout-order-details-box {
    margin-bottom: 1rem;
    padding: 0.875rem;
  }
  
  .checkout-account-box .checkout-section-title,
  .checkout-payment-box .checkout-section-title,
  .checkout-order-details-box .checkout-section-title {
    margin-bottom: 0.75rem;
    font-size: 1rem;
  }
  
  .form-fields-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .fieldwrapper {
    gap: 0.375rem;
  }
  
  .checkout-input {
    padding: 0.625rem 0.75rem;
  }
  
  .checkout-agreement {
    margin: 1rem 0;
  }
  
  .auto-renewal-info {
    margin-bottom: 1rem;
    padding: 0.75rem;
  }
  
  .checkout-submit-btn {
    margin-top: 1rem;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  
  .plan-options {
    gap: 0.5rem;
  }
  
  .plan-option {
    padding: 0.75rem;
  }
  
  .plan-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
  }
  
  .plan-price {
    margin-top: 0;
  }
  
  .order-details-list {
    gap: 0.5rem;
    padding-top: 0.25rem;
  }
  
  .order-detail-item {
    padding: 0.375rem 0;
    font-size: 0.875rem;
  }
  
  .promo-code-input-group {
    flex-direction: column;
  }
  
  .promo-code-apply-btn {
    width: 100%;
  }
  
  .checkout-promo-in-payment {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
  }
  
  .checkout-promo-in-payment .promo-code-toggle {
    padding: 0.625rem 0.75rem;
  }
}

