/* custom.css — layout, form styling, offer block, responsive rules.
   Single source of truth; overrides the vendor stylesheet where needed. */

:root {
  --qk-blue: #005598;
  --qk-blue-dark: #193984;
  --qk-ink: #1a2631;
  --qk-line: #e5e8ec;
  --qk-line-strong: #bbc7db;
  --qk-error: #c0231f;
  --qk-radius: 10px;
}

*,
*::before,
*::after { box-sizing: border-box; }

/* ---------- Typeface ----------
   The vendor stylesheet declares Optimist with .eot/.woff/.ttf sources we do not
   ship, and a 900 face with no file at all, so 900-weight text was 404ing and
   falling back. Re-declare the family woff2-only off the three weights we have;
   later declarations win, so 400/600/700/900 all resolve to a real file. */

@font-face {
  font-family: 'Optimist';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/static/fonts/Optimist_W_Lt.woff2') format('woff2');
}

@font-face {
  font-family: 'Optimist';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/Optimist_W_Rg.woff2') format('woff2');
}

@font-face {
  font-family: 'Optimist';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/Optimist_W_Rg.woff2') format('woff2');
}

@font-face {
  font-family: 'Optimist';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/Optimist_W_SBd.woff2') format('woff2');
}

@font-face {
  font-family: 'Optimist';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/Optimist_W_SBd.woff2') format('woff2');
}

@font-face {
  font-family: 'Optimist';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/static/fonts/Optimist_W_SBd.woff2') format('woff2');
}

@font-face {
  font-family: 'Optimist';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/static/fonts/Optimist_W_SBd.woff2') format('woff2');
}

body {
  margin: 0;
  font-family: 'Optimist', 'Segoe UI', Arial, sans-serif;
  background: #fafbfc;
  color: var(--qk-ink);
  -webkit-text-size-adjust: 100%;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

[hidden] { display: none !important; }

/* ---------- Header ---------- */

#header-logo-bar {
  background: #fff;
  border-bottom: 1px solid var(--qk-line);
  box-shadow: 0 1px 10px rgb(229 229 233 / 20%);
  position: relative;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 2vw;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.header-inner img {
  width: 185px;
  height: auto;
  display: block;
}

#lang-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--qk-blue-dark);
  font-weight: 600;
  font-size: 0.95em;
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--qk-line);
  border-radius: 6px;
}

#lang-toggle:hover,
#lang-toggle:focus-visible {
  background: #f2f6fa;
  border-color: var(--qk-blue);
}

/* ---------- Cookie banner ---------- */

#cookie-banner {
  background: #f9f9fc;
  border-bottom: 1px solid var(--qk-line);
  padding: 11px 18px;
  font-size: 0.86em;
  line-height: 1.5;
  color: #4b5763;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

#cookie-banner a { color: var(--qk-blue-dark); }

#cookie-banner-close {
  background: transparent;
  border: 0;
  font-size: 1.4em;
  line-height: 1;
  cursor: pointer;
  color: #4a5560;
  padding: 0 4px;
}

#cookie-banner-close:hover { color: #000; }

/* ---------- Progress ----------
   The vendor stylesheet targets `.lh-steps-list-item :before` (descendant), so
   its counter also renders inside the label. Neutralise that and draw our own
   badge on the <li> with data-step. */

#progress-bar-wrap {
  background: #fff;
  border-bottom: 1px solid var(--qk-line);
  padding: 12px 16px;
}

#progress-bar-wrap .lh-steps-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  counter-reset: none;
}

#progress-bar-wrap .lh-steps-container::before { display: none; }

#progress-bar-wrap .lh-steps-container .lh-steps-list-item,
#progress-bar-wrap .lh-steps-container .lh-steps-list-item:first-child {
  font-size: 0.95em;
  color: #64707c;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  margin: 0;
  border-radius: 20px;
  background: transparent;
  counter-increment: none;
  flex: 0 1 auto;
}

#progress-bar-wrap .lh-steps-list-item > *::before,
#progress-bar-wrap .lh-steps-list-item .lh-step-text::before,
#progress-bar-wrap .lh-steps-list-item .lh-step-text::after {
  content: none;
  display: none;
  position: static;
}

#progress-bar-wrap .lh-steps-container .lh-steps-list-item::before {
  content: attr(data-step);
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  margin: 0;
  padding: 0;
  border: 1px solid #d5dce4;
  border-radius: 50%;
  background: #eef1f5;
  color: #55616d;
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1;
  flex: none;
}

#progress-bar-wrap .lh-steps-list-item.active {
  color: var(--qk-blue);
  font-weight: 700;
  background: #eef4fa;
}

