/*
   CHECKOUT PAGE — PREMIUM REDESIGN
   Dark-theme overrides for Fluent Cart checkout.
   Auto-loaded by functions.php via slug: /checkout → page-checkout.css

   Design system: #0A0D0F bg, #3B97A8 teal brand, #E8D5B7 cream accent
   Typography:    Plus Jakarta Sans (headings), DM Sans (labels/UI), Inter (body)
*/

/* ============================================================
   PAGE SHELL + AMBIENT GLOW
   ============================================================ */
body.page-slug-checkout {
  background: var(--bg-primary);
  min-height: 100vh;
}

body.page-slug-checkout::before {
  content: '';
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 400px;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(59, 151, 168, 0.07) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   CHECKOUT LAYOUT WRAPPER
   ============================================================ */
.fct-checkout {
  background: transparent;
  color: var(--text-primary);
  padding-top: 120px !important;
  padding-bottom: 80px !important;
  position: relative;
  z-index: 1;
}

/* Max-width + centre alignment */
.fct-checkout > .fct-checkout-inner,
.fct-checkout > .fct_checkout_wrapper,
.fct-checkout > form,
.fct-checkout > .fct_checkout_container {
  max-width: 1120px !important;
  margin: 0 auto !important;
  padding: 0 24px !important;
}

/* Two-column grid */
.fct_checkout_form_wrapper,
.fct-checkout-columns,
.fct_checkout_grid {
  display: grid !important;
  grid-template-columns: 1fr 400px !important;
  gap: 40px !important;
  align-items: start !important;
}

/* ============================================================
   PAGE HEADING (above the form)
   ============================================================ */
.fct_checkout_page_title,
.fct-checkout-title,
.fct-page-title {
  font-family: var(--font-heading) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: var(--color-brand) !important;
  margin-bottom: 32px !important;
  display: block !important;
}

/* ============================================================
   FORM SECTIONS (left panel)
   Each section gets card treatment with step-number accent
   ============================================================ */
.fct_checkout_form_section {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  padding: 28px !important;
  margin-bottom: 16px !important;
  position: relative !important;
  overflow: hidden !important;
  transition: border-color 0.2s ease !important;
}

.fct_checkout_form_section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-brand) 0%, transparent 100%);
  opacity: 0.6;
}

.fct_checkout_form_section:hover {
  border-color: var(--border-strong) !important;
}

.fct_form_section_header,
.fct_form_section_body {
  background: transparent !important;
  color: var(--text-primary) !important;
}

/* Section title with step number prefix */
.fct_form_section_title,
.fct_section_title,
.fct_checkout_section_title,
.fct_billing_heading,
h3.fct_form_section_title {
  font-family: var(--font-heading) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  margin-bottom: 20px !important;
  padding-bottom: 16px !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
}

/* ============================================================
   FIELD WRAPPERS — spacing between input rows
   Uses .fct_checkout ancestor prefix (confirmed working pattern).
   Each field row is .fct_checkout_input_group inside .fct_billing_fields.
   ============================================================ */
.fct_checkout .fct_billing_fields {
  display: grid !important;
  gap: 14px !important;
}

.fct_checkout .fct_checkout_input_group + .fct_checkout_input_group {
  margin-top: 14px !important;
}

/* Hard fallback: wrap every input/select with breathing room.
   Skips the last one to avoid double spacing before the section footer. */
.fct_checkout input[type=email],
.fct_checkout input[type=number],
.fct_checkout input[type=password],
.fct_checkout input[type=reset],
.fct_checkout input[type=search],
.fct_checkout input[type=tel],
.fct_checkout input[type=text],
.fct_checkout input[type=url],
.fct_checkout input,
.fct_checkout select,
.fct_checkout textarea {
  display: block !important;
  margin-bottom: 14px !important;
}

/* Remove bottom margin from the last input in each group
   so there's no double gap before the next section */
.fct_checkout .fct_checkout_input_group:last-child input,
.fct_checkout .fct_checkout_input_group:last-child select,
.fct_checkout .fct_checkout_input_group:last-child textarea {
  margin-bottom: 0 !important;
}

/* ============================================================
   INPUT FIELDS
   ============================================================ */
.fct-input,
.fct-input.fct-input-text,
.fct-input.fct-input-select,
input[type="text"].fct-input,
input[type="email"].fct-input,
input[type="tel"].fct-input {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(59, 151, 168, 0.15) !important;
  border-radius: var(--radius-md) !important;
  padding: 13px 16px !important;
  font-family: var(--font-body) !important;
  font-size: 15px !important;
  line-height: 1.5 !important;
  width: 100% !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease !important;
}


