/* 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; }

body {
  margin: 0;
  font-family: 'Optimist', 'Segoe UI', Arial, sans-serif;
  background: #fafbfc;
  color: var(--qk-ink);
  -webkit-text-size-adjust: 100%;
}

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: 13px 16px;
  font-size: 0.98em;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  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.65em;
  line-height: 1.25;
  text-align: center;
  margin: 0 0 18px;
  font-weight: 700;
}

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

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

#annual-fee-offer-box {
  position: relative;
  background: #edf9f0;
  border: 2px solid #43a047;
  border-radius: 9px;
  color: #14682c;
  font-weight: 600;
  padding: 14px 44px 14px 16px;
  margin: 0 0 18px;
}

#annual-fee-offer-box .save { color: #127a30; }

#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; }

.lh-input-label {
  display: block;
  font-size: 0.95em;
  font-weight: 600;
  margin-bottom: 5px;
  color: #33404d;
}

.lh-input-label .optional { font-weight: 400; color: #66727e; }

.lh-input {
  width: 100%;
  font: inherit;
  font-size: 1em;
  padding: 11px 12px;
  border: 1.5px solid var(--qk-line-strong);
  border-radius: 7px;
  background: #fbfcfd;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.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-top: 5px;
}

#form-error-list {
  display: none;
  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 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;
}

#member-question {
  display: block;
  font-weight: 600;
  color: var(--qk-blue);
  margin-bottom: 9px;
}

.member-choices { display: flex; gap: 26px; }

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

.member-choices input[type='radio'] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--qk-blue);
  flex: none;
}

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

/* ---------- 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 {
  margin: 0 0 12px;
  font-size: 1.75em;
  color: var(--qk-blue);
}

#amex-offer .offer-lead { font-weight: 800; font-size: 1.12em; margin: 0 0 9px; }

#amex-offer .offer-points { color: #0055cc; }

#amex-offer .offer-fine {
  margin: 0 0 18px;
  font-size: 0.86em;
  color: #4a5a6b;
  font-style: italic;
}

#amex-offer .offer-scroll {
  text-align: center;
  font-size: 1.2em;
  color: #004066;
  margin: 26px 0;
}

#amex-offer h3 { color: #002663; margin: 24px 0 8px; font-size: 1.12em; }

#amex-offer .offer-list { margin: 0 0 8px; padding-left: 22px; }

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

#amex-offer .offer-strike { color: #c92f2f; font-weight: 600; }

#amex-offer .offer-free {
  color: #195f1f;
  font-size: 1.15em;
  margin-left: 6px;
}

/* ---------- 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.45em; font-weight: 700; color: var(--qk-blue-dark); }

#eligible-label { font-size: 1.8em; font-weight: 700; color: #1c7c33; margin-top: 22px; }

#redirect-label { margin-top: 12px; color: var(--qk-blue-dark); }

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

footer {
  background: #f5f7f9;
  border-top: 1px solid var(--qk-line);
  padding: 30px 4vw 34px;
  font-size: 0.9em;
  line-height: 1.55;
  color: #4a5560;
  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; }

  .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; }
}
