/* Modal windows styles */

/* Ensure modals appear above all other content */
.modal {
  z-index: 1060 !important;
}

.modal-backdrop {
  z-index: 1055 !important;
}

/* Mobile Sticky CTA */
.mobile-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) 16px;
  z-index: 1040;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.mobile-sticky-cta.show {
  transform: translateY(0);
}

.sticky-cta-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 400px;
  margin: 0 auto;
}

.sticky-cta-text strong {
  display: block;
  color: #1f2937;
  font-size: 0.95rem;
  line-height: 1.2;
}

.sticky-cta-text small {
  color: #6b7280;
  font-size: 0.8rem;
}

.sticky-cta-btn {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 25px;
  white-space: nowrap;
}

/* Floating AI Chat Button — stacked circle (desktop) */
.ai-chat-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 92px;
  height: 92px;
  padding: 0;
  border-radius: 50%;
  background: var(--primary-gradient);
  border: none;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
  color: white;
  cursor: pointer;
  z-index: 1030;
  transition: all 0.3s ease;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ai-chat-button-icon {
  flex-shrink: 0;
}

.ai-chat-button-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1;
}

.ai-chat-button:hover {
  transform: scale(1.06);
  box-shadow: 0 12px 32px rgba(139, 92, 246, 0.4);
}

.ai-chat-button::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: var(--primary-gradient);
  border-radius: 50%;
  z-index: -1;
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* Exit Intent Popup */
.exit-intent-content {
  position: relative;
}

.exit-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80px;
  height: 80px;
  margin: 0 auto;
  background: rgba(220, 38, 38, 0.1);
  border-radius: 50%;
  border: 2px solid rgba(220, 38, 38, 0.2);
}

.exit-benefit-item {
  text-align: left;
  padding: 8px 0;
  color: #374151;
  font-size: 0.95rem;
}

.urgency-message {
  font-size: 0.9rem;
  color: #7f1d1d;
}

.exit-footer {
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

/* Download Modal Styles */
.value-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.value-item {
  padding: 8px 0;
}

.value-item strong {
  color: #1f2937;
  font-size: 0.95rem;
}

.social-proof {
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.trust-signals {
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

/* =============================================================================
   PDF Calculator Modal Wizard Styles
   ============================================================================= */

/* PDF Wizard Step Visibility */
.pdf-wizard-step {
  display: none;
  animation: fadeInStep 0.3s ease;
}

.pdf-wizard-step.active {
  display: block;
}

@keyframes fadeInStep {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* PDF Wizard Progress Bar */
.pdf-wizard-progress .progress {
  overflow: hidden;
}

.pdf-wizard-progress .progress-bar {
  transition: width 0.3s ease;
}

/* PDF Wizard Navigation */
.pdf-wizard-nav {
  gap: 12px;
}

.pdf-wizard-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  transition: all 0.2s ease;
}

.pdf-wizard-nav button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pdf-wizard-nav button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* PDF Wizard Form Styling */
#pdfWizardForm .form-control,
#pdfWizardForm .form-select {
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

#pdfWizardForm .form-control:focus,
#pdfWizardForm .form-select:focus {
  border-color: var(--primary-blue, #1E88E5);
  box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.1);
  outline: none;
}

#pdfWizardForm .input-group-text {
  font-weight: 500;
  color: #6b7280;
}

/* PDF Modal Higher Z-index for layering */
#pdfCalculatorModal {
  z-index: 1065;
}

/* Responsive adjustments for PDF wizard */
@media (max-width: 576px) {
  .pdf-wizard-nav {
    flex-direction: column;
  }

  .pdf-wizard-nav button {
    width: 100%;
    margin-left: 0 !important;
  }

  #pdfPrevBtn {
    order: 2;
    margin-top: 8px;
  }

  #pdfNextBtn {
    order: 1;
  }
}

/* =============================================================================
   Results Modal Styles
   ============================================================================= */

#resultsModal .modal-content {
  border: none;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.results-header {
  background: var(--primary-gradient);
  color: white;
  padding: 2rem 2rem 1rem;
  text-align: center;
  position: relative;
}