#progress-bar-wrap .lh-steps-list-item.active::before {
  background: var(--qk-blue);
  border-color: var(--qk-blue);
  color: #fff;
}

#progress-bar-wrap .lh-steps-list-item.done::before {
  background: #1c803e;
  border-color: #1c803e;
  color: #fff;
}

#progress-bar-wrap .lh-steps-list-item.done { color: #2b6b41; }

/* ---------- Layout ---------- */

.multi-form {
  max-width: 720px;
  margin: 28px auto 40px;
  padding: 0 16px;
}

.qk-form-wizard {
  background: #fff;
  border: 1px solid var(--qk-line);
  border-radius: var(--qk-radius);
  padding: 26px 26px 22px;
  box-shadow: 0 2px 14px rgb(26 38 49 / 6%);
}

.qk-form-wizard .qk-form-wizard-section-image-container {
  width: 100%;
  margin: 0 0 20px;
  display: flex;
  justify-content: center;
}

.qk-form-wizard .qk-form-wizard-section-image {
  display: block;
  margin: 0 auto;
  max-width: 300px;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 6px 18px rgb(24 39 75 / 18%));
}

.section-header,
#main-header {
  font-size: 1.5em;
  line-height: 1.3;
  letter-spacing: -0.011em;
  font-weight: 600;
  text-align: center;
  margin: 0 0 20px;
  color: #12202c;
}

#main-header .accent { color: var(--qk-blue); font-weight: 600; }

/* Page 2 heading sits straight above the first section now that the
   introductory line is gone. */
.qk-form-wizard h1.section-header { margin-bottom: 16px; }

#main-header .accent { color: var(--qk-blue); }

/* ---------- Offer alert ---------- */

#annual-fee-offer-box {
  position: relative;
  background: #edf9f0;
  border: 1px solid #b9e3c4;
  border-left: 4px solid #2e9e4b;
  border-radius: 8px;
  color: #175f2c;
  font-size: 0.94em;
  line-height: 1.5;
  font-weight: 500;
  padding: 13px 42px 13px 15px;
  margin: 0 0 20px;
}

#annual-fee-offer-box .save { color: #0f6428; font-weight: 700; }

#annual-fee-offer-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: 0;
  font-size: 1.4em;
  line-height: 1;
  color: #2f7d3a;
  cursor: pointer;
  padding: 4px 8px;
}

#annual-fee-offer-close:hover { color: #14521f; }

/* ---------- Fields ---------- */

.single-row-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
}

.flex-item { flex: 1 1 190px; min-width: 0; }

/* Fields whose input carries a hint underneath stay top-aligned with the
   others so the inputs themselves sit on the same line. */
.single-row-fields { align-items: flex-start; }

.lh-input-label {
  display: block;
  font-size: 0.87em;
  font-weight: 600;
  letter-spacing: 0.012em;
  margin-bottom: 6px;
  color: #2f3d4a;
}

.lh-input-label .optional {
  font-weight: 400;
  letter-spacing: 0;
  color: #6d7885;
}

.lh-input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  padding: 12px 13px;
  margin: 0;
  border: 1px solid var(--qk-line-strong);
  border-radius: 7px;
  background: #fff;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

/* Native selects: reserve room for the arrow and draw our own, the vendor
   strips the default one. Placed after the base rule so it wins. */
select.lh-input {
  -webkit-appearance: none;
  appearance: none;
  height: 47px;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235d6b79' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

select.lh-input:invalid { color: #7d8894; }
select.lh-input option { color: var(--qk-ink); }

.lh-input::placeholder { color: #97a2ae; }

.lh-input:hover { border-color: #9eaec4; }

.lh-input:focus {
  outline: none;
  border-color: var(--qk-blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgb(0 85 152 / 14%);
}

.has-error .lh-input,
.lh-input[aria-invalid='true'] {
  border-color: var(--qk-error);
  background: #fff8f8;
}

.lh-input[aria-invalid='true']:focus {
  box-shadow: 0 0 0 3px rgb(192 35 31 / 14%);
}

.field-error {
  display: none;
  color: var(--qk-error);
  font-size: 0.87em;
  font-weight: 600;
  margin: 5px 0 0;
}

#form-error-list {
  background: #fdecec;
  border: 1px solid #f0b8b8;
  border-left: 4px solid var(--qk-error);
  border-radius: 7px;
  padding: 10px 14px;
  margin: 0 0 16px;
  color: #8d1a17;
  font-size: 0.95em;
}

#form-error-list:not([style*='display: block']) { display: none; }

#form-error-list strong { display: block; margin-bottom: 5px; }

/* ---------- Member question ---------- */

#amex-member-question {
  margin: 24px 0 14px;
  padding: 14px 16px;
  background: #f7f9fc;
  border: 1px solid var(--qk-line);
  border-radius: 8px;
}

/* The vendor stylesheet hides every radio with opacity:0 and expects its own
   .lh-option-item indicator, which this markup does not use. Draw the control
   ourselves. */
#member-question {
  display: block;
  float: left;
  width: 100%;
  font-size: 0.95em;
  font-weight: 600;
  color: #1f4b70;
  margin: 0 0 11px;
  padding: 0;
}

#amex-member-question .member-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  clear: both;
}

.member-choices label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
  padding: 4px 0;
}

