/* ============================================================
 * Site-specific styles for Retirement Focus public pages.
 * 
 * This is plain CSS — edit freely, no build step required.
 * Loaded AFTER usi-bootstrap.min.css, so you can override
 * Bootstrap utilities or add custom layout/component styles.
 *
 * LAYOUT APPROACH: All page structure is handled here (not
 * Bootstrap grid classes). Bootstrap is used only for content
 * styling inside cards (buttons, forms, typography, spacing).
 * ============================================================ */

/* ============================================================
   Body & Viewport Centering
   ============================================================ */
body {
  background-image: url('../img/rf_background.avif');
  background-color: #072849;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
}

@media (min-width: 992px) {
  body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }
}

/* ============================================================
   Page Wrapper
   ============================================================ */
.page-wrapper {
  width: 100%;
  max-width: 1320px;
  padding: 2.5rem 1rem;
}

@media (min-width: 992px) {
  .page-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0 2.5rem;
    padding: 2.5rem 3rem;
  }
}

/* Form is a layout-neutral wrapper so ASP.NET's hidden-field divs stay out of
   the flex row; the inner .page-wrapper is the real layout. */
.page-form { display: contents; }

/* ============================================================
   Hero Column
   ============================================================ */
.page-hero {
  color: var(--bs-white);
}

.page-hero a:not(.btn) { color: var(--bs-white); text-decoration: none; }
.page-hero a:not(.btn):hover { text-decoration: underline; }

@media (max-width: 991.98px) {
  .page-hero {
    max-width: 34rem;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
  }
}

@media (min-width: 992px) {
  .page-hero {
    flex: 1 1 0;
    padding: 1rem 2rem;
  }
}

/* ============================================================
   Card Column & Content Card
   ============================================================ */
@media (min-width: 992px) {
  .page-card-col {
    flex: 1 1 0;
  }
}