.fct-input::placeholder {
  color: var(--text-muted) !important;
  font-size: 14px !important;
}

.fct-input:focus,
.fct-input:focus-visible {
  border-color: var(--color-brand) !important;
  background: rgba(22, 32, 41, 0.9) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(59, 151, 168, 0.15), 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

.fct-input:hover:not(:focus) {
  border-color: rgba(59, 151, 168, 0.3) !important;
}

/* ============================================================
   LABELS
   ============================================================ */
.fct_input_label,
.fct-form-label,
label {
  font-family: var(--font-ui) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--text-muted) !important;
  margin-bottom: 6px !important;
  display: block !important;
}

/* ============================================================
   CUSTOM SELECT — nice-select + searchable select
   FC uses two dropdown components:
     .fct-nice-select        → standard select trigger
     .fct-custom-searchable-select → searchable country/district picker
   Dropdown option items use .select-option (not .fct-nice-select-option)
   Plugin hover bg driven by --fct-select-option-hover-bg (#f6f6f6 default)
   ============================================================ */

/* Override the CSS variable that drives hover bg */
.fct_checkout,
.fct-custom-searchable-select,
.select-dropdown,
.fct-nice-select-dropdown {
  --fct-select-option-hover-bg: rgba(59, 151, 168, 0.12) !important;
}

/* Trigger button */
.fct-nice-select {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(59, 151, 168, 0.15) !important;
  border-radius: var(--radius-md) !important;
  padding: 13px 40px 13px 16px !important;
  font-family: var(--font-body) !important;
  font-size: 15px !important;
  min-height: 48px !important;
  line-height: 1.5 !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}

.fct-nice-select:hover {
  border-color: rgba(59, 151, 168, 0.3) !important;
}

.fct-nice-select.open,
.fct-nice-select:focus {
  border-color: var(--color-brand) !important;
  box-shadow: 0 0 0 3px rgba(59, 151, 168, 0.15) !important;
}

.fct-nice-select::after {
  border-color: var(--text-muted) !important;
}

/* Dropdown containers */
.fct-nice-select-dropdown,
.select-dropdown,
.fct-custom-searchable-select .select-dropdown {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6) !important;
  margin-top: 4px !important;
}

/* Search input inside dropdown */
.fct-nice-select-search,
.fct-custom-searchable-select input[type=search],
.fct-custom-searchable-select input[type=text] {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  margin: 8px !important;
  padding: 10px 12px !important;
  font-family: var(--font-body) !important;
}

.fct-nice-select-search::placeholder,
.fct-custom-searchable-select input::placeholder {
  color: var(--text-muted) !important;
}

/* Dropdown option items — real class is .select-option */
.select-option,
li.fct-nice-select-option {
  background: transparent !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-body) !important;
  font-size: 14px !important;
  padding: 10px 16px !important;
  transition: background 0.12s ease, color 0.12s ease !important;
  cursor: pointer !important;
}

.select-option:hover,
li.fct-nice-select-option:hover {
  background: rgba(59, 151, 168, 0.12) !important;
  color: var(--text-primary) !important;
}

.select-option.selected,
.select-option[aria-selected="true"],
li.fct-nice-select-option.selected {
  background: rgba(59, 151, 168, 0.18) !important;
  color: var(--color-brand) !important;
  font-weight: 600 !important;
}

/* ============================================================
   PAYMENT SECTION
   ============================================================ */
.fct-payment-section,
.fct_payment_wrapper {
  background: transparent !important;
  border: none !important;
}

.fct_payment_method,
.fct-payment-method {
  background: var(--bg-card) !important;
  border: 1px solid rgba(59, 151, 168, 0.15) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  padding: 14px 16px !important;
  transition: border-color 0.18s ease !important;
}

.fct_payment_method:hover,
.fct-payment-method:hover {
  border-color: rgba(59, 151, 168, 0.35) !important;
}

/* "No payment method" message */
.fct_no_payment,
.fct-no-payment {
  font-family: var(--font-body) !important;
  font-size: 14px !important;
  color: var(--text-muted) !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-md) !important;
  padding: 16px !important;
}

/* ============================================================
   PLACE ORDER BUTTON — matches .btn-primary site-wide
   Real selector confirmed from plugin source: #fluent_cart_order_btn
   ============================================================ */