#amex-member-question .member-choices input[type='radio'] {
  opacity: 1;
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  flex: none;
  border: 1.5px solid #93a0ad;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, border-width 0.1s;
}

#amex-member-question .member-choices input[type='radio']:hover {
  border-color: #5d7387;
}

#amex-member-question .member-choices input[type='radio']:checked {
  border: 6px solid var(--qk-blue);
}

#amex-member-question .member-choices input[type='radio']:focus-visible {
  outline: 3px solid rgb(0 85 152 / 22%);
  outline-offset: 2px;
}

#amex-member-question .member-choices input[type='radio'][aria-invalid='true'] {
  border-color: var(--qk-error);
}

#member-error {
  display: none;
  color: var(--qk-error);
  font-size: 0.87em;
  font-weight: 600;
  margin-top: 7px;
}

/* ---------- Step 2: application details ---------- */

.qk-section {
  margin: 0 0 8px;
  padding: 20px 0 0;
  border-top: 1px solid #eceff3;
}

.qk-section:first-of-type { border-top: 0; padding-top: 0; }

.qk-subhead {
  margin: 0 0 4px;
  font-size: 1.02em;
  font-weight: 600;
  color: #12324f;
}

.qk-help {
  margin: 0 0 14px;
  font-size: 0.87em;
  line-height: 1.5;
  color: #6a7683;
}

.qk-prefix {
  position: relative;
}

.qk-prefix .lh-input { padding-left: 26px; }

.qk-prefix::before {
  content: '$';
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #7d8894;
  font-size: 1em;
  pointer-events: none;
}

/* chip-style radio groups */
.qk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 4px;
}

.qk-chips label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--qk-line-strong);
  border-radius: 999px;
  background: #fff;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.qk-chips label:hover { border-color: #9eaec4; }

.qk-chips input[type='radio'] {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
  margin: 0;
}

.qk-chips label:has(input:checked) {
  border-color: var(--qk-blue);
  background: #eef4fa;
  color: #14486f;
  font-weight: 600;
}

.qk-chips label:has(input:focus-visible) {
  outline: 3px solid rgb(0 85 152 / 22%);
  outline-offset: 2px;
}

#employment-details[hidden] { display: none !important; }

.qk-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 22px 0 4px;
  padding: 14px 16px;
  background: #f7f9fc;
  border: 1px solid var(--qk-line);
  border-radius: 8px;
  font-size: 0.9em;
  line-height: 1.5;
  color: #45525e;
}

.qk-consent input[type='checkbox'] {
  opacity: 1;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  flex: none;
  accent-color: var(--qk-blue);
}

.qk-review-line {
  font-size: 0.9em;
  color: #5a6875;
  background: #f2f4f6;
  border-radius: 7px;
  padding: 11px 14px;
  margin: 0 0 18px;
}

/* ---------- Note and button ---------- */

.amex-eligibility-note {
  background: #f2f4f6;
  color: #294a63;
  border-radius: 7px;
  padding: 10px 14px;
  margin: 16px 0 18px;
  font-size: 0.95em;
}

.qk-form-button { display: flex; justify-content: center; }

.lh-button {
  font: inherit;
  font-size: 1.05em;
  font-weight: 700;
  color: #fff;
  background: var(--qk-blue);
  border: 2px solid var(--qk-blue);
  border-radius: 8px;
  padding: 13px 22px;
  min-width: 220px;
  max-width: 330px;
  width: 100%;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.lh-button:hover { background: var(--qk-blue-dark); border-color: var(--qk-blue-dark); }

.lh-button:focus-visible {
  outline: 3px solid #7fb2dd;
  outline-offset: 2px;
}

/* ---------- Offer block ---------- */

#amex-offer {
  background: #fff;
  border: 2px solid #d3dbe4;
  border-radius: var(--qk-radius);
  padding: 24px 22px;
  margin: 30px auto;
  max-width: 720px;
  font-size: 0.98em;
  line-height: 1.5;
}

#amex-offer .offer-title {
  letter-spacing: 0.045em;
  font-size: 1.4em;
  font-weight: 600;
  margin: 0 0 18px;
  color: #16456f;
}

