/*
 * Public pages: sticky page headers, a quieter About header, and one type scale for
 * the footer. Loaded last on public pages, after compact.css and public-polish.css,
 * whose footer rules (several with !important) this settles.
 */

/* --- 1. Headers stay in view -------------------------------------------------
   The homepage's bar already stays at the top; the About, Contact and Ready
   Reckoner pages scrolled theirs away, and with it the only way back home. */
.about-page-header,
.contact-page-header,
.reckoner-header,
.legal-header {
  position: sticky !important;
  top: 0;
  z-index: 60;
  background: var(--white, #fff);
  box-shadow: 0 2px 10px rgba(26, 45, 90, .06);
}

/* --- 2. Inner page headers: the logo and the way back ------------------------
   About, Contact, Ready Reckoner and the policy pages each added their own mix of
   Contact Us / Contact Helpdesk / Register as Member beside "← Back to Home". They
   crowded the header, wrapped it onto two rows on a phone, and repeated what the
   homepage menu, the footer and the phone's bottom bar already offer. Every header
   button but the way home (goHomeFrom…) is hidden — hidden, not removed — so a
   page added later with the same kind of header follows the same rule. */
.about-page-header button:not([onclick^="goHome"]),
.contact-page-header button:not([onclick^="goHome"]),
.reckoner-header button:not([onclick^="goHome"]),
.legal-header button:not([onclick^="goHome"]) {
  display: none !important;
}

/* --- Ready Reckoner: one way to choose, not two ------------------------------
   Its left menu (EMI Calculator, then the seven manuals) repeated, link for link,
   the EMI Calculator / Manuals tabs and the manual buttons at the top of the page,
   and on a phone stacked the whole list above the calculator. Hidden, not removed,
   and the page takes the full width; the tabs and buttons do the same work. */
.reckoner-page .reckoner-nav {
  display: none !important;
}

.reckoner-page .reckoner-body {
  display: block !important;
  grid-template-columns: none !important;
  max-width: 1100px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.reckoner-page .reckoner-main {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* EMI calculator on a phone: Loan Amount across the top, Interest Rate and Tenure
   side by side beneath it. Both labels get two lines' room, so the two boxes sit
   level even though "Interest Rate (% per month)" wraps and "Tenure (months)" does not. */
@media (max-width: 768px) {
  .reckoner-page .reckoner-calc-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 10px !important;
    align-items: start;
  }

  .reckoner-page .reckoner-calc-grid > .form-group {
    margin: 0 !important;
    min-width: 0;
  }

  .reckoner-page .reckoner-calc-grid > .form-group:first-child {
    grid-column: 1 / -1;
  }

  .reckoner-page .reckoner-calc-grid > .form-group:not(:first-child) > label {
    display: flex;
    align-items: flex-end;
    min-height: 2.7em;
    line-height: 1.3;
  }

  .reckoner-page .reckoner-calc-grid input {
    width: 100%;
    min-width: 0;
  }
}

/* The EMI calculator's tenure: the longest term under the box, and a warning past it
   (site-content.js). */
.reckoner-tenure-hint {
  display: block;
  margin-top: .35rem;
  font-size: 12.5px;
  line-height: 1.45;
  color: #6b7689;
}

.reckoner-tenure-hint--warn {
  color: #b02a2a;
  font-weight: 600;
}

.reckoner-page input.reckoner-input--warn {
  border-color: #d64545 !important;
  box-shadow: 0 0 0 3px rgba(214, 69, 69, .15) !important;
}

/* The loan types beside the EMI Calculator heading (site-content.js): picking one puts
   its rate in, which is then shown, not typed. */
.reckoner-calc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .6rem 1.25rem;
  margin-bottom: .85rem;
}

.reckoner-calc-head .reckoner-panel__title {
  margin: 0 !important;
}

.reckoner-types {
  display: grid;
  grid-template-columns: repeat(var(--reckoner-types, 3), minmax(0, 1fr));
  gap: .3rem;
  flex: 1 1 420px;
  max-width: 640px;
  padding: .25rem;
  border-radius: 12px;
  background: var(--bg, #eef2f9);
}

.reckoner-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  min-width: 0;
  min-height: 46px;
  padding: .35rem .5rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted, #64748b);
  font-family: inherit;
  text-align: center;
  cursor: pointer;
}

.reckoner-type:hover {
  color: var(--primary, #1a2d5a);
  background: rgba(26, 45, 90, .04);
}

.reckoner-type.is-on {
  color: var(--primary, #1a2d5a);
  background: #fff;
  border-color: rgba(42, 79, 138, .28);
  box-shadow: 0 0 0 2px rgba(42, 79, 138, .08);
}

.reckoner-type:focus-visible {
  outline: 2px solid #2f6fbf;
  outline-offset: 2px;
}

.reckoner-type__name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
}

.reckoner-type__rate {
  font-size: 11.5px;
  font-weight: 600;
  color: #17693a;
}

.reckoner-page input.reckoner-input--locked {
  background: #f4f6fa !important;
  color: #334155;
  cursor: default;
}

@media (max-width: 768px) {
  .reckoner-types {
    flex-basis: 100%;
    max-width: none;
  }

  .reckoner-type {
    padding: .35rem .3rem;
  }

  .reckoner-type__name {
    font-size: 12.5px;
  }
}

/* --- 3 and 4. Footer: one type scale, less height ----------------------------
   It mixed 11, 12, 13, 14 and 16px, with some contact values bold and others
   not. Now: the name 16px, section headings 12.5px capitals, everything a person
   reads 13.5px, labels 11px capitals, the copyright line 12px. */
.public-footer {
  font-family: inherit;
}

.public-footer .footer-brand-name,
.public-footer .footer-brand-name > strong {
  font-size: 16px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

.public-footer .footer-brand-text p:not(.footer-brand-name),
.public-footer.public-footer--landing .footer-brand-text .footer-brand-tagline,
.public-footer .footer-link-list a,
.public-footer .footer-contact-line,
.public-footer .footer-contact-line a {
  font-size: 13.5px !important;
  line-height: 1.5 !important;
  font-weight: 400 !important;
  letter-spacing: normal !important;
}

.public-footer .footer-contact-line a {
  font-weight: 500 !important;
}

.public-footer h4 {
  font-size: 12.5px !important;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
  line-height: 1.3 !important;
}

.public-footer .footer-contact-line > strong {
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .04em !important;
}

.public-footer .footer-bottom p,
.public-footer .footer-bottom-links a {
  font-size: 12px !important;
  line-height: 1.5 !important;
}

.public-footer .footer-brand-actions .btn {
  font-size: 13px !important;
}

/* Link rows: tall enough to tap (28px clears the 24px WCAG 2.2 target), no
   taller. They were 36-49px each, which made the two short lists the longest
   part of the footer. */
.public-footer .footer-link-list li {
  margin: 0 !important;
}

.public-footer .footer-link-list a {
  min-height: 28px !important;
  padding-top: .1rem !important;
  padding-bottom: .1rem !important;
  display: inline-flex !important;
  align-items: center !important;
}

.public-footer .footer-contact-line a,
.public-footer .footer-bottom-links a {
  min-height: 0 !important;
  padding-top: .1rem !important;
  padding-bottom: .1rem !important;
  display: inline !important;
}

@media (max-width: 768px) {
  /* The two lists side by side, each as tight as the other: the policies no longer
     sit above a gap while the quick links run on. */
  .public-footer .footer-links-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    column-gap: 1rem !important;
    row-gap: 0 !important;
    align-items: start !important;
  }

  .public-footer .footer-links-row > .footer-col {
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0;
  }

  .public-footer .footer-link-list a {
    font-size: 13px !important;
  }

  .public-footer .footer-col h4,
  .public-footer .footer-contact h4 {
    margin-bottom: .35rem !important;
  }

  /* --- Phone footer, tidied ---------------------------------------------------
     It read as several layouts at once: link bullets indented away from their
     headings (and floating between the lines of a wrapped link), the section
     underline sitting under a pin emoji instead of the heading, three identical
     building emojis beside the contact labels with each value indented beneath,
     two buttons of different widths, and a copyright line wrapping ragged. */

  /* The two buttons side by side, the same width, with room before the links. */
  .public-footer .footer-brand-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: .5rem !important;
    margin-bottom: 1rem !important;
  }

  .public-footer .footer-brand-actions .btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding-left: .5rem !important;
    padding-right: .5rem !important;
    white-space: nowrap;
  }

  /* Headings: the words, and their underline beneath them. */
  .public-footer .footer-contact-icon--heading {
    display: none !important;
  }

  .public-footer h4 {
    display: block !important;
    padding-bottom: .45rem !important;
    margin-bottom: .55rem !important;
  }

  /* Links flush with their heading; a wrapped link keeps its bullet on line one. */
  .public-footer .footer-link-list {
    margin: 0 !important;
    padding-left: 0 !important;
  }

  .public-footer .footer-link-list a {
    align-items: flex-start !important;
  }

  .public-footer .footer-link-list a::before {
    margin-top: .6em;
  }

  /* Contact details as label | value rows, without the emoji. */
  .public-footer .footer-contact .footer-contact-line {
    display: grid !important;
    grid-template-columns: minmax(6.5rem, 34%) 1fr;
    column-gap: .75rem;
    align-items: baseline;
    margin: 0 !important;
    padding: .5rem 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }

  .public-footer .footer-contact .footer-contact-line:last-child {
    border-bottom: 0;
  }

  .public-footer .footer-contact .footer-contact-line > strong {
    display: block !important;
    margin: 0 !important;
    font-size: 10.5px !important;
    color: rgba(255, 255, 255, .68) !important;
  }

  .public-footer .footer-contact .footer-contact-line > strong > .footer-contact-icon {
    display: none !important;
  }

  .public-footer .footer-contact .footer-contact-line a {
    word-break: break-word;
  }

  /* The copyright and its links, centred under everything else. */
  .public-footer .footer-bottom {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
    gap: .35rem !important;
  }

  .public-footer .footer-bottom-links {
    justify-content: center;
    gap: 1.2rem !important;
  }
}