#fluent_cart_order_btn,
.fct-submit-btn,
button[name="fct_checkout_submit"],
.fct_checkout_submit,
input[type="submit"].fct-submit-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 15px 32px !important;
  background: var(--color-accent) !important;
  color: #0d1114 !important;
  font-family: var(--font-body) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  border: none !important;
  border-radius: var(--radius-pill) !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  width: 100% !important;
  margin-top: 8px !important;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast) !important;
}

#fluent_cart_order_btn:hover,
.fct-submit-btn:hover,
button[name="fct_checkout_submit"]:hover,
.fct_checkout_submit:hover {
  background: var(--color-accent-hover) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(232, 213, 183, 0.25) !important;
}

#fluent_cart_order_btn:active,
.fct-submit-btn:active,
button[name="fct_checkout_submit"]:active,
.fct_checkout_submit:active {
  transform: translateY(0) !important;
}

#fluent_cart_order_btn:disabled,
.fct-submit-btn:disabled,
button[name="fct_checkout_submit"]:disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* ============================================================
   TRUST BAR (below the button)
   Injected via ::after on the payment section wrapper
   ============================================================ */
.fct_checkout_form_section:last-child {
  position: relative;
}

/* ============================================================
   ERROR MESSAGES
   ============================================================ */
.fct_form_error,
.fct-error,
.fct-field-error {
  color: #f87171 !important;
  font-family: var(--font-ui) !important;
  font-size: 12px !important;
  margin-top: 5px !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}

.fct-notice-error,
.fct_checkout_error {
  background: rgba(248, 113, 113, 0.08) !important;
  border: 1px solid rgba(248, 113, 113, 0.25) !important;
  border-radius: var(--radius-md) !important;
  color: #f87171 !important;
  padding: 12px 16px !important;
  font-family: var(--font-body) !important;
  font-size: 14px !important;
  margin-bottom: 16px !important;
}

/* ============================================================
   ORDER SUMMARY PANEL (right column)
   ============================================================ */
.fct_checkout_summary,
.fct_summary,
.fct_summary_box {
  background: transparent !important;
  position: sticky !important;
  top: 120px !important;
}

/* Summary card wrapper */
.fct_checkout_summary .fct_checkout_form_section,
.fct_summary_inner,
.fct_order_summary_card {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-xl) !important;
  padding: 28px !important;
  overflow: hidden !important;
  position: relative !important;
}

/* Teal radial glow in top-right of summary card */
.fct_checkout_summary .fct_checkout_form_section::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(59, 151, 168, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

/* Remove the top border line from the summary card */
.fct_checkout_summary .fct_checkout_form_section::before {
  display: none !important;
}

/* Base text color for all summary content */
.fct_checkout_summary,
.fct_checkout_summary * {
  color: #D3C2A5 !important;
}

/* Summary heading */
.fct_summary_heading,
.fct_summary_title,
.fct_checkout_summary .fct_form_section_title {
  font-family: var(--font-heading) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: #D3C2A5 !important;
  margin-bottom: 20px !important;
  padding-bottom: 16px !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  display: block !important;
}

/* Summary toggle (mobile) */
.fct_summary_toggle,
.fct_summary_toggle_total {
  color: #D3C2A5 !important;
  font-family: var(--font-heading) !important;
  font-weight: 600 !important;
}

/* Product row */
.fct_summary_item,
.fct_order_item {
  display: flex !important;
  align-items: flex-start !important;
  gap: 14px !important;
  padding: 16px 0 !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  color: #D3C2A5 !important;
}

.fct_summary_item:last-of-type,
.fct_order_item:last-of-type {
  border-bottom: none !important;
}

/* Product image */
.fct_item_image {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.fct_item_image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  opacity: 0.6 !important;
  filter: invert(1) !important;
}

/* Product name + meta */
.fct_item_details,
.fct_summary_item_details {
  flex: 1 !important;
}

.fct_item_name,
.fct_summary_item_name {
  font-family: var(--font-body) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #D3C2A5 !important;
  line-height: 1.4 !important;
  margin-bottom: 3px !important;
}

.fct_item_description,
.fct_summary_item_desc,
.fct_recurring_info,
.fct_subscription_note {
  font-family: var(--font-ui) !important;
  font-size: 12px !important;
  color: var(--text-muted) !important;
  line-height: 1.5 !important;
}

/* Price */
.fct_summary_item_price,
.fct_item_price {
  font-family: var(--font-heading) !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  white-space: nowrap !important;
}

/* Subtotal + total rows */
.fct_summary_subtotal,
.fct_summary_total_row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 10px 0 !important;
  border-color: var(--border-subtle) !important;
  color: #D3C2A5 !important;
  font-family: var(--font-body) !important;
  font-size: 14px !important;
}

