/* Core site styles (reverted to pre-full-width-bg state) */
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Make the whole site background the light-blue color */
body, body.fixed-layout {
  background-color: #e3f2fd;
}

/* Ensure page container doesn't also render a blue box (we want only the site background blue)
   and keep the inner form sections as white cards */
.page-container {
  background-color: transparent !important;
  min-height: auto !important;
  padding: 0 !important; /* top spacing handled by main padding */
  border-radius: 0 !important;
}

/* Request page previously had its own padding; replicate minimal horizontal breathing */
.page-container > form { margin-top: 0; }
.page-container .form-section h5, .page-container .form-section h6 { margin-top: 0; margin-bottom: var(--gap-heading-small); }

/* Unified spacing scale */
:root {
  --space-0: 0;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --gap-stack: var(--space-3);
  --gap-heading: var(--space-3);
  --gap-heading-small: var(--space-2);
  --gap-hr: var(--space-3);
  --pad-panel: var(--space-4);
  --gap-columns: var(--space-3);
  /* Distinct header -> content spacing (slightly larger than stack) */
  --gap-header: var(--space-4);
}

.form-section {
  background-color: #ffffff !important;
  padding: var(--pad-panel);
  border-radius: 8px;
  margin-bottom: var(--gap-stack);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.form-section dl {
  margin-bottom: 0;
}

/* Remove extra space contributed by the last dd in the dl */
.form-section dl.row > dd:last-of-type {
  margin-bottom: 0;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Brand-colored submit button shared across pages */
.btn-submit {
  background-color: #175bc2; /* brand color */
  border-color: #144a9a;
  color: #ffffff;
}
.btn-submit:hover, .btn-submit:focus {
  background-color: #144a9a;
  border-color: #0f3976;
  color: #ffffff;
}

/* container-fluid left padding to align logo */
.container-fluid {
  padding-left: 0; /* ensure logo aligns with left edge */
}

.site-logo {
  height: 96px; /* larger logo */
  margin-right: 16px;
  margin-left: 12px; /* add left spacing so logo isn't flush to the window edge */
  display: block;
}

@media (max-width: 576px) {
  .site-logo { height: 56px; margin-left: 8px; }
}

/* Header (navbar) + content gap handled solely by navbar bottom margin */
.navbar {
  border-bottom: 1px solid #003265;
  box-shadow: none;
  margin-bottom: 0; /* fixed element margins don't create flow space */
}

/* Head Gap */
main, .content, .page-content { padding-top: var(--gap-header); }

/* Fixed layout adjustments (reduce footer height by 25%) */
body.fixed-layout {
  padding-top: 120px; 
  padding-bottom: 75px; /
}

.navbar.fixed-top {
  background-color: #003265 !important; /* brand color */
  z-index: 1030;
  background-image: none !important;
  box-shadow: none !important;
}

.navbar.fixed-top .navbar-brand, .navbar.fixed-top .navbar-nav .nav-link {
  color: #ffffff !important;
}

/* Ensure fixed footer is positioned and visible above content */
.footer.fixed-bottom {
  position: fixed !important;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 50px; /* explicit footer height (25% smaller than previous implicit size) */
  z-index: 1040; /* above main content but below modal dialogs */
  background-color: #003265; /* brand color */
  color: #ffffff;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.footer.fixed-bottom a { color: #ffffff; }

/* Center footer content and vertically center inside the fixed height */
.footer.fixed-bottom .container {
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center; /* vertical centering */
  padding: 0; 
  height: 100%; 
  line-height: normal; 
}

.full-width-bg {
  margin-top: 0;
}

/* Apply same gap inside wrapped container */
.full-width-bg .container { padding-top: 0; }
main .panel-row.g-4:first-of-type { --bs-gutter-y: 0; }
main .panel-row.g-4:first-of-type > [class^="col-"] { margin-top: 0 !important; }
/* Custom horizontal gutter = 1.25rem (matches panel gap) */
.gx-custom { --bs-gutter-x: var(--gap-columns); }
/* Ensure no vertical gutter when gy-0 not supplied (safety) */
main .panel-row.gx-custom:first-of-type { --bs-gutter-y: 0; }

/* Highly specific override: force footer text and links to white even if Bootstrap's text-muted is present */
footer.footer.text-muted.fixed-bottom,
footer.footer.text-muted.fixed-bottom * {
  color: #ffffff !important;
}

footer.footer.text-muted.fixed-bottom a,
footer.footer.text-muted.fixed-bottom a:link,
footer.footer.text-muted.fixed-bottom a:visited {
  color: #ffffff !important;
  opacity: 1 !important;
}

/* Subtle ReturnCode badge in footer */
.rc-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.25);
}
.rc-badge.rc-badge--ok {
  background: rgba(40,167,69,0.25); /* success tint */
  border-color: rgba(40,167,69,0.4);
}

/* Header title styling */
.navbar .header-title {
  color: #003265;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 auto; /* center within available navbar space */
  text-align: center;
}

/* Hide page-level Mortgagee Verification title */
.page-container h2.mb-4 {
  display: none !important;
}

/* Shrink all buttons by 25% for a slightly more compact UI.
   This adjusts font-size and padding rather than using transform so
   layout/click targets remain predictable. */
.btn {
  font-size: 0.75rem; /* 75% of 1rem */
  padding: 0.28125rem 0.5625rem; /* 75% of .375rem/.75rem */
}

.btn-lg {
  font-size: 0.9375rem; /* 75% of 1.25rem */
  padding: 0.375rem 0.75rem; /* 75% of .5rem/1rem */
}

/* Payment info panel styles */
.payment-info { 
  margin-top: 0;
  border-radius: 8px; 
  background-color: #ffffff; 
  padding: var(--pad-panel);
  margin-bottom: var(--gap-stack);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.payment-info h4, .payment-info h5 { margin-bottom: var(--gap-heading-small); font-weight: 600; }
.payment-info .section-title { font-weight: 700; margin-bottom: var(--space-1); }
.payment-info .col-title { font-weight: 700; }
.payment-info .row + .row { margin-top: .5rem; }
.payment-info .addr-block { white-space: pre-line; }

/* Uniform spacing for definition list rows even when value is blank */
/* Insert a non-breaking space so empty dd still consumes line height */
.form-section dl.row > dd:empty::before {
  content: '\00a0';
}
/* Optional: small vertical padding to make each pair consistent */
.form-section dl.row > dt,
.form-section dl.row > dd {
  padding-top: 2px;
  padding-bottom: 2px;
}

/* Consistent spacing between panel-row and following content */
.panel-row { margin-bottom: var(--gap-stack); }
.panel-block { margin-bottom: 0; }
.payment-info.panel-block { margin-bottom: var(--gap-stack); }

/* Normalize heading + hr spacing inside panels */
.form-section h2, .payment-info h2 { margin-top: 0; margin-bottom: var(--gap-heading); font-weight: 600; }
.form-section h5, .form-section h6 { margin-top: 0; margin-bottom: var(--gap-heading-small); }
.form-section hr, .payment-info hr { margin-top: 0; margin-bottom: var(--gap-hr); }

/* Definition list compact alignment (already handled for empty values) */
.form-section dl.row, .payment-info dl.row { margin-bottom: 0; }
@media (min-width: 992px) {
  /* On large screens ensure equal height start alignment */
  .panel-row > [class^="col-"] { display: flex; }
  .panel-row .panel-block { flex: 1 1 auto; }
}

