/* House Affordability Calculator Styles - Pixel-Perfect Clone */

.ha-page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 15px 40px;
  font-family: Arial, Helvetica, sans-serif;
  color: #333333;
}

/* Top Breadcrumb & Action Bar */
.ha-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.ha-breadcrumbs {
  color: #0844a4;
}

.ha-breadcrumbs a {
  color: #0844a4;
  text-decoration: none;
}

.ha-breadcrumbs a:hover {
  text-decoration: underline;
}

.ha-breadcrumbs .sep {
  color: #777777;
  margin: 0 4px;
}

.ha-breadcrumbs .current {
  color: #333333;
}

.ha-top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ha-top-btn {
  background: none;
  border: none;
  color: #0844a4;
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
}

.ha-top-btn:hover {
  color: #002277;
}

/* Main Heading & Subheadings */
.ha-page-title {
  font-size: 26px;
  font-weight: bold;
  color: #003366;
  margin: 0 0 4px 0;
}

.ha-sub-title {
  font-size: 18px;
  font-weight: bold;
  color: #2b5a88;
  margin: 0 0 8px 0;
}

.ha-sec-heading {
  font-size: 16px;
  font-weight: bold;
  color: #003366;
  margin: 20px 0 6px 0;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 4px;
}

.ha-intro {
  font-size: 13px;
  line-height: 1.5;
  color: #333333;
  margin: 0 0 16px 0;
}

/* 3-Column / 2-Column Responsive Layout */
.ha-main-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 25px;
  align-items: start;
  margin-bottom: 30px;
}

@media (max-width: 880px) {
  .ha-main-grid {
    grid-template-columns: 1fr;
  }
}

.ha-content-col {
  min-width: 0;
}

/* Two-column sub-layout for Calculator 1 and Results */
.ha-calc-results-wrap {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .ha-calc-results-wrap {
    grid-template-columns: 1fr;
  }
}

/* Form Box Styling - matching reference image */
.ha-form-box {
  background-color: #f8fafc;
  border: 1px solid #dcdcdc;
  padding: 12px 14px;
  font-size: 13px;
  border-radius: 3px;
}

.ha-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
}

.ha-form-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #333333;
  font-weight: normal;
  font-size: 13px;
  min-width: 140px;
}

.ha-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #9bb5cf;
  color: #ffffff;
  font-size: 10px;
  font-weight: bold;
  cursor: help;
  user-select: none;
  position: relative;
}

.ha-info-icon:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 20px;
  top: -6px;
  background-color: #2b5a88;
  color: #ffffff;
  padding: 5px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: normal;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  pointer-events: none;
}

.ha-form-control {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
  flex: 1;
}

.ha-input {
  border: 1px solid #7f9db9;
  padding: 3px 5px;
  font-size: 13px;
  color: #000000;
  background-color: #ffffff;
  outline: none;
  border-radius: 2px;
}

.ha-input:focus {
  border-color: #003366;
  box-shadow: 0 0 3px rgba(0, 51, 102, 0.25);
}

.ha-input-currency {
  width: 110px;
  text-align: right;
}

.ha-input-num {
  width: 55px;
  text-align: right;
}

.ha-select {
  border: 1px solid #7f9db9;
  padding: 2px 4px;
  font-size: 12px;
  background-color: #ffffff;
  border-radius: 2px;
}

.ha-select-full {
  width: 100%;
  max-width: 190px;
  font-size: 11.5px;
}

.ha-calc-note {
  font-size: 11px;
  color: #555555;
  white-space: nowrap;
}

.ha-sub-note {
  font-size: 10.5px;
  color: #666666;
  margin-top: -4px;
  margin-bottom: 6px;
  text-align: right;
}

/* Checkbox Row */
.ha-checkbox-row {
  margin: 10px 0 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: #222222;
}

.ha-checkbox-row input[type="checkbox"] {
  accent-color: #003366;
  cursor: pointer;
}

.ha-nested-fields {
  border-left: 2px solid #cbd5e1;
  padding-left: 8px;
  margin-left: 6px;
  margin-bottom: 10px;
}

/* Button Row */
.ha-btn-row {
  display: flex;
  gap: 8px;
  margin: 14px 0 6px;
}

.ha-btn-calculate {
  background: #2e7d32;
  color: #ffffff;
  border: 1px solid #1e5e22;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: bold;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ha-btn-calculate:hover {
  background: #256628;
}

.ha-btn-clear {
  background: #999999;
  color: #ffffff;
  border: 1px solid #888888;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: normal;
  border-radius: 3px;
  cursor: pointer;
}

.ha-btn-clear:hover {
  background: #777777;
}

/* Rates Box matching screenshot */
.ha-rates-box {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 10px 12px;
  margin-top: 14px;
  font-size: 12px;
  border-radius: 3px;
}

.ha-rates-title {
  font-weight: bold;
  color: #003366;
  margin-bottom: 6px;
}