/* Total row */
.fct_total_row,
.fct_summary_total,
.fct_checkout_total {
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  padding: 16px 0 0 !important;
  border-top: 1px solid var(--border) !important;
  margin-top: 8px !important;
  color: #D3C2A5 !important;
  font-family: var(--font-heading) !important;
  font-weight: 700 !important;
  font-size: 18px !important;
}

.fct_total_row .fct_amount,
.fct_summary_total .fct_amount,
.fct_checkout_total .fct_amount {
  color: var(--color-accent) !important;
  font-size: 22px !important;
  font-weight: 700 !important;
  font-family: var(--font-heading) !important;
}

/* Recurring billing note */
.fct_billing_cycle,
.fct_plan_interval {
  font-family: var(--font-ui) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--color-brand) !important;
  margin-top: 6px !important;
  display: block !important;
}

/* ============================================================
   TRUST SIGNALS BLOCK (inside order summary)
   ============================================================ */
.fct_checkout_summary .fct_checkout_form_section {
  padding-bottom: 24px !important;
}

/* Injected trust block via pseudo after the summary card */
.fct_checkout_summary::after {
  content: 'Secure checkout  ·  Cancel anytime  ·  Priority support';
  display: block;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

/* ============================================================
   COUPON FIELD
   ============================================================ */
.fct_coupon_form,
.fct_coupon_wrapper {
  display: flex !important;
  gap: 8px !important;
  margin-top: 12px !important;
}

.fct_coupon_form input,
.fct_coupon_input {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid rgba(59, 151, 168, 0.15) !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 14px !important;
  font-family: var(--font-body) !important;
  font-size: 14px !important;
  flex: 1 !important;
  transition: border-color 0.18s ease !important;
}

.fct_coupon_form input:focus,
.fct_coupon_input:focus {
  border-color: var(--color-brand) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(59, 151, 168, 0.1) !important;
}

.fct_coupon_form input::placeholder,
.fct_coupon_input::placeholder {
  color: var(--text-muted) !important;
}

.fct_coupon_form button,
.fct_coupon_btn {
  background: transparent !important;
  color: var(--color-brand) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 10px 16px !important;
  font-family: var(--font-ui) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: background 0.15s ease, border-color 0.15s ease !important;
}

.fct_coupon_form button:hover,
.fct_coupon_btn:hover {
  background: rgba(59, 151, 168, 0.08) !important;
  border-color: var(--color-brand) !important;
}

/* "Have a coupon?" toggle link */
.fct_coupon_toggle,
.fct_have_coupon {
  font-family: var(--font-ui) !important;
  font-size: 13px !important;
  color: var(--color-brand) !important;
  cursor: pointer !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

/* ============================================================
   CHECKOUT LOADING OVERLAY
   ============================================================ */
.fct-checkout-modal,
.fct_checkout_overlay {
  background: rgba(10, 13, 15, 0.85) !important;
  backdrop-filter: blur(6px) !important;
}

.fct-checkout-modal .fct-modal-content,
.fct_checkout_overlay .fct_overlay_inner {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6) !important;
}

/* ============================================================
   ACCESSIBILITY + MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .fct-submit-btn,
  button[name="fct_checkout_submit"],
  .fct_checkout_submit,
  .fct-input,
  .fct-nice-select {
    transition: none !important;
  }
}

.fct-input:focus-visible,
.fct-nice-select:focus-visible,
.fct-submit-btn:focus-visible,
button[name="fct_checkout_submit"]:focus-visible {
  outline: 2px solid var(--color-brand) !important;
  outline-offset: 3px !important;
}

/* ============================================================
   RESPONSIVE — TABLET (below 900px: stack to single column)
   ============================================================ */
@media (max-width: 900px) {
  .fct_checkout_form_wrapper,
  .fct-checkout-columns,
  .fct_checkout_grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .fct_checkout_summary,
  .fct_summary,
  .fct_summary_box {
    position: static !important;
  }
}

/* ============================================================
   RESPONSIVE — MOBILE (below 600px)
   ============================================================ */
@media (max-width: 600px) {
  .fct-checkout {
    padding-top: 90px !important;
    padding-bottom: 48px !important;
  }

  .fct_checkout_form_section {
    padding: 20px !important;
  }

  .fct_checkout_summary .fct_checkout_form_section {
    padding: 20px !important;
  }

  .fct-submit-btn,
  button[name="fct_checkout_submit"],
  .fct_checkout_submit {
    padding: 16px 24px !important;
    font-size: 15px !important;
  }
}
