/* MoneyShop Calculator - IDENTICAL to apply.moneyshop.co.nz */
/* Scoped to override Hello Elementor / theme styles */

.apply-intro-calc {
  width: 100%;
  max-width: 100%;
}
.apply-intro-calc .calcform {
  max-width: 100%;
}

/* Theme overrides - ensure calculator styles win */
.apply-intro-calc .calcform,
.apply-intro-calc .calcform * {
  box-sizing: border-box;
}
/* Amount input - override theme (large size, black border) to match apply calcform */
.apply-intro-calc .calc-amount-input,
.apply-intro-calc input.calc-amount-input,
.apply-intro-calc .calcform-amount-row input {
  width: 5.5em !important;
  min-width: 5.5em !important;
  max-width: 5.5em !important;
  padding: 0.2em 0.4em !important;
  font-size: var(--mstext-s) !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;
  height: auto !important;
  min-height: 0 !important;
  background: rgba(3, 10, 140, 0.06) !important;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: textfield !important;
}
.apply-intro-calc .calc-amount-input:focus,
.apply-intro-calc input.calc-amount-input:focus,
.apply-intro-calc .calcform-amount-row input:focus {
  border-color: #006FFF !important;
  background: #fff !important;
  box-shadow: none !important;
  outline: none !important;
}
/* Reset theme input styles - Elementor/Hello often add borders and padding */
.apply-intro-calc .calcform input[type="number"],
.apply-intro-calc .calcform input[type="text"] {
  border: 1px solid transparent !important;
  box-shadow: none !important;
}
.apply-intro-calc .calcform-title {
  background: linear-gradient(135deg, #030A8C 0%, #006FFF 50%, #00AEEF 100%) !important;
  color: white !important;
}
.apply-intro-calc .calcform-body {
  background: #ffffff !important;
}

.collapse.in {
  display: block;
}

.calcform {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  font-family: "Raleway", -apple-system, BlinkMacSystemFont, sans-serif;
  font-variant-numeric: lining-nums;
  -ms-font-feature-settings: "lnum" 1;
  -ms-font-feature-settings: "lnum" 1;
  -webkit-font-feature-settings: "lnum" 1;
  font-feature-settings: "lnum" 1;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(3, 10, 140, 0.15), 0 0 0 1px rgba(3, 10, 140, 0.04);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.calcform:hover {
  box-shadow: 0 30px 60px -15px rgba(3, 10, 140, 0.2), 0 0 0 1px rgba(3, 10, 140, 0.06);
}

.calcform-title {
  position: relative;
  border-radius: 0;
  background: linear-gradient(135deg, #030A8C 0%, #006FFF 50%, #00AEEF 100%);
  color: white;
  font-size: var(--mstext-m);
  font-weight: 700;
  text-align: center;
  padding: 1.5rem 1.5rem;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.calcform-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  opacity: 0.5;
}

.investor-card-title {
  position: relative;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(135deg, #030A8C 0%, #006FFF 100%);
  color: white;
  font-size: var(--mstext-m);
  font-weight: 700;
  text-align: center;
  padding: 1.25rem;
}

.calcform-body {
  padding: 2rem 1.75rem;
  text-align: center;
  background: #ffffff;
  border-radius: 0 0 16px 16px;
}

.calcform-field {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  color: #030A8C;
  font-size: var(--mstext-s);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 0.25rem;
}

.calcform-amount-row {
  display: inline-flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 0.25em !important;
}

.calcform-amount-label {
  white-space: nowrap;
}

.calc-amount-input {
  display: inline-block !important;
  width: 5.5em !important;
  flex-shrink: 0 !important;
  padding: 0.2em 0.4em;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  font-family: inherit;
  background: rgba(3, 10, 140, 0.06);
  border: 1px solid transparent;
  border-radius: 6px;
  -moz-appearance: textfield;
}
.calc-amount-input::-webkit-outer-spin-button,
.calc-amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.calc-amount-input:focus {
  outline: none;
  border-color: #006FFF;
  background: #fff;
}
.calc-amount-input:hover {
  background: rgba(3, 10, 140, 0.08);
}

.calcform-slider {
  width: 100%;
  padding: 0.75rem 0;
}

.calcform-result {
  font-size: var(--mstext-l);
  font-weight: 700;
  color: #030A8C;
  padding: 1rem 0 !important;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.calcform-result.calculating-done .calc-result-amount {
  background: linear-gradient(135deg, #FC8429 0%, #FFBB33 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: var(--mstext-l);
  letter-spacing: -0.03em;
}

.calcform-slider-text-left,
.calcform-slider-text-right {
  width: 49%;
  display: inline-block;
  font-size: var(--mstext-2xs);
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.calcform-slider-text-left {
  text-align: left;
}
.calcform-slider-text-right {
  text-align: right;
}

.calcform-footer-text {
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--mstext-2xs);
  line-height: 1.5;
}

.calcform-footer-text-blue {
  text-align: center;
  color: #64748b;
  font-size: var(--mstext-2xs);
  line-height: 1.5;
}

.loan-details {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--mstext-xs);
  color: #030A8C;
  font-weight: 600;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1.2;
}
.loan-details:hover {
  background: rgba(3, 10, 140, 0.06);
  color: #006FFF;
}
.loan-details .ms-calc-chevron,
.loan-details .fa {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}
.loan-details .loan-details-label {
  display: inline-block;
  line-height: 1.2;
}
/* Right-facing ring chevron → points down when open */
.loan-details[aria-expanded="true"] .ms-calc-chevron {
  transform: rotate(90deg);
}

.calcform-btn-apply {
  width: 100% !important;
  max-width: 280px !important;
}

.w-70 {
  width: 58%;
  display: inline-block;
  padding-left: 5%;
  text-align: left;
  font-size: var(--mstext-xs);
  line-height: 1.5;
  font-weight: 400;
  color: #475569;
}

.w-30 {
  width: 36%;
  display: inline-block;
  text-align: right;
  font-size: var(--mstext-xs);
  font-weight: 600;
  line-height: 1.5;
  color: #030A8C;
}

#loan-details {
  margin-top: 1rem;
  padding: 1.25rem;
  background: rgba(3, 10, 140, 0.03);
  border-radius: 12px;
  border: 1px solid rgba(3, 10, 140, 0.08);
}
#loan-details .loan-detail-row {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(3, 10, 140, 0.08);
}
#loan-details .loan-detail-row:last-child {
  border-bottom: none;
}

.calcform input[type=range].styled-slider {
  width: 100%;
  height: 0.5rem;
  -webkit-appearance: none;
}

.calcform input[type=range].styled-slider.slider-progress {
  --range: calc(var(--max) - var(--min));
  --ratio: calc((var(--value) - var(--min)) / var(--range));
  --sx: calc(0.5 * 1.5em + var(--ratio) * (100% - 1.5em));
}

.calcform input[type=range].styled-slider:focus {
  outline: none;
}

.calcform input[type=range].styled-slider::-webkit-slider-thumb {
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background: linear-gradient(135deg, #030A8C 0%, #006FFF 100%);
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(3, 10, 140, 0.3);
  margin-top: calc(max((0.5rem - 1px - 1px) * 0.5, 0px) - 0.75em);
  -webkit-appearance: none;
  cursor: pointer;
  -webkit-transition: transform 0.15s ease, box-shadow 0.15s ease;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.calcform input[type=range].styled-slider::-webkit-slider-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(3, 10, 140, 0.4);
}
.calcform input[type=range].styled-slider::-webkit-slider-runnable-track {
  height: 0.5rem;
  background: #e2e8f0;
  border-radius: 9999px;
}
.calcform input[type=range].styled-slider.slider-progress::-webkit-slider-runnable-track {
  background: linear-gradient(#006FFF, #006FFF) 0/var(--sx) 100% no-repeat, #e2e8f0;
  border-radius: 9999px;
}

.calcform input[type=range].styled-slider::-moz-range-thumb {
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background: linear-gradient(135deg, #030A8C 0%, #006FFF 100%);
  border: 3px solid white;
  box-shadow: 0 2px 8px rgba(3, 10, 140, 0.3);
  cursor: pointer;
  -moz-transition: transform 0.15s ease;
  transition: transform 0.15s ease;
}
.calcform input[type=range].styled-slider::-moz-range-thumb:hover {
  transform: scale(1.08);
}
.calcform input[type=range].styled-slider::-moz-range-track {
  height: 0.5rem;
  background: #e2e8f0;
  border-radius: 9999px;
}
.calcform input[type=range].styled-slider.slider-progress::-moz-range-track {
  background: linear-gradient(#006FFF, #006FFF) 0/var(--sx) 100% no-repeat, #e2e8f0;
  border-radius: 9999px;
}

.calcform input[type=range].styled-slider::-ms-fill-upper,
.calcform input[type=range].styled-slider::-ms-fill-lower {
  background: transparent;
  border: none;
}
.calcform input[type=range].styled-slider::-ms-thumb {
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background: linear-gradient(135deg, #030A8C 0%, #006FFF 100%);
  border: 3px solid white;
  cursor: pointer;
}
.calcform input[type=range].styled-slider::-ms-track {
  height: 0.5rem;
  background: #e2e8f0;
  border: none;
}
.calcform input[type=range].styled-slider.slider-progress::-ms-fill-lower {
  height: 0.5rem;
  background: #006FFF;
  border-radius: 9999px 0 0 9999px;
}

.calcform-result.calculating {
  color: #94a3b8 !important;
  font-size: var(--mstext-xs) !important;
  font-weight: 500 !important;
}
.calcform-result.calculating::before {
  content: "";
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.5rem;
  border: 2px solid #e2e8f0;
  border-top-color: #006FFF;
  border-radius: 50%;
  animation: calc-spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes calc-spin {
  to {
    transform: rotate(360deg);
  }
}
.calcform-body {
  box-shadow: none;
}

@media (max-width: 992px) {
  .calcform-result {
    min-height: 3rem;
  }
  .min-my-5 {
    margin-top: 3rem;
    margin-bottom: 3rem;
  }
  .calculating-done div,
  .calculating div {
    line-height: 1.5;
  }
}
@media (max-width: 768px) {
  .calcform {
    max-width: 100%;
  }
  .calcform-body {
    padding: 1.5rem 1.25rem;
  }
  .calcform-title {
    padding: 1.25rem;
  }
  .w-70 {
    width: 55%;
  }
  .w-30 {
    width: 42%;
  }
}
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
  .calcform-body {
    border: 1px solid #e2e8f0;
  }
}

/* Apply button uses Bricks global class ms-btn-blue + brxe-button; layout only here */
.apply-intro-calc a.calcform-btn-apply.ms-btn-blue.brxe-button {
  display: inline-flex !important;
  width: 100% !important;
  max-width: 280px !important;
}
@media (max-width: 991px) {
  .apply-intro-calc a.calcform-btn-apply.ms-btn-blue.brxe-button {
    max-width: 100% !important;
  }
}

/* Spacing utilities */
.apply-intro-calc .mb-3,
.apply-intro-calc .my-3 {
  margin-bottom: 1rem !important;
}
.apply-intro-calc .pb-3,
.apply-intro-calc .py-3 {
  padding-bottom: 1rem !important;
}
.apply-intro-calc .pt-2,
.apply-intro-calc .py-2 {
  padding-top: 0.5rem !important;
}