.results-header-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="8" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="30" r="6" fill="rgba(255,255,255,0.1)"/><circle cx="60" cy="70" r="10" fill="rgba(255,255,255,0.1)"/></svg>');
  opacity: 0.5;
}

.results-header .btn-close {
  position: absolute;
  top: 15px;
  right: 15px;
  z-index: 3;
}

.results-header-content {
  position: relative;
  z-index: 2;
}

.results-header-content h3 {
  margin: 0;
  font-weight: 700;
}

.results-main-amount {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 1rem 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.results-bank-badge {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-block;
  margin: 0.5rem 0;
}

.results-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.results-stat-item {
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.75rem;
  border-radius: 12px;
}

.results-stat-number {
  font-size: 1.2rem;
  font-weight: bold;
  display: block;
}

.results-stat-label {
  font-size: 0.8rem;
  opacity: 0.9;
}

.results-confetti {
  display: inline-block;
  animation: bounce 2s infinite;
}

.results-body {
  padding: 2rem;
  background: white;
}

.results-disclaimer {
  background: linear-gradient(135deg, rgba(212, 168, 0, 0.12), rgba(245, 158, 11, 0.12));
  border-left: 4px solid #d97706;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 1.5rem;
  text-align: left;
}

.results-disclaimer-header {
  color: #92400e;
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.results-disclaimer-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.results-disclaimer-list li {
  color: #78350f;
  font-size: 0.82rem;
  line-height: 1.5;
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}

.results-disclaimer-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #d97706;
  font-weight: bold;
}

.results-disclaimer-list li:last-child {
  margin-bottom: 0;
}

/* =============================================================================
   What-If Section
   ============================================================================= */

.what-if-section {
  background: rgba(59, 130, 246, 0.04);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
  overflow: hidden;
}

.what-if-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
}

.what-if-header:hover {
  background: rgba(59, 130, 246, 0.06);
}

.what-if-header-text {
  font-weight: 600;
  color: #1e40af;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.what-if-header-icon {
  font-size: 1.1rem;
}

.what-if-body {
  padding: 0 1.25rem 1.25rem;
}

.what-if-intro {
  color: #475569;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.what-if-scenario {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid #e5e7eb;
}

.what-if-scenario-shorter {
  border-left: 4px solid #ef4444;
}

.what-if-scenario-longer {
  border-left: 4px solid #22c55e;
}

.what-if-scenario-label {
  color: #374151;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.what-if-scenario-data {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.what-if-amount {
  color: #1f2937;
  font-size: 0.95rem;
}

.what-if-amount strong {
  font-size: 1.05rem;
}

