/* Broker360 FTB Calculator Styles */

.b360ftb {
  max-width: 900px;
  margin: 2em auto;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #222;
}

.b360ftb__card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 2em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.b360ftb h2 {
  margin-top: 0;
  margin-bottom: 0.5em;
  color: #004080;
  font-size: 1.8rem;
}

.b360ftb h3 {
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  color: #004080;
  font-size: 1.3rem;
}

.b360ftb__subtitle {
  color: #666;
  font-size: 1rem;
  margin-bottom: 2em;
}

.b360ftb__section {
  background: #f8f9fa;
  padding: 1.5em;
  margin-bottom: 1.5em;
  border-radius: 6px;
  border-left: 4px solid #0073aa;
}

.b360ftb__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
  margin-bottom: 1em;
}

.b360ftb__grid--3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.b360ftb__grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Checkbox labels should be inline */
.b360ftb__grid label:has(input[type="checkbox"]) {
  flex-direction: row;
  align-items: center;
  gap: 0.5em;
}

.b360ftb__grid input[type="checkbox"] {
  margin: 0;
  width: auto;
  order: -1; /* Place checkbox before text */
}

.b360ftb__grid input,
.b360ftb__grid select {
  padding: 0.6em;
  margin-top: 0.4em;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

.b360ftb__grid input:focus,
.b360ftb__grid select:focus {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.b360ftb__card--sub {
  border-top: 1px solid #eee;
  padding-top: 1em;
  margin-top: 1em;
}

.b360ftb__result {
  background: #f9f9f9;
  padding: 0.6em;
  margin-top: 0.6em;
  border-radius: 4px;
  font-size: 0.9rem;
}

.b360ftb__btn {
  display: inline-block;
  padding: 0.7em 1.5em;
  margin-top: 1em;
  background: #0073aa;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.b360ftb__btn:hover {
  background: #005f8d;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 115, 170, 0.3);
}

.b360ftb__btn--primary {
  background: #00a32a;
  font-size: 1.05rem;
}

.b360ftb__btn--primary:hover {
  background: #008a24;
}

.b360ftb__btn--large {
  padding: 1em 2em;
  font-size: 1.1rem;
  width: 100%;
}

.b360ftb__table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
  font-size: 0.9rem;
}

.b360ftb__table th, 
.b360ftb__table td {
  padding: 0.6em;
  border: 1px solid #ddd;
  text-align: left;
}

.b360ftb__table th {
  background: #f3f6f9;
}

.b360ftb__lender {
  display: flex;
  align-items: center;
  gap: 0.8em;
}

.b360ftb__lender-logo {
  width: 60px;
  height: 30px;
  object-fit: contain;
  object-position: left center;
}

.b360ftb__lender-name {
  font-weight: 500;
}

#b360-contact-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
  margin-top: 1em;
}

#b360-contact-form label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

#b360-contact-form input,
#b360-contact-form select {
  padding: 0.4em;
  margin-top: 0.3em;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* Progress Bar & Steps */
.b360ftb__progress {
  margin-bottom: 3em;
}

.b360ftb__progress-bar {
  background: #e0e0e0;
  height: 4px;
  border-radius: 2px;
  margin-bottom: 1.5em;
  position: relative;
  overflow: hidden;
}