.ha-rates-list {
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.ha-rate-item {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11.5px;
}

.ha-rate-val {
  color: #2e7d32;
  font-weight: bold;
}

.ha-rates-links {
  display: flex;
  gap: 10px;
  font-size: 12px;
}

.ha-rates-links a,
.ha-rates-links button {
  color: #0844a4;
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
}

.ha-rates-links a:hover,
.ha-rates-links button:hover {
  color: #002277;
}

/* Results Display Box */
.ha-results-box {
  background-color: #ffffff;
  border: 1px solid #dcdcdc;
  padding: 14px;
  font-size: 13px;
  border-radius: 3px;
}

.ha-results-header {
  border-bottom: 2px solid #003366;
  padding-bottom: 6px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.ha-results-title {
  font-size: 16px;
  font-weight: bold;
  color: #003366;
}

.ha-hero-price-wrap {
  background: #f0f7f0;
  border: 1px solid #c2e0c2;
  padding: 12px;
  border-radius: 3px;
  margin-bottom: 14px;
  text-align: center;
}

.ha-hero-label {
  font-size: 12px;
  color: #4b5563;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.ha-hero-price {
  font-size: 28px;
  font-weight: bold;
  color: #2e7d32;
  margin: 4px 0;
}

.ha-hero-subtitle {
  font-size: 12px;
  color: #374151;
}

/* Key Metrics Grid */
.ha-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.ha-metric-card {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 8px 10px;
  border-radius: 3px;
}

.ha-metric-label {
  font-size: 11px;
  color: #64748b;
}

.ha-metric-value {
  font-size: 15px;
  font-weight: bold;
  color: #0f172a;
}

/* Breakdown Table */
.ha-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  font-size: 12.5px;
}

.ha-summary-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f1f5f9;
}

.ha-summary-table td:first-child {
  color: #333333;
}

.ha-summary-table td:last-child {
  text-align: right;
  font-weight: 600;
  background-color: #f8fafc;
}

.ha-summary-table tr.total-row td {
  border-top: 2px solid #cbd5e1;
  font-weight: bold;
  color: #003366;
  background-color: #edf2f7;
}

/* Visual Donut Chart & SVG Visualizers */
.ha-chart-container {
  margin: 16px 0;
  padding: 12px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
}

.ha-chart-title {
  font-size: 13px;
  font-weight: bold;
  color: #003366;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ha-donut-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.ha-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
}

.ha-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ha-legend-color {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Sensitivity Bar Chart */
.ha-bar-chart {
  margin-top: 10px;
}

.ha-bar-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11.5px;
}

.ha-bar-label {
  width: 55px;
  color: #4b5563;
  font-weight: 600;
}

.ha-bar-track {
  flex: 1;
  height: 18px;
  background-color: #e2e8f0;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  margin: 0 8px;
}

.ha-bar-fill {
  height: 100%;
  background-color: #2b5a88;
  transition: width 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  color: #ffffff;
  font-size: 10px;
  font-weight: bold;
}

.ha-bar-fill.active {
  background-color: #2e7d32;
}

.ha-bar-val {
  width: 75px;
  text-align: right;
  font-weight: 600;
  color: #1e293b;
}

/* DTI Visualizer Bar */
.ha-dti-bar-wrap {
  margin: 10px 0;
}

.ha-dti-scale {
  display: flex;
  height: 22px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
  border: 1px solid #cbd5e1;
}

.ha-dti-segment-housing {
  background-color: #2b5a88;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
}

.ha-dti-segment-debt {
  background-color: #dc2626;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
}

.ha-dti-segment-remaining {
  background-color: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* Fraction Arithmetic Section */
.ha-fraction-tool {
  background-color: #f8fafc;
  border: 1px solid #a3b8cc;
  border-radius: 3px;
  padding: 16px;
  margin: 25px 0;
}

.ha-fraction-title {
  font-size: 15px;
  font-weight: bold;
  color: #003366;
  margin-bottom: 6px;
}

.ha-fraction-desc {
  font-size: 12.5px;
  color: #4b5563;
  margin-bottom: 14px;
  line-height: 1.4;
}

.ha-fraction-calc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ha-fraction-input-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ha-fraction-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ha-fraction-stack input {
  width: 44px;
  height: 24px;
  text-align: center;
  font-size: 12px;
  border: 1px solid #7f9db9;
  border-radius: 2px;
}

.ha-fraction-divider {
  width: 44px;
  height: 1px;
  background-color: #333333;
}

.ha-fraction-op-select {
  border: 1px solid #7f9db9;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: bold;
  background-color: #ffffff;
  border-radius: 2px;
}

.ha-fraction-result-box {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  padding: 12px;
  margin-top: 10px;
}

.ha-fraction-visuals-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 12px;
}

@media (max-width: 600px) {
  .ha-fraction-visuals-grid {
    grid-template-columns: 1fr;
  }
}

/* SIDEBAR COLUMN (Right) */
.ha-sidebar-col {
  font-size: 13px;
}

.ha-side-search-form {
  display: flex;
  margin-bottom: 14px;
  position: relative;
}

.ha-side-search-wrap {
  position: relative;
  flex: 1;
  display: flex;
}

.ha-side-search-input {
  width: 100%;
  border: 1px solid #7f9db9;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  background-color: #ffffff;
  color: #333333;
}