.content-card {
  max-width: 34rem;
  margin: 0 auto;
  background: var(--bs-body-bg);
  padding: 2rem;
  border-radius: var(--bs-border-radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

@media (min-width: 992px) {
  .content-card { padding: 2.5rem; }
}

/* Card header bar: logo + logout link */
.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.card-header-bar .header-logo { height: 38px; }
@media (min-width: 576px) {
  .card-header-bar .header-logo { height: 42px; }
}

/* Card section headings */
.content-card h2 { font-size: 1.15rem; font-weight: 700; }

/* ============================================================
   Footer
   ============================================================ */
.rf-footer {
  width: 100%;
  color: var(--bs-white);
  padding: 1.5rem 0 0;
  text-align: center;
}
.rf-footer a { color: var(--bs-white); text-decoration: none; }
.rf-footer a:hover { text-decoration: underline; }
.rf-footer a + a::before {
  content: "|";
  color: rgba(var(--bs-white-rgb), 0.5);
  margin: 0 0.5rem;
  display: inline-block;
}

@media (min-width: 992px) {
  .rf-footer { text-align: left; padding-left: 2rem; }
}

@media (max-width: 991.98px) {
  .rf-footer > * {
    max-width: 34rem;
    margin-left: auto;
    margin-right: auto;
  }
}

/* On desktop (non-long-page), pull footer up alongside card bottom */
@media (min-width: 992px) {
  body:not(.long-page) .page-hero { margin-bottom: 5rem; }
  body:not(.long-page) .rf-footer { margin-top: -4rem; margin-right: 50%; }
}

/* ============================================================
   Page Title Typography
   ============================================================ */
.page-title {
  font-weight: 800;
  line-height: 1.1;
  font-size: 2rem;
  margin-bottom: 0.75rem;
}
@media (min-width: 992px) {
  .page-title { font-size: 2.5rem; }
}

.page-subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ============================================================
   Long-page Variant
   Stacks hero above card instead of side-by-side on desktop.
   Apply .long-page on <body> for pages with tall content cards.
   ============================================================ */
.long-page .page-hero { margin-bottom: 1rem; }

@media (min-width: 992px) {
  .long-page .page-wrapper {
    flex-direction: column;
    align-items: center;
  }
  .long-page .page-hero,
  .long-page .page-card-col {
    max-width: 34rem;
    width: 100%;
  }
  .long-page .page-hero {
    margin-bottom: 0;
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
  .long-page .rf-footer { text-align: center; padding-left: 0; }
}

/* ============================================================
   Login Page
   ============================================================ */

/* Login hero — richer variant of .page-hero */
.hero-heading {
  font-weight: 700;
  line-height: 1.05;
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
}
@media (min-width: 992px) {
  .hero-heading { font-size: clamp(2.25rem, 5vw, 3.75rem); }
}
.hero-heading .focus-word { color: var(--bs-accent); display: block; }

.hero-underline {
  display: inline-block;
  width: 64px;
  height: 4px;
  background: var(--bs-accent);
  border-radius: 2px;
  margin-bottom: 1.5rem;
}

.hero-tagline { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.5rem; }
.hero-body { line-height: 1.6; margin-bottom: 0; }
.hero-resources { margin-top: 2rem; }

/* Login card — extends .content-card with login-specific sizing */
.login-card {
  padding: 2.5rem 2rem;
}
@media (min-width: 992px) {
  .login-card { padding: 3rem; }
}

.login-card .brand-logo {
  display: block;
  max-width: 220px;
  height: auto;
  margin: 0.25rem auto 1.5rem;
}
@media (min-width: 992px) {
  .login-card .brand-logo {
    max-width: 280px;
    margin: 1rem auto 3rem;
  }
}

.login-card .form-label {
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Pill input group: input fills the whole pill, affordances overlaid so the
   browser autofill color spans the entire control (no input/chrome mismatch). */
.rf-input-group {
  position: relative;
  background: var(--bs-secondary-bg);
  border-radius: var(--bs-border-radius-pill);
  height: 3rem;
}
.rf-input-group > .rf-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.125rem;
  height: 1.125rem;
  color: var(--bs-secondary);
  pointer-events: none;
}
.rf-input-group .form-control {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: inherit;
  width: 100%;
  height: 100%;
  padding: 0 2.875rem;
}
.rf-input-group .form-control:focus { background: transparent; box-shadow: none; }
.rf-input-group .form-control::placeholder { color: rgba(var(--bs-secondary-rgb), 0.8); }
/* Repaint the browser's autofill background to match the gray pill. */
.rf-input-group .form-control:autofill {
  box-shadow: 0 0 0 1000px var(--bs-secondary-bg) inset;
  -webkit-text-fill-color: var(--bs-body-color);
  caret-color: var(--bs-body-color);
}
.rf-input-group:focus-within {
  outline: 2px solid rgba(var(--bs-primary-rgb), 0.35);
  outline-offset: 1px;
}

.eye-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  padding: 0.25rem;
  color: var(--bs-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
input[type="password"]::-ms-reveal { display: none; }
.eye-toggle .rf-icon { width: 1.25rem; height: 1.25rem; }
.eye-toggle[aria-pressed="true"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.08rem;
  height: 1.6rem;
  background: currentColor;
  border-radius: 0.1rem;
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-uppercase {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn-login {
  height: 3rem;
  padding: 0 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 0.75rem;
}
@media (min-width: 992px) {
  .btn-login { width: 50%; }
}

.forgot-link { text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

/* Resources CTA */
.btn-resources {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 32rem;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  font-size: 1rem;
}
.btn-resources .resources-label { flex: 1 1 auto; text-align: center; font-weight: 700; }
.btn-resources .rf-icon { width: 1.5rem; height: 1.5rem; color: var(--bs-white); flex: 0 0 auto; }
.btn-resources .chevron { width: 1rem; height: 1rem; }

@media (min-width: 992px) {
  .btn-resources { max-width: 22rem; }
}

/* ============================================================
   Shared Components
   ============================================================ */

/* RadioButtonList (ASP.NET WebForms pattern) */
ul.RadioButtonList {
  padding-left: 0;
  list-style: none;
}
ul.RadioButtonList > li {
  position: relative;
  display: block;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}
ul.RadioButtonList > li > input {
  position: absolute;
  margin-top: 0.3rem;
  margin-left: -1.25rem;
}
ul.RadioButtonList > li > label {
  line-height: 1.5;
  margin-bottom: 0;
}

/* MyPlansTable — list-group-style table */
.MyPlansTable,
.MyPlansTable > *,
.MyPlansTable tr,
.MyPlansTable tr > * {
  display: block;
  margin: 0;
  padding: 0;
}
.MyPlansTable { margin-bottom: 1rem; }
.MyPlansTable tr {
  position: relative;
  padding: 0.75rem 1.25rem;
}
.MyPlansTable tbody tr {
  border: 1px solid var(--bs-border-color-translucent);
  border-top-width: 0;
}
.MyPlansTable tbody tr:first-child {
  border-top-width: 1px;
  border-top-left-radius: 0.25rem;
  border-top-right-radius: 0.25rem;
}
.MyPlansTable tbody tr:last-child {
  border-bottom-left-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
}
.MyPlansTable tbody a { color: var(--bs-primary); }
.MyPlansTable tbody tr { transition: background-color 200ms; }
.MyPlansTable tbody tr:hover { background-color: rgba(var(--bs-success-rgb), 0.15); }
.MyPlansTable td:first-child { font-weight: bold; }
.MyPlansTable td:last-child {
  display: inline-block;
  position: relative;
  z-index: 2;
  cursor: text;
  padding: 0 0.25rem;
  margin: 0 -0.25rem;
}
.MyPlansTable tfoot td:last-child { font-weight: bold; }

@media (min-width: 768px) {
  .MyPlansTable tr {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }
  .MyPlansTable td:first-child { margin-right: 1.25rem; }
  .MyPlansTable td:last-child { white-space: nowrap; }
}

/* (Footer styles are in the Page Layout section above) */

/* Input-group buttons: suppress focus ring for cleaner look */
.input-group .btn-outline-secondary { box-shadow: none; }

/* ============================================================
   intl-tel-input
   ============================================================ */

/* Ensure intl-tel-input wrappers flex like form controls in Bootstrap input-groups */
.input-group > .iti {
  flex: 1 1 auto;
  width: 1%;
  min-width: 0;
}

/* Flag sprite: CDN CSS sets background-position but not background-image;
   this override supplies the image URL so flags render correctly.
*/
.iti__flag {
  background-image: url("//cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.2/img/flags.png");
}
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .iti__flag {
    background-image: url("//cdnjs.cloudflare.com/ajax/libs/intl-tel-input/16.0.2/img/flags@2x.png");
  }
}
