/* ==========================================================================
   GFR Finance — page specific layouts
   ========================================================================== */

/* -------------------------------------------------------- Product detail -- */

.productlayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
.productlayout__main h2 { margin-top: 2.6rem; }
.productlayout__main h2:first-child { margin-top: 0; }

/* ------------------------------------------------------------ Simulator --- */

.simlayout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.shell.simlayout {
  padding-left: 15px;
  padding-right: 15px;
  box-sizing: border-box;
}
.simform {
  padding: 1.8rem;
  background: var(--paper);
  border: 1px solid var(--line);
  position: sticky;
  top: 110px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.simform h2 { font-size: 1.25rem; margin-bottom: 1.4rem; }
.simform .field { min-width: 0; }
.simform label {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.simform input,
.simform select,
.simform .btn,
.simform .slider {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.simresult {
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.statgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  margin-bottom: 2rem;
  background: var(--line);
  border: 1px solid var(--line);
}
.statgrid--4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-top: 2rem; }
.stat {
  padding: 1.3rem 1.2rem;
  background: var(--white);
  min-width: 0;
}
.stat span {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.6rem);
  font-weight: 500;
  color: var(--navy-800);
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.stat--accent { background: var(--navy-800); }
.stat--accent span { color: var(--gold-400); }
.stat--accent strong { color: #fff; }

.eligbox {
  padding: 1.6rem;
  margin-bottom: 2rem;
  background: var(--paper);
  border: 1px solid var(--line);
  min-width: 0;
  box-sizing: border-box;
}
.eligbox__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.eligbox__head h3 { margin: 0; font-size: 1.1rem; }
.eligbox__score {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--navy-800);
}
.gauge {
  height: 6px;
  margin-bottom: 1rem;
  background: var(--line);
  overflow: hidden;
}
.gauge span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold-500);
  transition: width 0.8s var(--ease), background 0.4s var(--ease);
}
.gauge span.is-high { background: var(--ok); }
.gauge span.is-low { background: var(--bad); }
.eligbox__facts { list-style: none; margin: 1.2rem 0; padding: 0; }
.eligbox__facts li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.87rem;
}
.eligbox__facts span { color: var(--muted); min-width: 0; }
.eligbox__facts strong {
  color: var(--ink);
  text-align: right;
  overflow-wrap: anywhere;
}

.scheduleblock { min-width: 0; max-width: 100%; }
.scheduleblock__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.scheduleblock__head h3 { margin: 0; }
.scheduleblock__tools { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.scheduleblock .note { margin-bottom: 1rem; }
.scheduleblock .tablewrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.scheduleblock .datatable {
  min-width: 520px;
  width: 100%;
}

.amortform {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0 1.2rem;
  align-items: end;
  padding: 1.5rem 1.6rem;
  margin-bottom: 2rem;
  background: var(--paper);
  border: 1px solid var(--line);
}
.amortform .field--action { margin-bottom: 1.1rem; }

/* ---------------------------------------------------------- Application --- */

.wizardbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 0 2.4rem;
  padding: 0;
  list-style: none;
  background: var(--line);
  border: 1px solid var(--line);
}
.wizardbar li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0;
  padding: 1.1rem 1.2rem;
  background: var(--white);
  transition: background 0.3s var(--ease);
}
.wizardbar li.is-active { background: var(--navy-800); }
.wizardbar__num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--navy-800);
}
.wizardbar li.is-active .wizardbar__num {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: #fff;
}
.wizardbar__label strong {
  display: block;
  font-size: 0.92rem;
  color: var(--navy-800);
}
.wizardbar__label em {
  font-style: normal;
  font-size: 0.76rem;
  color: var(--muted);
}
.wizardbar li.is-active .wizardbar__label strong { color: #fff; }
.wizardbar li.is-active .wizardbar__label em { color: rgba(255, 255, 255, 0.6); }

.applylayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(2rem, 4vw, 3.2rem);
  align-items: start;
}
.applyform {
  padding: clamp(1.5rem, 3vw, 2.4rem);
  background: var(--white);
  border: 1px solid var(--line);
}
.formstep { display: none; }
.formstep.is-active { display: block; }
.formstep__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: space-between;
  margin-top: 2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.successpanel {
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(2rem, 4vw, 3.2rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ok);
  text-align: left;
}
.successpanel__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 0 1.2rem;
  border-radius: 50%;
  background: #e6f2ec;
  color: var(--ok);
  font-size: 1.4rem;
}
.successpanel__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  margin: 1.8rem 0 0.6rem;
  background: var(--line);
  border: 1px solid var(--line);
}
.successpanel__facts > div { padding: 1rem 1.1rem; background: var(--paper); }
.successpanel__facts dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.successpanel__facts dd { margin: 0; font-size: 1rem; font-weight: 600; color: var(--navy-800); }
.successpanel h3 { margin-top: 2rem; font-size: 1.15rem; }

