/* ============================================
   MCA SIDEBAR FORM STYLING
   ============================================ */

/* ============================================
   HERO INTEGRATION STYLES
   ============================================ */

/* Two-Column Hero Layout */
.hero-with-slider {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
  min-height: 520px;
}

.hero-content-left {
  /* Content will naturally align */
}

.hero-slider-right {
  /* Slider positioning */
}

/* Inline Funding Slider for Hero */
.funding-slider-inline {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.funding-slider-inline:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 48px rgba(32, 54, 106, 0.2);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.funding-slider-inline:active {
  transform: scale(0.98);
}

/* For non-image heroes (product-hero) */
.product-hero .funding-slider-inline {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(32, 54, 106, 0.1);
  box-shadow: 0 8px 24px rgba(32, 54, 106, 0.12);
}

.product-hero .funding-slider-inline:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(32, 54, 106, 0.2);
  box-shadow: 0 12px 32px rgba(32, 54, 106, 0.18);
}

.funding-slider-inline-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  text-align: center;
}

.product-hero .funding-slider-inline-title {
  color: var(--brand, #20366a);
}

.funding-slider-inline-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 24px;
  text-align: center;
}

.product-hero .funding-slider-inline-subtitle {
  color: var(--muted, #555);
}

.funding-slider-display-inline {
  text-align: center;
  margin-bottom: 24px;
}

.funding-amount-inline {
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  display: block;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-hero .funding-amount-inline {
  color: var(--brand, #20366a);
  text-shadow: none;
}

.funding-slider-input-inline {
  margin-bottom: 20px;
}

.slider-inline {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  margin: 16px 0;
}

.product-hero .slider-inline {
  background: linear-gradient(90deg, #20366a 0%, #3873ff 100%);
}

.slider-inline::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #20366a;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s;
}

.slider-inline::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.slider-inline::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.slider-inline::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #20366a;
  cursor: grab;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s;
}

.slider-inline::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.slider-inline::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.slider-labels-inline {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.product-hero .slider-labels-inline {
  color: var(--muted, #555);
}

.funding-slider-hint {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.product-hero .funding-slider-hint {
  color: var(--muted, #555);
}

.funding-slider-hint i {
  font-size: 14px;
  animation: pulse 2s ease-in-out infinite;
}

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

/* Responsive Breakpoints */
@media (max-width: 991px) {
  .hero-with-slider {
    grid-template-columns: 1fr;
    gap: 32px;
    min-height: auto;
  }

  .funding-slider-inline {
    padding: 28px 24px;
  }

  .funding-slider-inline-title {
    font-size: 22px;
  }

  .funding-amount-inline {
    font-size: 36px;
  }
}

@media (max-width: 767px) {
  .funding-slider-inline {
    padding: 24px 20px;
  }

  .funding-slider-inline-title {
    font-size: 20px;
  }

  .funding-amount-inline {
    font-size: 32px;
  }

  .slider-inline::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }

  .slider-inline::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }
}

/* ============================================
   END HERO INTEGRATION STYLES
   ============================================ */

/* Funding Slider Section */
.funding-slider-section {
  background: linear-gradient(135deg, #e9f1ff 0%, #f5f9ff 60%, #ffffff 100%);
  padding: 60px 0;
  margin: 40px 0;
  border-radius: 20px;
}

.funding-slider-wrapper {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.funding-slider-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--brand, #20366a);
  margin: 0 0 12px;
}

.funding-slider-subtitle {
  font-size: 18px;
  color: var(--muted, #555);
  margin: 0 0 40px;
}

.funding-slider-container {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 8px 24px rgba(32, 54, 106, 0.1);
}

.funding-slider-display {
  margin-bottom: 30px;
}

.funding-amount {
  font-size: 48px;
  font-weight: 800;
  color: var(--brand, #20366a);
  display: block;
}

.funding-slider-input {
  margin-bottom: 30px;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #20366a 0%, #3873ff 100%);
  outline: none;
  margin: 20px 0;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #20366a;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(32, 54, 106, 0.3);
  transition: all 0.3s;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(32, 54, 106, 0.4);
}

.slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #20366a;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(32, 54, 106, 0.3);
  transition: all 0.3s;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(32, 54, 106, 0.4);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted, #555);
  font-weight: 600;
}

.funding-cta {
  margin-top: 10px;
}

/* Sidebar Overlay */
.mca-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mca-sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
  /* Visible at once on open (only the fade animates), so focus can move
     into the form straight away. */
  transition: opacity 0.3s ease, visibility 0s;
}

/* Sidebar Container */
.mca-sidebar {
  position: fixed;
  top: 0;
  right: -600px;
  width: 500px;
  height: 100%;
  background: #fff;
  z-index: 9999;
  overflow-y: auto;
  transition: right 0.3s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
}

.mca-sidebar-overlay.active .mca-sidebar {
  right: 0;
}

/* Close Button */
.mca-sidebar-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  font-size: 24px;
  color: var(--brand, #20366a);
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s;
}

.mca-sidebar-close:hover {
  color: #162849;
  transform: rotate(90deg);
}

/* Progress Bar */
.mca-progress {
  height: 4px;
  background: #e3e3e8;
  position: sticky;
  top: 0;
  z-index: 9;
}

.mca-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #20366a 0%, #3873ff 100%);
  width: 0%;
  transition: width 0.3s ease;
}

/* Form Container */
.mca-form-container {
  padding: 8px 40px 40px;
}

/* Form Steps */
.mca-step {
  display: none;
}

.mca-step.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mca-step-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--brand, #20366a);
  margin: 0 0 30px;
  line-height: 1.3;
}

/* Input Groups */
.mca-input-group {
  margin-bottom: 20px;
}

.mca-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #111);
  margin-bottom: 8px;
}

.mca-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid #e3e3e8;
  border-radius: 8px;
  transition: all 0.3s;
  font-family: inherit;
}

.mca-input:focus {
  outline: none;
  border-color: var(--brand, #20366a);
  box-shadow: 0 0 0 3px rgba(32, 54, 106, 0.1);
}

.mca-input.invalid {
  border-color: #ef4444;
}

.mca-input.valid {
  border-color: #22c55e;
}

/* Radio Groups */
.mca-radio-group {
  margin-bottom: 30px;
}

.mca-radio {
  margin-bottom: 12px;
}

.mca-radio input[type="radio"] {
  opacity: 0;
  position: absolute;
  width: 0;
}

.mca-radio label {
  display: block;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 500;
  border: 2px solid #e3e3e8;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.mca-radio label:hover {
  border-color: var(--brand, #20366a);
  background: #f7f9fc;
}

.mca-radio input[type="radio"]:checked + label {
  background: var(--brand, #20366a);
  border-color: var(--brand, #20366a);
  color: #fff;
}

/* Checkboxes */
.mca-checkbox-group {
  margin-bottom: 20px;
}

.mca-checkbox-label {
  display: flex;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted, #555);
  line-height: 1.5;
  cursor: pointer;
}

.mca-checkbox-label input[type="checkbox"] {
  margin-right: 10px;
  margin-top: 2px;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.mca-checkbox-label a {
  color: var(--brand, #20366a);
  text-decoration: underline;
}

/* Buttons */
.mca-btn {
  width: 100%;
  padding: 16px 24px;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mca-btn-next,
.mca-btn-submit {
  background: var(--brand, #20366a);
  color: #fff;
}

.mca-btn-next:hover,
.mca-btn-submit:hover {
  background: #162849;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(32, 54, 106, 0.25);
}

.mca-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Error & Success Messages */
.mca-error {
  margin-top: 15px;
  padding: 12px 16px;
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 8px;
  color: #c00;
  font-size: 14px;
  display: none;
}

.mca-error.show {
  display: block;
}

.mca-success {
  margin-top: 15px;
  padding: 12px 16px;
  background: #efe;
  border: 1px solid #cfc;
  border-radius: 8px;
  color: #060;
  font-size: 14px;
  display: none;
}

.mca-success.show {
  display: block;
}

/* Turnstile */
.mca-turnstile {
  margin: 20px 0;
}

/* Spinner */
.mca-spinner {
  text-align: center;
  padding: 60px 20px;
}

.spinner-circle {
  width: 60px;
  height: 60px;
  border: 4px solid #e3e3e8;
  border-top-color: var(--brand, #20366a);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.mca-spinner p {
  font-size: 16px;
  color: var(--muted, #555);
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* Disqualified Message */
.mca-disqualified {
  padding: 60px 20px;
  text-align: center;
}

.mca-disqualified p {
  font-size: 16px;
  color: #c00;
  line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
  .mca-sidebar {
    width: 100%;
    right: -100%;
  }

  .mca-form-container {
    padding: 8px 16px 32px;
  }

  .funding-slider-section {
    margin: 20px 0;
    padding: 40px 0;
  }

  .funding-slider-container {
    padding: 30px 20px;
  }

  .funding-amount {
    font-size: 36px;
  }

  .funding-slider-title {
    font-size: 24px;
  }

  .mca-step-title {
    font-size: 20px;
  }
}

/* ============================================
   STEP NAVIGATION, PROGRESS LABEL, AMOUNT SUMMARY
   ============================================ */

/* Back + "Question X of N". Right padding clears the close button. */
.mca-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 4px 64px 0 24px;
}

.mca-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  min-width: 48px;
  padding: 0 12px 0 4px;
  margin-left: -4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--brand, #20366a);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.mca-back[hidden] {
  display: none;
}

.mca-back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mca-back:hover {
  background: #f1f4fa;
}

.mca-progress-label {
  margin: 0 0 0 auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted, #555);
  white-space: nowrap;
}

.mca-step-title:focus {
  outline: none;
}

.mca-step-subtitle {
  margin: -18px 0 20px;
  font-size: 15px;
  color: var(--muted, #555);
}

/* "Amount: $50,000 · Change" on steps 4-6 when the amount was preset. */
.mca-amount-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0 0 0 14px;
  border-radius: 8px;
  background: #f1f4fa;
  font-size: 15px;
  color: var(--text, #111);
}

.mca-amount-summary[hidden] {
  display: none;
}

.mca-link-btn {
  min-height: 48px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: var(--brand, #20366a);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Contact step */
.mca-reassure {
  margin: -18px 0 20px;
  font-size: 14px;
  color: var(--muted, #555);
}

.mca-clickwrap {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted, #555);
  text-align: center;
}

.mca-clickwrap a {
  color: var(--brand, #20366a);
  text-decoration: underline;
}

/* A bigger, easier tick box for the optional SMS opt-in. */
.mca-checkbox-label input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin-top: 0;
}

/* Visible keyboard focus. The radios themselves are hidden, so their focus
   ring is drawn on the label. */
.mca-radio input[type="radio"]:focus-visible + label,
.mca-back:focus-visible,
.mca-link-btn:focus-visible,
.mca-sidebar-close:focus-visible,
.mca-btn:focus-visible,
.mca-checkbox-label input[type="checkbox"]:focus-visible,
.mca-clickwrap a:focus-visible,
.mca-checkbox-label a:focus-visible {
  outline: 3px solid #3873ff;
  outline-offset: 2px;
}

/* The chat widget's launcher and teaser sit at the top of the stacking order
   and land on the form's options and submit button on a phone. Hide the
   widget while the form is open; it comes back on close. */
body.mca-sidebar-open #cf-root {
  display: none !important;
}

/* The cookie bar sits above the sidebar at the bottom of the screen. Until
   it is dismissed, pad the form so the submit button and the terms line can
   still be scrolled clear of it (--cookie-notice-h: cookie-notice.js). */
.cookie-notice-open .mca-form-container {
  padding-bottom: calc(32px + var(--cookie-notice-h, 72px));
}

/* Never let long words (emails, links) push the sidebar wider than a phone. */
.mca-sidebar {
  overflow-x: hidden;
}

.mca-form-container,
.mca-checkbox-label span {
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .mca-topbar {
    padding-left: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mca-sidebar,
  .mca-sidebar-overlay,
  .mca-progress-bar,
  .mca-radio label,
  .mca-btn,
  .mca-sidebar-close {
    transition: none;
  }

  .mca-step.active {
    animation: none;
  }

  .mca-sidebar-close:hover,
  .mca-btn-next:hover,
  .mca-btn-submit:hover {
    transform: none;
  }
}
