/* Fee comparison tool (/compare-fees, templates/compare_fees.html).
   Builds on style_profiles.css (page layout, fee tables) and firm-search.css
   (suggestion list). Font sizes in px: Bootstrap 3's root font size is 10px. */

.fc-intro {
  font-size: 16px;
}

/* Search form: two firm boxes side by side on wide screens, stacked on phones. */
.fc-form {
  margin: 0 0 24px 0;
  padding: 20px;
  background: #f5f8fb;
  border: 1px solid #e1e8ef;
  border-radius: 8px;
}
.fc-firms,
.fc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: end;
}
.fc-row {
  margin-top: 16px;
}
.fc-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #212529;
}
.fc-optional {
  font-weight: 400;
  color: #6c757d;
}
.fc-form .form-control {
  height: 44px;
  font-size: 16px; /* 16px stops iOS zooming into the field */
}
.fc-submit {
  height: 44px;
  font-size: 16px;
  font-weight: 600;
  background: #01447e;
  border-color: #01447e;
}
.fc-submit:hover,
.fc-submit:focus {
  background: #0056a3;
  border-color: #0056a3;
}
@media (max-width: 640px) {
  .fc-form {
    padding: 16px;
  }
  .fc-firms,
  .fc-row {
    grid-template-columns: 1fr;
  }
}

.fc-notice {
  font-size: 15px;
}
.fc-choices {
  margin: 0 0 24px 0;
  font-size: 15px;
}
.fc-choices ul {
  padding-left: 20px;
}
.fc-choices li {
  margin: 6px 0;
}
.fc-choice-detail {
  margin-left: 6px;
  color: #6c757d;
  font-size: 14px;
}

/* Results */
.fc-results {
  margin: 8px 0 32px 0;
}
.fc-summary {
  font-size: 17px;
  line-height: 1.6;
}
.fc-table th {
  width: 25%; /* four columns; style_profiles.css sets fee-table headers to thirds */
}
.fc-table th,
.fc-facts th {
  overflow-wrap: anywhere; /* long firm names in narrow columns */
}
.fc-table td,
.fc-table th[scope="row"] {
  vertical-align: top;
}
/* Row labels read like the first column of the profile's fee tables, not headers. */
.fc-table th[scope="row"],
.fc-facts th[scope="row"] {
  background: none;
  color: #212529;
  font-weight: 600;
  text-align: left;
  padding: 0.875rem 0.75rem;
  border-bottom: 1px solid #e9ecef;
}
.fc-rate {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  color: #6c757d;
}
.fc-na {
  font-size: 13px;
  font-weight: 400;
  color: #6c757d;
}
.fc-table td.fc-cheaper {
  background: #e6f4ea;
  color: #14532d;
}
.fc-table td.fc-cheaper .fc-rate {
  color: #276738;
}
.fc-custom th,
.fc-custom td {
  border-top: 2px solid #187aba;
  border-bottom: 2px solid #187aba;
}
.fc-tag {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: #187aba;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
@media (max-width: 480px) {
  .fc-table,
  .fc-facts {
    font-size: 13px;
  }
  .fc-table th,
  .fc-table td,
  .fc-facts th,
  .fc-facts td {
    padding-left: 5px;
    padding-right: 5px;
  }
}

.fc-subhead {
  margin-top: 32px;
}
.fc-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 900px) {
  .fc-columns {
    grid-template-columns: 1fr;
  }
}
.fc-column {
  min-width: 0; /* let the fee table shrink inside the grid */
}
.fc-firm {
  margin-top: 8px;
}
.fc-location {
  margin-top: -8px;
  font-size: 14px;
  color: #6c757d;
}
.fc-profiles {
  font-size: 15px;
}
.fc-caveat {
  margin-top: 16px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #4a607a;
  background: #f5f8fb;
  border-left: 4px solid #187aba;
  border-radius: 0 6px 6px 0;
}

/* Chart: lines are an SVG stretched to .fc-plot (non-scaling strokes); labels are
   HTML positioned in percent by build_fee_comparison_chart() in main.py. */
.fc-chart {
  margin: 24px 0 8px 0;
}
.fc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0 0 12px 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
  color: #212529;
}
.fc-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fc-swatch {
  display: inline-block;
  width: 28px;
  height: 0;
  border-top: 3px solid #01447e;
}
.fc-swatch-b {
  border-top: 3px dashed #c2410c;
}
.fc-plot {
  position: relative;
  height: 260px;
  margin: 22px 14px 0 48px; /* left: y labels; top: switch labels; right: last x label */
}
.fc-plot svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.fc-grid {
  stroke: #e9ecef;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.fc-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.fc-line-a {
  stroke: #01447e;
}
.fc-line-b {
  stroke: #c2410c;
  stroke-dasharray: 6 4;
}
.fc-switch {
  stroke: #6c757d;
  stroke-width: 1;
  stroke-dasharray: 2 3;
  vector-effect: non-scaling-stroke;
}
.fc-switch-label {
  position: absolute;
  top: -20px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 600;
  color: #495057;
  white-space: nowrap;
}
.fc-y {
  position: absolute;
  left: -48px;
  width: 42px;
  text-align: right;
  transform: translateY(50%);
  font-size: 12px;
  line-height: 1;
  color: #6c757d;
}
.fc-x {
  position: relative;
  height: 22px;
  margin: 0 14px 0 48px;
  border-top: 1px solid #adb5bd;
}
.fc-x-label {
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  font-size: 12px;
  color: #495057;
  white-space: nowrap;
}
.fc-chart figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #6c757d;
}
@media (max-width: 640px) {
  .fc-plot {
    height: 220px;
  }
  .fc-x-minor {
    display: none;
  }
}

/* Guide and methodology */
.fc-guide,
.fc-method {
  margin-top: 40px;
}
.fc-guide h3 {
  margin: 24px 0 8px 0;
  padding-bottom: 0;
  border-bottom: none;
  font-size: 19px;
}
.fc-guide p,
.fc-method p {
  font-size: 16px;
}