/* --------------------------------------------------------- Form layouts --- */

.formlayout {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
.formlayout__image { margin: 1.6rem 0; }
.formlayout__form {
  padding: clamp(1.5rem, 3vw, 2.3rem);
  background: var(--white);
  border: 1px solid var(--line);
}
.panelform .field:last-of-type { margin-bottom: 0; }

.contactcard {
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.2rem;
  background: var(--white);
  border: 1px solid var(--line);
}
.contactcard h3 {
  margin-bottom: 0.6rem;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.contactcard p { font-size: 0.94rem; margin-bottom: 0.5rem; }
.contactcard--dark { background: var(--navy-800); color: rgba(255, 255, 255, 0.78); border-color: var(--navy-800); }
.contactcard--dark h3 { color: var(--gold-400); }

/* ---------------------------------------------------------------- FAQ ----- */

.faqlayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(2rem, 4vw, 3.2rem);
  align-items: start;
}
.faqteaser {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}

/* ------------------------------------------------------------ Error page -- */

.errorpage { padding: clamp(4rem, 10vw, 8rem) 0; }
.errorpage__code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 8rem);
  line-height: 1;
  color: var(--paper-2);
  margin: 0 0 1rem;
}

/* ------------------------------------------------------------ Responsive -- */

@media (max-width: 1024px) {
  .productlayout, .simlayout, .applylayout, .formlayout, .faqlayout, .faqteaser {
    grid-template-columns: 1fr;
  }
  .simform, .sidecard--sticky { position: static; }
  .wizardbar { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .shell.simlayout {
    width: 100%;
    max-width: 100%;
  }
  .simlayout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.35rem;
  }
  .simform {
    position: static;
    width: 100%;
    max-width: 100%;
    padding: 1.2rem 1.1rem;
    overflow: visible;
  }
  .simform .field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .simform .field {
    margin-bottom: 1rem;
  }
  .simform label {
    font-size: 0.88rem;
    line-height: 1.35;
  }
  .simform input[type="number"],
  .simform input[type="range"],
  .simform select,
  .simform .btn {
    width: 100%;
    max-width: 100%;
  }
  .simform .field__hint {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.72rem;
  }
  .simform .field__hint span {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .simresult { width: 100%; }
  .statgrid,
  .statgrid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat { padding: 1rem 0.85rem; }
  .stat span {
    font-size: 0.64rem;
    letter-spacing: 0.06em;
  }
  .stat strong { font-size: 1.15rem; }
  .eligbox { padding: 1.15rem; }
  .eligbox__facts li {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .eligbox__facts strong { text-align: left; }
  .scheduleblock .datatable {
    min-width: 480px;
    font-size: 0.82rem;
  }
  .scheduleblock .datatable th,
  .scheduleblock .datatable td {
    padding: 0.55rem 0.45rem;
  }
}

@media (max-width: 720px) {
  .section:has(.simlayout) {
    padding-block: 1.6rem 2.4rem;
  }
  .statgrid,
  .statgrid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .successpanel { padding: 1.4rem; }
  .successpanel__facts { grid-template-columns: 1fr; }
  .amortform { grid-template-columns: 1fr; }
  .formstep__nav { flex-direction: column-reverse; }
  .formstep__nav .btn { width: 100%; }
  .applyform {
    padding: 1.15rem;
    overflow: hidden;
  }
  .applyform fieldset { padding: 0; min-width: 0; }
  .applyform .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .applyside { order: -1; }
  .sidecard__big {
    font-size: clamp(1.5rem, 7vw, 2rem);
    word-break: break-word;
  }
  .simform {
    padding: 1rem 0.95rem;
    border-radius: 0;
  }
  .simform h2 {
    font-size: 1.12rem;
    margin-bottom: 1.1rem;
  }
  .scheduleblock__head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .scheduleblock__tools {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .scheduleblock__tools .btn {
    width: 100%;
    justify-content: center;
  }
  .eligbox .btn { width: 100%; }
  .productspecs { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .simlayout { gap: 1.1rem; }
  .statgrid,
  .statgrid--4 { grid-template-columns: minmax(0, 1fr); }
  .stat { padding: 0.95rem 0.9rem; }
  .stat strong { font-size: 1.25rem; }
  .simform h2 { font-size: 1.08rem; }
  .scheduleblock__tools { grid-template-columns: 1fr; }
  .scheduleblock .datatable { min-width: 440px; }
}