.b360ftb__progress-fill {
  background: linear-gradient(90deg, #0073aa 0%, #00a32a 100%);
  height: 100%;
  width: 25%;
  transition: width 0.3s ease;
  border-radius: 2px;
}

.b360ftb__steps {
  display: flex;
  justify-content: space-between;
  gap: 1em;
}

.b360ftb__step {
  flex: 1;
  text-align: center;
  cursor: default;
}

.b360ftb__step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5em;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.b360ftb__step-label {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

.b360ftb__step--active .b360ftb__step-number {
  background: #0073aa;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(0, 115, 170, 0.15);
}

.b360ftb__step--active .b360ftb__step-label {
  color: #0073aa;
  font-weight: 600;
}

.b360ftb__step--completed .b360ftb__step-number {
  background: #00a32a;
  color: #fff;
}

.b360ftb__step--completed .b360ftb__step-number::after {
  content: '✓';
}

/* Step Content */
.b360ftb__step-content {
  display: none;
}

.b360ftb__step-content--active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Step Navigation */
.b360ftb__step-nav {
  display: flex;
  gap: 1em;
  margin-top: 2em;
  justify-content: space-between;
}

.b360ftb__btn--prev {
  background: #666;
}

.b360ftb__btn--prev:hover {
  background: #555;
}

.b360ftb__btn--next {
  margin-left: auto;
}

/* Utility Classes */
.b360ftb__hidden {
  display: none !important;
}

/* Info & Status Messages */
.b360ftb__info {
  background: #e7f5fe;
  border-left: 3px solid #0073aa;
  padding: 0.8em 1em;
  margin-top: 0.8em;
  border-radius: 4px;
  font-size: 0.9rem;
}

.b360ftb__status {
  margin-top: 1em;
  padding: 0.8em;
  border-radius: 4px;
  font-size: 0.95rem;
}

.b360ftb__status.success {
  background: #e6f7e6;
  border: 1px solid #00a32a;
  color: #006618;
}

.b360ftb__status.error {
  background: #ffe6e6;
  border: 1px solid #d63638;
  color: #d63638;
}

.b360ftb__muted {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1em;
}

.b360ftb__hint {
  display: block;
  font-size: 0.8rem;
  color: #666;
  font-weight: normal;
  margin-top: 0.2em;
}

.b360ftb__disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.b360ftb__disabled input[type="checkbox"] {
  cursor: not-allowed;
}

/* Results Section */
.b360ftb__results-hero {
  background: linear-gradient(135deg, #0073aa 0%, #005f8d 100%);
  color: #fff;
  padding: 2em;
  border-radius: 8px;
  margin-bottom: 2em;
  text-align: center;
}

.b360ftb__result-main {
  max-width: 500px;
  margin: 0 auto;
}

.b360ftb__result-label {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5em;
  opacity: 0.95;
}

.b360ftb__result-amount {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.b360ftb__breakdown {
  font-size: 0.95rem;
  line-height: 1.8;
}

.b360ftb__breakdown div {
  display: flex;
  justify-content: space-between;
  padding: 0.5em 0;
  border-bottom: 1px solid #eee;
}

.b360ftb__breakdown div:last-child {
  border-bottom: none;
  font-weight: 600;
  font-size: 1.05rem;
  padding-top: 0.8em;
  margin-top: 0.5em;
  border-top: 2px solid #0073aa;
}

.b360ftb__breakdown .label {
  color: #666;
}

.b360ftb__breakdown .value {
  font-weight: 500;
  color: #222;
}

/* Layout */
.b360ftb__flex {
  display: flex;
  gap: 1.5em;
  margin-bottom: 2em;
}

.b360ftb__flex > * {
  flex: 1;
}

.b360ftb__panel {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 1.5em;
  margin-bottom: 1.5em;
}

.b360ftb__panel h3 {
  margin-top: 0;
  margin-bottom: 1em;
  font-size: 1.2rem;
}

/* Rate Cards */
.b360ftb__rate-cards {
  margin-top: 1em;
}

.b360ftb__rate-footer {
  margin-top: 1.5em;
  padding-top: 1em;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

.b360ftb__rate-footer p {
  margin: 0.3em 0;
  font-size: 0.85rem;
}

.b360ftb__rate-footer a {
  color: var(--ftb-primary, #0073aa);
  text-decoration: none;
}

.b360ftb__rate-footer a:hover {
  text-decoration: underline;
}

.ucRateCard {
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}

.ucRateCard--best {
  border-color: var(--ftb-primary, #0073aa);
}

.ucCardHeader {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px dashed #e0e0e0;
}

.ucCardLogo img {
  max-height: 44px;
  max-width: 90px;
  object-fit: contain;
}

.ucCardLogo span {
  font-weight: 600;
  color: #222;
}

.ucCardProduct {
  font-size: 1rem;
  font-weight: 600;
  color: #222;
}

.ucCardData {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
}

.ucDataCell {
  flex: 1;
  padding: 14px 18px;
  border-right: 1px solid #eee;
  min-width: 90px;
}

.ucDataCell:last-child {
  border-right: none;
}

.ucDataCell--highlighted {
  background: #ebf5fb;
}

.ucDataCell--cta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
}

.ucDataPrimary {
  font-size: 1.1rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 4px;
}

.ucDataSub {
  font-size: 0.75rem;
  color: #777;
}

.ucCtaBtn {
  display: inline-flex;
  align-items: center;
  background: #3ab8aa;
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 50px;
  white-space: nowrap;
  transition: background 0.2s;
}

.ucCtaBtn:hover,
.ucCtaBtn:focus {
  background: #2ea99b;
  color: #fff;
  text-decoration: none;
}

/* Rate Block Title */
.b360ftb__rate-block {
  margin-bottom: 2em;
}

.b360ftb__rate-block-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ftb-primary, #0073aa);
  margin: 0 0 0.8em;
  padding-bottom: 0.4em;
  border-bottom: 2px solid var(--ftb-primary, #0073aa);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Cashback Checkbox Toggle */
.b360ftb__cashback-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-size: 0.95rem;
  font-weight: 500;
  color: #444;
  margin: 0.5em 0 1.2em;
  cursor: pointer;
}

.b360ftb__cashback-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ftb-primary, #0073aa);
  cursor: pointer;
}

/* Cashback Expand (details/summary) */
.ucCashbackDetails {
  border-top: 1px solid #eee;
  padding: 0;
}

.ucCashbackDetails summary {
  list-style: none;
  padding: 8px 20px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ftb-primary, #0073aa);
  cursor: pointer;
  user-select: none;
}

.ucCashbackDetails summary::-webkit-details-marker {
  display: none;
}

.ucCashbackDetails[open] summary {
  border-bottom: 1px dashed #e0e0e0;
}

.ucCashbackInfo {
  padding: 10px 20px;
  font-size: 0.88rem;
  color: #333;
  background: #f5fbf9;
}

/* Term Slider */
.b360ftb__term-slider {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1em 1.5em;
  margin-bottom: 1.5em;
  display: flex;
  align-items: center;
  gap: 1.2em;
  flex-wrap: wrap;
}

.b360ftb__term-slider label {
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  color: #444;
  margin: 0;
}

.b360ftb__term-slider input[type="range"] {
  flex: 1;
  min-width: 150px;
  accent-color: var(--ftb-primary, #0073aa);
}

.b360ftb__term-value {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ftb-primary, #0073aa);
  min-width: 70px;
  white-space: nowrap;
}

/* Responsive Design */
@media (max-width: 768px) {
  .b360ftb__grid {
    grid-template-columns: 1fr;
  }

  .b360ftb__grid--3 {
    grid-template-columns: 1fr;
  }

  .b360ftb__flex {
    flex-direction: column;
  }

  .b360ftb__result-amount {
    font-size: 2.2rem;
  }

  .b360ftb__card {
    padding: 1.5em;
  }

  .b360ftb__section {
    padding: 1em;
  }

  .b360ftb__step-label {
    font-size: 0.75rem;
  }

  .b360ftb__step-number {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .b360ftb__step-nav {
    flex-direction: column;
  }

  .b360ftb__btn--next {
    margin-left: 0;
  }

  .b360ftb__lender {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5em;
  }

  .b360ftb__lender-logo {
    width: 50px;
    height: 25px;
  }

  .ucCardData {
    flex-direction: column;
  }

  .ucDataCell {
    border-right: none;
    border-bottom: 1px solid #eee;
  }

  .ucDataCell:last-child {
    border-bottom: none;
  }

  .ucDataCell--cta {
    padding: 12px 16px;
    justify-content: flex-start;
  }

  .b360ftb__term-slider {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6em;
  }

  .b360ftb__term-value {
    text-align: left;
  }
}