#amex-offer .offer-lead {
  font-weight: 600;
  font-size: 1.02em;
  line-height: 1.5;
  margin: 0 0 10px;
  color: #16202b;
}

#amex-offer .offer-points { font-weight: 700; color: #0a5bb0; }

#amex-offer .offer-fine {
  font-size: 0.82em;
  font-style: normal;
  line-height: 1.5;
  color: #64717e;
  margin: 0 0 22px;
  padding-left: 12px;
  border-left: 2px solid #e2e8ee;
}

#amex-offer .offer-scroll {
  text-align: center;
  font-size: 0.8em;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  color: #5b6875;
  margin: 24px 0 8px;
}

#amex-offer h3 {
  font-size: 1.02em;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #12324f;
  margin: 26px 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid #eceff3;
}

#amex-offer .offer-list {
  margin: 0 0 10px;
  padding-left: 20px;
  font-size: 0.94em;
  line-height: 1.55;
  color: #38434f;
}

#amex-offer .offer-list li { margin-bottom: 5px; }

#amex-offer .offer-list li::marker { color: #a8b3bf; }

#amex-offer .offer-list b { font-weight: 600; color: #16202b; }

#amex-offer .offer-strike {
  color: #b8453f;
  font-weight: 500;
  text-decoration-thickness: 1px;
}

#amex-offer .offer-free {
  color: #17702d;
  font-size: 1.1em;
  font-weight: 700;
  margin-left: 5px;
}

/* ---------- Result block ---------- */

#result-block {
  max-width: 540px;
  margin: 56px auto;
  padding: 30px 20px 38px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--qk-line);
  border-radius: var(--qk-radius);
  box-shadow: 0 2px 14px rgb(26 38 49 / 6%);
}

.loading-img { display: block; margin: 0 auto 26px; width: 88px; height: 88px; }

#loading-label { font-size: 1.3em; font-weight: 600; color: #1d3f5e; }

#eligible-label {
  font-size: 1.55em;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #17702d;
  margin-top: 22px;
}

#redirect-label {
  margin-top: 10px;
  font-size: 0.95em;
  color: #5b6875;
}

/* ---------- Footer ---------- */

footer {
  background: #f5f7f9;
  border-top: 1px solid var(--qk-line);
  padding: 28px 4vw 32px;
  font-size: 0.82em;
  line-height: 1.6;
  color: #6a7683;
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

footer p { margin: 0 0 8px; }

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .single-row-fields { gap: 12px; }

  .flex-item { flex-basis: 140px; }

  #main-header { font-size: 1.3em; }

  .qk-form-wizard { padding: 18px 15px; border-radius: 0; border-left: 0; border-right: 0; }

  .multi-form { padding: 0; margin-top: 18px; }

  #amex-offer { padding: 16px 14px; margin: 20px 12px; font-size: 0.94em; }

  .lh-steps-list-item { padding: 4px 8px; font-size: 0.88em; }

  .header-inner { padding: 14px 12px; }

  .header-inner img { width: 140px; }

  #lang-toggle { padding: 6px 10px; font-size: 0.87em; }
}

@media (max-width: 430px) {
  .single-row-fields { flex-direction: column; gap: 12px; }

  /* flex-basis is a height once the row is a column — reset it. */
  .single-row-fields .flex-item { flex: 0 0 auto; }

  .lh-button { min-width: 0; }

  #main-header { font-size: 1.15em; }

  .qk-form-wizard .qk-form-wizard-section-image-container { display: none; }

  #progress-bar-wrap .lh-steps-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    align-items: center;
    width: 100%;
    max-width: none;
    justify-content: center;
  }

  #progress-bar-wrap .lh-steps-container .lh-steps-list-item {
    padding: 3px 6px;
    gap: 0;
    font-size: 0.85em;
    flex: 0 0 auto;
  }

  #progress-bar-wrap .lh-steps-container .lh-steps-list-item .lh-step-text {
    display: none;
  }

  #progress-bar-wrap .lh-steps-container .lh-steps-list-item.active {
    flex: 0 1 auto;
    min-width: 0;
  }

  #progress-bar-wrap .lh-steps-container .lh-steps-list-item.active .lh-step-text {
    display: block;
    margin-left: 7px;
    font-size: 0.95em;
    line-height: 1.15;
    white-space: normal;
  }

  #progress-bar-wrap .lh-steps-container .lh-steps-list-item::before {
    width: 22px;
    height: 22px;
    min-width: 22px;
    font-size: 0.8em;
  }

  #amex-offer { padding: 14px 12px; margin: 16px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  #form-error-list { scroll-behavior: auto; }
}