.what-if-diff {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.what-if-diff-negative {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.what-if-diff-positive {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.what-if-scenario-note {
  color: #6b7280;
  font-size: 0.8rem;
  margin-top: 0.5rem;
  font-style: italic;
}

.what-if-advice {
  color: #475569;
  font-size: 0.85rem;
  margin: 1rem 0;
  text-align: center;
  font-style: italic;
}

.what-if-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.what-if-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

/* Mobile adjustments for What-If */
@media (max-width: 576px) {
  .what-if-scenario-data {
    flex-direction: column;
    align-items: flex-start;
  }

  .what-if-header-text {
    font-size: 0.88rem;
  }
}

/* =============================================================================
   Rate Stress Section (Interest Rate Increase Scenarios)
   ============================================================================= */

.rate-stress-section {
  background: rgba(245, 158, 11, 0.04);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 16px;
  overflow: hidden;
}

.rate-stress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
}

.rate-stress-header:hover {
  background: rgba(245, 158, 11, 0.06);
}

.rate-stress-header-text {
  font-weight: 600;
  color: #92400e;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rate-stress-header-icon {
  font-size: 1.1rem;
}

.rate-stress-body {
  padding: 0 1.25rem 1.25rem;
}

.rate-stress-intro {
  color: #475569;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.rate-stress-scenario {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid #e5e7eb;
}

.rate-stress-level-1 {
  border-left: 4px solid #eab308;
}

.rate-stress-level-2 {
  border-left: 4px solid #f59e0b;
}

.rate-stress-level-3 {
  border-left: 4px solid #ef4444;
}

.rate-stress-scenario-label {
  color: #374151;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.rate-stress-scenario-data {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rate-stress-capacity {
  color: #1f2937;
  font-size: 0.95rem;
}

.rate-stress-capacity strong {
  font-size: 1.05rem;
}

.rate-stress-payment {
  color: #1f2937;
  font-size: 0.95rem;
}

.rate-stress-payment strong {
  font-size: 1.05rem;
}

.rate-stress-diff {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  margin-left: 4px;
}

.rate-stress-diff-negative {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.rate-stress-diff-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.rate-stress-advice {
  color: #475569;
  font-size: 0.85rem;
  margin: 1rem 0;
  text-align: center;
  font-style: italic;
}

.rate-stress-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.rate-stress-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

/* Mobile adjustments for Rate Stress */
@media (max-width: 576px) {
  .rate-stress-scenario-data {
    flex-direction: column;
    align-items: flex-start;
  }

  .rate-stress-header-text {
    font-size: 0.88rem;
  }
}

/* =============================================================================
   Rate Decrease Section (Interest Rate Decrease Scenarios)
   ============================================================================= */

.rate-decrease-section {
  background: rgba(22, 163, 74, 0.04);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 16px;
  overflow: hidden;
}

.rate-decrease-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: background 0.2s ease;
  user-select: none;
}

.rate-decrease-header:hover {
  background: rgba(22, 163, 74, 0.06);
}

.rate-decrease-header-text {
  font-weight: 600;
  color: #15803d;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rate-decrease-header-icon {
  font-size: 1.1rem;
}

.rate-decrease-body {
  padding: 0 1.25rem 1.25rem;
}

.rate-decrease-intro {
  color: #475569;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.rate-decrease-scenario {
  background: white;
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid #e5e7eb;
}

.rate-decrease-level-1 {
  border-left: 4px solid #86efac;
}

.rate-decrease-level-2 {
  border-left: 4px solid #22c55e;
}

.rate-decrease-level-3 {
  border-left: 4px solid #16a34a;
}

.rate-decrease-scenario-label {
  color: #374151;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.rate-decrease-scenario-data {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rate-decrease-capacity {
  color: #1f2937;
  font-size: 0.95rem;
}

.rate-decrease-capacity strong {
  font-size: 1.05rem;
}

.rate-decrease-payment {
  color: #1f2937;
  font-size: 0.95rem;
}

.rate-decrease-payment strong {
  font-size: 1.05rem;
}

.rate-decrease-diff {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
  margin-left: 4px;
}

.rate-decrease-diff-positive {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

.rate-decrease-diff-savings {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
}

.rate-decrease-advice {
  color: #475569;
  font-size: 0.85rem;
  margin: 1rem 0;
  text-align: center;
  font-style: italic;
}

.rate-decrease-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.rate-decrease-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

/* Mobile adjustments for Rate Decrease */
@media (max-width: 576px) {
  .rate-decrease-scenario-data {
    flex-direction: column;
    align-items: flex-start;
  }

  .rate-decrease-header-text {
    font-size: 0.88rem;
  }
}

.results-value-prop {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(139, 92, 246, 0.1) 100%);
  border: 2px solid rgba(139, 92, 246, 0.2);
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.results-value-prop-icon {
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ai-purple);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.results-value-prop h4 {
  color: var(--ai-purple);
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.results-value-prop p {
  color: #6b46c1;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

.results-feature-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.results-feature-badge {
  background: rgba(139, 92, 246, 0.1);
  color: var(--ai-purple);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.results-bank-preview {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1rem;
  margin: 1.5rem 0;
  border: 1px solid #e5e7eb;
}

.bank-preview-title {
  margin-bottom: 0.25rem;
  color: #1f2937;
  font-size: 1rem;
  font-weight: 700;
}

.sort-toggle-container {
  display: flex;
  margin: 0.75rem 0;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  border: 1px solid #e2e8f0;
}

.sort-pill {
  flex: 1;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.01em;
}

.sort-pill:hover:not(.sort-pill-active) {
  color: #334155;
  background: rgba(255, 255, 255, 0.7);
}

.sort-pill-active {
  background: white;
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(30, 136, 229, 0.15);
}

.sort-pill-active[data-sort="capacity"] {
  color: #1565c0;
  border-color: rgba(30, 136, 229, 0.25);
  box-shadow: 0 2px 8px rgba(30, 136, 229, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sort-pill-active[data-sort="fixedRate"] {
  color: #6d28d9;
  border-color: rgba(139, 92, 246, 0.25);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bank-preview-subtitle {
  margin: 0 0 0.75rem;
  color: #9CA3AF;
  font-size: 0.78rem;
}

.results-bank-header {
  display: grid;
  grid-template-columns: 32px 1.4fr 0.6fr 1fr 0.8fr;
  font-size: 0.7rem;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0 0.25rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 0.25rem;
}

.results-bank-header span:nth-child(3) {
  text-align: center;
}

.results-bank-header span:nth-child(4) {
  text-align: center;
}

.results-bank-header span:nth-child(5) {
  text-align: right;
}

.results-bank-row {
  display: grid;
  grid-template-columns: 34px 1.4fr 0.6fr 1fr 0.8fr;
  align-items: center;
  padding: 8px 0.25rem;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.9rem;
  gap: 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.results-bank-row:last-of-type {
  border-bottom: none;
}

/* Rank number */
.bank-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.0rem;
  font-weight: 700;
  background: #e5e7eb;
  color: #6b7280;
  flex-shrink: 0;
}

.bank-rank-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

.bank-rank-silver {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  color: white;
  box-shadow: 0 2px 6px rgba(107, 114, 128, 0.35);
}

.bank-rank-bronze {
  background: linear-gradient(135deg, #cd7f32 0%, #a0522d 100%);
  color: white;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.35);
}

/* Best bank highlight (#1) */
.results-bank-row.bank-best-offer {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-bottom: 1px solid rgba(16, 185, 129, 0.25);
  margin: 2px 0;
}

.bank-best-chip {
  display: inline-block;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: middle;
}

.results-bank-row .bank-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-weight: 600;
  color: #374151;
  overflow: hidden;
  min-width: 0;
}

.bank-logo {
  height: 44px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  background: white;
  padding: 4px 6px;
  border: 1px solid #f0f0f0;
}

.bank-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.results-bank-row .bank-amount {
  color: var(--success-green);
  font-weight: bold;
  text-align: center;
  font-variant-numeric: tabular-nums;
  align-self: center;
}

.results-bank-row .bank-term {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
  text-align: center;
  align-self: center;
}

.results-bank-row .bank-monthly {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
  text-align: right;
  align-self: center;
}

/* Bank extras — full width row under data */
.results-bank-row .bank-extras {
  grid-column: 2 / -1;
}

/* Commission badge */
.commission-tag {
  background: #F3F4F6;
  color: #6b7280;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  margin-top: 4px;
}

.commission-tag-free {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

/* CTA footer */
.results-bank-comparison-mini {
  text-align: center;
  margin-top: 0.75rem;
}

.bank-comparison-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px dashed rgba(139, 92, 246, 0.4);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6b7280;
}

.bank-comparison-cta:hover {
  border-style: solid;
  border-color: var(--ai-purple);
  color: var(--ai-purple);
  background: rgba(139, 92, 246, 0.04);
}

.bank-comparison-cta small {
  color: inherit;
  font-weight: 500;
}

.bank-comparison-cta-arrow {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.bank-comparison-cta:hover .bank-comparison-cta-arrow {
  transform: translateX(3px);
}

.results-cta {
  text-align: center;
}

.results-cta-button {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 18px 40px;
  border-radius: 16px;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-bottom: 1rem;
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.4);
}

.results-social-proof-cta {
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
  text-align: center;
}

.results-social-proof-cta div {
  color: var(--ai-purple);
  font-weight: 600;
  font-size: 0.9rem;
}

.results-dismiss-link {
  display: inline-block;
  margin-top: 1rem;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.results-dismiss-link:hover {
  color: #374151;
  background: #f3f4f6;
}

/* =============================================================================
   Promotion Badges
   ============================================================================= */

.promo-badge {
  display: inline-block;
  background: linear-gradient(135deg, #8B5CF6, #a78bfa);
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.promo-urgency {
  display: inline-block;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
  animation: promo-pulse 2s ease-in-out infinite;
}

@keyframes promo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* =============================================================================
   Promotion Details Panel (expandable)
   ============================================================================= */

/* Expandable bank row (has promotions) */
.results-bank-row-expandable { cursor: pointer; }
.results-bank-row-expandable:hover { background: rgba(139, 92, 246, 0.04); }

/* Expand arrow next to promo badge */
.promo-expand-arrow {
  display: inline-block;
  font-size: 0.7rem;
  color: #8B5CF6;
  transition: transform 0.25s ease;
  margin-left: 4px;
}
.promo-expand-arrow-open { transform: rotate(180deg); }

/* Clickable badge */
.promo-badge-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.promo-badge-clickable:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.promo-badge-clickable:focus-visible {
  outline: 2px solid #8B5CF6;
  outline-offset: 2px;
}

.promo-badge-active {
  background: linear-gradient(135deg, #7c3aed, #8B5CF6) !important;
}

/* Panel container - hidden by default */
.promo-details-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.35s ease, opacity 0.25s ease;
}

.promo-details-panel.promo-panel-open {
  opacity: 1;
  /* max-height ustawiane dynamicznie przez JS (scrollHeight) */
}

/* Panel inner content */
.promo-panel-content {
  background: rgba(139, 92, 246, 0.04);
  border-left: 3px solid #8B5CF6;
  border-radius: 0 10px 10px 0;
  padding: 12px 14px;
  margin: 4px 0 8px;
}

.promo-panel-header {
  font-size: 0.88rem;
  color: #5b21b6;
  margin-bottom: 10px;
}

.promo-standard-ref {
  background: rgba(107, 114, 128, 0.06);
  border: 1px solid rgba(107, 114, 128, 0.15);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.promo-standard-ref-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
}

.promo-standard-ref-metrics {
  display: flex;
  flex-direction: row;
  gap: 16px;
}

.promo-ref-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.promo-ref-metric-label {
  font-size: 0.68rem;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.promo-ref-metric-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: #6b7280;
}

.promo-panel-icon {
  font-size: 1rem;
}

/* Variant cards */
.promo-variant-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.promo-variant-card:last-of-type {
  margin-bottom: 0;
}

.promo-variant-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: #374151;
  margin-bottom: 6px;
}

/* Metrics row */
.promo-variant-metrics {
  display: flex;
  flex-direction: row;
  gap: 16px;
  margin-bottom: 6px;
}

.promo-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.promo-metric-label {
  font-size: 0.7rem;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
}

.promo-metric-value {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1f2937;
}

.promo-metric-diff {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  display: inline-block;
  width: fit-content;
}

.promo-metric-diff-positive {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}

.promo-metric-diff-negative {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

/* Expiry date with urgency */
.promo-variant-expiry {
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 4px;
  padding: 3px 0;
}

.promo-expiry-safe {
  color: #059669;
}

.promo-expiry-warning {
  color: #d97706;
}

.promo-expiry-critical {
  color: #dc2626;
  font-weight: 700;
}

.promo-expiry-days {
  font-weight: 600;
}

/* Variant details row (commission + fixed rate) */
.promo-variant-details-row {
  display: flex;
  flex-direction: row;
  gap: 16px;
  border-top: 1px dashed #e5e7eb;
  padding-top: 6px;
  margin-top: 6px;
  margin-bottom: 6px;
}

.promo-detail-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
}

.promo-detail-label {
  color: #9CA3AF;
  font-weight: 500;
}

.promo-detail-value {
  color: #374151;
  font-weight: 600;
}

.promo-detail-diff {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0 4px;
  border-radius: 8px;
}

.promo-detail-diff-positive {
  background: rgba(5, 150, 105, 0.1);
  color: #059669;
}

.promo-detail-diff-negative {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

/* Variant header (name + link) */
.promo-variant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.promo-variant-header .promo-variant-name {
  margin-bottom: 0;
}

.promo-variant-link {
  display: inline-flex;
  align-items: center;
  color: #7c3aed;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.promo-variant-link:hover {
  opacity: 1;
}

/* Conditions text */
.promo-variant-conditions {
  font-size: 0.78rem;
  color: #6b7280;
  line-height: 1.4;
  font-style: italic;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.promo-conditions-collapsed {
  max-height: 0;
}

.promo-conditions-toggle {
  display: inline-block;
  font-size: 0.74rem;
  color: #7c3aed;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 2px 0;
  margin-top: 2px;
  font-style: normal;
}

.promo-conditions-toggle:hover {
  text-decoration: underline;
}

/* CTA button */
.promo-panel-cta {
  margin-top: 12px;
  text-align: center;
}

.promo-panel-cta-btn {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed 0%, #8B5CF6 100%);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.promo-panel-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* Responsive - tablet */
@media (max-width: 768px) {
  .promo-variant-metrics {
    flex-direction: column;
    gap: 8px;
  }

  .promo-standard-ref-metrics {
    flex-direction: column;
    gap: 6px;
  }

  .promo-variant-details-row {
    flex-direction: column;
    gap: 4px;
  }

  .promo-panel-content {
    padding: 10px 12px;
  }
}

/* Responsive - mobile */
@media (max-width: 576px) {
  .promo-panel-content {
    padding: 8px 10px;
  }

  .promo-variant-card {
    padding: 8px 10px;
  }

  .promo-variant-name {
    font-size: 0.8rem;
  }

  .promo-metric-value {
    font-size: 0.82rem;
  }

  .promo-ref-metric-value {
    font-size: 0.8rem;
  }

  .promo-panel-cta-btn {
    font-size: 0.8rem;
    padding: 8px 12px;
  }
}

/* =============================================================================
   Bank Inquiry Modal
   ============================================================================= */

#bankInquiryModal {
  z-index: 1065;
}

.bank-inquiry-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  min-height: 400px;
}

.bank-inquiry-summary {
  padding: 1.5rem;
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
}

.bank-inquiry-summary-title {
  font-size: 0.82rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.bank-inquiry-bank-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 1rem;
}

.bank-inquiry-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 1rem;
}

.bank-inquiry-metric {
  background: white;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
}

.bank-inquiry-metric-label {
  font-size: 0.7rem;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  margin-bottom: 2px;
}

.bank-inquiry-metric-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1f2937;
}

.bank-inquiry-info-box {
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: #065f46;
  line-height: 1.5;
}

.bank-inquiry-info-box-icon {
  font-size: 1rem;
  margin-right: 4px;
}

.bank-inquiry-form-panel {
  padding: 1.5rem;
}

/* CTA Button in bank row */
.bank-inquiry-btn {
  display: inline-block;
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-top: 4px;
  margin-left: auto;
}

.bank-inquiry-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}

.bank-inquiry-btn:active {
  transform: scale(0.98);
}

/* Responsive: stack vertically on mobile */
@media (max-width: 768px) {
  .bank-inquiry-layout {
    grid-template-columns: 1fr;
  }

  .bank-inquiry-summary {
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 1.25rem;
  }

  .bank-inquiry-form-panel {
    padding: 1.25rem;
  }
}

/* Data Freshness Timestamp */
.results-data-freshness {
  background: rgba(16, 185, 129, 0.08);
  border-left: 4px solid #10b981;
  padding: 12px 14px;
  margin-bottom: 1.5rem;
  border-radius: 8px;
}

.results-data-freshness small {
  color: #065f46;
  font-size: 0.82rem;
  line-height: 1.6;
}

.freshness-icon {
  font-size: 0.9rem;
}

/* Interest Rate Breakdown */
.results-rate-breakdown {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(139, 92, 246, 0.12));
  border-left: 4px solid var(--ai-purple, #8B5CF6);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 1.5rem;
}

.results-rate-breakdown h6 {
  color: #5b21b6;
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.rate-breakdown-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  margin-bottom: 8px;
}

.rate-breakdown-label {
  color: #6b46c1;
  font-size: 0.88rem;
}

.rate-breakdown-value {
  color: #5b21b6;
  font-weight: 700;
  font-size: 0.88rem;
  text-align: right;
}

.rate-breakdown-total {
  border-top: 1px solid rgba(139, 92, 246, 0.2);
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  color: #5b21b6;
  font-size: 0.95rem;
}

.rate-breakdown-note {
  display: block;
  margin-top: 8px;
  color: #7c3aed;
  font-size: 0.78rem;
  font-style: italic;
}

/* LTV/DTI Metrics */
.results-metrics {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), rgba(59, 130, 246, 0.12));
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 1.5rem;
}

.results-metrics h6 {
  color: #1e40af;
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-item {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}

.metric-label {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 2px;
}

.metrics-note {
  display: block;
  margin-top: 8px;
  color: #7c3aed;
  font-size: 0.78rem;
  font-style: italic;
}

.metric-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e40af;
}

/* Responsive: Results Modal - Tablet */
@media (max-width: 768px) {
  .sort-pill {
    font-size: 0.78rem;
    padding: 6px 10px;
  }

  .results-quick-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .results-stat-number {
    font-size: 1.05rem;
  }

  .results-stat-label {
    font-size: 0.75rem;
  }

  .results-main-amount {
    font-size: 1.8rem;
  }

  .results-body {
    padding: 1.25rem;
  }

  .results-header {
    padding: 1.5rem 1.25rem 1rem;
  }

  .results-bank-header {
    display: none;
  }

  .results-bank-row {
    grid-template-columns: 36px 1fr auto;
    gap: 2px 8px;
  }

  .results-bank-row .bank-rank {
    grid-row: 1 / 3;
    grid-column: 1;
    align-self: center;
  }

  .results-bank-row .bank-name {
    font-size: 0.85rem;
    grid-column: 2 / -1;
    grid-row: 1;
  }

  .bank-logo {
    height: 28px;
    padding: 2px 4px;
  }

  .results-bank-row .bank-amount {
    font-size: 0.85rem;
    text-align: left;
    grid-column: 2;
    grid-row: 2;
  }

  .results-bank-row .bank-term {
    display: block;
    grid-column: 3;
    grid-row: 2;
    font-size: 0.75rem;
    color: #9CA3AF;
    text-align: right;
    align-self: center;
    white-space: nowrap;
  }

  .results-bank-row .bank-term::before {
    content: 'Okres maks. ';
  }

  .results-bank-row .bank-monthly {
    text-align: left;
    grid-column: 2 / -1;
    grid-row: 3;
  }

  .results-bank-row .bank-extras {
    grid-column: 1 / -1;
    grid-row: 4;
  }

  .bank-comparison-cta {
    width: 100%;
    justify-content: center;
  }

  .results-feature-badge {
    padding: 4px 8px;
    font-size: 0.75rem;
  }

  .results-value-prop {
    padding: 1.25rem;
  }

  .results-value-prop h4 {
    font-size: 1.1rem;
  }

  .results-cta-button {
    padding: 14px 24px;
    font-size: 1rem;
    border-radius: 12px;
  }
}

/* Responsive: Results Modal - Mobile */
@media (max-width: 576px) {
  .results-quick-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .results-main-amount {
    font-size: 1.5rem;
  }

  .metric-value {
    font-size: 0.9rem;
  }

  .metric-label {
    font-size: 0.7rem;
  }

  .metric-item {
    padding: 8px 6px;
  }
}