.ha-side-search-input:focus {
  border-color: #003366;
  box-shadow: 0 0 3px rgba(0, 51, 102, 0.25);
}

.ha-side-search-btn {
  background-color: #2b5a88;
  color: #ffffff;
  border: 1px solid #1b4570;
  border-left: none;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.ha-side-search-btn:hover {
  background-color: #1b4570;
}

.ha-search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #ffffff;
  border: 1px solid #7f9db9;
  border-top: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
}

.ha-search-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 9px;
  font-size: 12px;
  color: #222222;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  transition: background-color 0.1s ease;
}

.ha-search-item:last-child {
  border-bottom: none;
}

.ha-search-item:hover,
.ha-search-item.highlighted {
  background-color: #eaf1f8;
  color: #003366;
}

.ha-search-item-cat {
  font-size: 10px;
  color: #555555;
  background-color: #edf2f7;
  padding: 1px 5px;
  border-radius: 2px;
  margin-left: 6px;
  white-space: nowrap;
}

/* Sidebar Financial Calculators Card */
.ha-side-card {
  border: 1px solid #a3b8cc;
  margin-bottom: 15px;
}

.ha-side-card-title {
  background-color: #2b5a88;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
  padding: 5px 8px;
}

.ha-side-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px;
  gap: 4px 10px;
  font-size: 12px;
  background-color: #ffffff;
}

.ha-side-card-grid a {
  color: #0844a4;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ha-side-card-grid a:hover {
  text-decoration: underline;
}

.ha-side-card-more {
  padding: 4px 8px 8px;
  font-size: 12px;
  background-color: #ffffff;
}

.ha-side-card-more a {
  color: #0844a4;
  text-decoration: none;
  font-weight: bold;
}

.ha-side-card-more a:hover {
  text-decoration: underline;
}

.ha-side-footer-links {
  font-size: 11px;
  color: #555555;
  line-height: 1.6;
}

.ha-side-footer-links a {
  color: #0844a4;
  text-decoration: none;
}

.ha-side-footer-links a:hover {
  text-decoration: underline;
}

/* SEO Content Section */
.ha-seo-section {
  border-top: 1px solid #cbd5e1;
  padding-top: 25px;
  margin-top: 30px;
  font-size: 13px;
  line-height: 1.65;
  color: #333333;
}

.ha-seo-section h2 {
  font-size: 20px;
  color: #003366;
  margin: 18px 0 8px;
}

.ha-seo-section h3 {
  font-size: 15px;
  color: #2b5a88;
  margin: 14px 0 6px;
}

.ha-seo-section p {
  margin: 0 0 12px 0;
}

.ha-seo-section ul,
.ha-seo-section ol {
  margin: 0 0 14px 20px;
  padding: 0;
}

.ha-seo-section li {
  margin-bottom: 5px;
}

.ha-faq-card {
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}

.ha-faq-question {
  background-color: #f1f5f9;
  padding: 9px 12px;
  font-weight: bold;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ha-faq-question:hover {
  background-color: #e2e8f0;
}

.ha-faq-answer {
  padding: 10px 12px;
  font-size: 12.5px;
  color: #334155;
  background-color: #ffffff;
  display: none;
  border-top: 1px solid #e2e8f0;
}

.ha-faq-card.active .ha-faq-answer {
  display: block;
}

/* Modals: History, Print, Quick Calculator */
.ha-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.ha-modal-card {
  background: #ffffff;
  border-radius: 4px;
  max-width: 650px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.ha-modal-header {
  background-color: #003366;
  color: #ffffff;
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ha-modal-title {
  font-size: 15px;
  font-weight: bold;
}

.ha-modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.ha-modal-body {
  padding: 16px;
  overflow-y: auto;
  font-size: 13px;
}

.ha-modal-footer {
  background-color: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 10px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Print Specific */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .site-header,
  .site-footer,
  .ha-sidebar-col,
  .ha-top-actions,
  .ha-btn-row,
  .ha-fraction-tool,
  .ha-modal-overlay {
    display: none !important;
  }
  .ha-main-grid {
    grid-template-columns: 1fr !important;
  }
  .ha-calc-results-wrap {
    grid-template-columns: 1fr !important;
  }
  .ha-results-box {
    border: 1px solid #000000 !important;
  }
}

/* RTL Layout Support for Arabic */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] .ha-top-bar,
[dir="rtl"] .ha-top-actions,
[dir="rtl"] .ha-form-row,
[dir="rtl"] .ha-btn-row,
[dir="rtl"] .ha-rates-strip {
  flex-direction: row-reverse;
}

[dir="rtl"] .ha-table th,
[dir="rtl"] .ha-table td {
  text-align: right;
}

[dir="rtl"] .ha-table td:last-child,
[dir="rtl"] .ha-table th:last-child {
  text-align: left;
}

[dir="rtl"] .ha-side-search-form {
  flex-direction: row-reverse;
}

[dir="rtl"] .ha-faq-question {
  flex-direction: row-reverse;
}

[dir="rtl"] .ha-modal-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .ha-modal-footer {
  flex-direction: row-reverse;
}

