/**
 * CG-Popup1 — Citigold apply popup
 * Scoped to .cg-popup / .cg-popup-apply / .cg-popup1-demo only
 * Does not modify base.css or other components
 */

/* ---- Demo page shell (for standalone preview) ---- */

.cg-popup1-demo {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  background-color: #f5f5f5;
}

.cg-popup1-demo__note {
  margin: 0 0 20px;
  text-align: center;
  font-family: var(--font-sans-text, "Helvetica Neue", Arial, sans-serif);
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}

/* ---- Apply Now trigger ---- */

.cg-popup-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  margin: 0 auto;
  padding: 14px 32px;
  border: 0;
  border-radius: 2px;
  background-color: #056dae;
  font-family: var(--font-sans-display, "Helvetica Neue", Arial, sans-serif);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
}

.cg-popup-apply:hover {
  opacity: 0.92;
}

.cg-popup-apply:focus-visible {
  outline: 2px solid #056dae;
  outline-offset: 3px;
}

/* ---- Popup shell ---- */

.cg-popup {
  --cg-gold: #bc9e5e;
  --cg-gold-dark: #a88a4e;
  --cg-gray: #5b5b5b;
  --cg-check: #2e8b57;
  --cg-text: #222;
  --cg-muted: #666;
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
}

.cg-popup[hidden] {
  display: none !important;
}

.cg-popup.is-open {
  display: flex;
}

.cg-popup__backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.55);
}

.cg-popup__dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(1440px, 100%);
  max-height: none;
  margin: 0 auto;
  padding: 24px 28px 20px;
  overflow: hidden;
  box-sizing: border-box;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  color: var(--cg-text);
  font-family: var(--font-sans-text, "Helvetica Neue", Arial, sans-serif);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cg-popup__dialog::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* ---- Close ---- */

.cg-popup__close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: #777;
  cursor: pointer;
}

.cg-popup__close:hover {
  color: #222;
}

.cg-popup__close:focus-visible {
  outline: 2px solid var(--cg-gold);
  outline-offset: 2px;
}

/* ---- Top actions ---- */

.cg-popup__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  text-align: center;
  margin: 4px 0 16px;
  padding-right: 20px;
}

.cg-popup__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 12px 28px;
  border: 0;
  font-family: var(--font-sans-display, "Helvetica Neue", Arial, sans-serif);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
  box-sizing: border-box;
}

.cg-popup__btn--pill {
  width: min(520px, 100%);
  border-radius: 999px;
}

.cg-popup__btn--block {
  width: 100%;
  margin-top: auto;
  border-radius: 3px;
  padding: 14px 16px;
  font-size: 13px;
}

.cg-popup__btn--gold {
  background-color: var(--cg-gold);
}

.cg-popup__btn--gold:hover {
  background-color: var(--cg-gold-dark);
  color: #fff;
}

.cg-popup__btn--gray {
  background-color: transparent;
  color:var(--color-black);
  font-size:24px;
  font-weight:700;
}

.cg-popup__btn--gray:hover {
  background-color: #4a4a4a;
  color: #fff;
}

.cg-popup__btn--dropdown {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0;
  margin-top: 14px;
  width: min(640px, 100%);
  padding: 16px 28px;
  cursor: default;
  pointer-events: none;
}

.cg-popup__btn--dropdown > span:first-of-type {
  grid-column: 2;
  justify-self: center;
  text-align: center;
}

.cg-popup__chevron {
  grid-column: 3;
  justify-self: end;
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid var(--cg-gold);
  transition: transform 0.2s ease;
  display: none;
}

.cg-popup__btn--dropdown[aria-expanded="true"] .cg-popup__chevron {
  transform: rotate(180deg);
}

.cg-popup__note {
  margin: 10px 0 0;
  max-width: 560px;
  font-size: 11px;
  font-style: italic;
  line-height: 1.45;
  color: var(--cg-muted);
}

/* ---- Panels row ---- */

.cg-popup__panels {
  display: none;
  flex-direction: column;
  gap: 20px;
  align-items: stretch;
  width: 100%;
}

.cg-popup__panels.is-open {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
  padding-top: 56px;
}

.cg-popup__divider {
  display: none;
  width: 3px;
  align-self: stretch;
  height: auto;
  min-height: 100%;
  margin-top: 48px;
  margin-bottom: 48px;
  background-color: var(--cg-gold);
  flex-shrink: 0;
  box-sizing: border-box;
}

/* ---- Cards ---- */

.cg-popup__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 0;
  min-width: 0;
  height: auto;
  padding: 16px 16px 18px;
  border: 1px solid var(--cg-gold);
  box-sizing: border-box;
  text-align: center;
  background-color: #fff;
}

/*
 * Top border (1px) runs left → right through the vertical center
 * of the card image; white pad breaks the line behind the image.
 */
.cg-popup__media {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: auto;
  max-width: calc(100% - 48px);
  height: auto;
  /* Pull up so border hits image mid-height; tighter gap to content below */
  margin: -72px auto 24px;
  padding: 0 14px;
  background-color: #fff;
  position: relative;
  z-index: 1;
}

.cg-popup__media img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 112px;
  object-fit: contain;
  object-position: center;
}

.cg-popup__card-title {
  margin: 0 0 6px;
  font-family: var(--font-sans-display, "Helvetica Neue", Arial, sans-serif);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  color: var(--cg-text);
}

.cg-popup__card-sub {
  margin: 0 auto 12px;
  max-width: 100%;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  color: var(--cg-text);
}

.cg-popup__list {
  list-style: none;
  margin: 0 auto 10px;
  padding: 0;
  width: 100%;
  max-width: 100%;
  text-align: left;
}

.cg-popup__list li {
  position: relative;
  margin: 0 0 7px;
  padding-left: 22px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--cg-text);
}

.cg-popup__list li:last-child {
  margin-bottom: 0;
}

.cg-popup__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: #3a9d5c;
}

.cg-popup__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  max-width: 100%;
  margin: 0 auto 6px;
  padding-left: 22px;
  box-sizing: border-box;
  text-align: left;
}

.cg-popup__links a,
.cg-popup__list a {
  font-size: inherit;
  line-height: inherit;
  color: var(--cg-gold);
  text-decoration: none;
}

.cg-popup__links a {
  font-size: 12px;
  line-height: 1.35;
}

.cg-popup__links a:hover,
.cg-popup__list a:hover {
  color: var(--cg-gold-dark);
}

.cg-popup__footnote {
  width: 100%;
  max-width: 100%;
  margin: 0 auto 12px;
  padding-left: 22px;
  box-sizing: border-box;
  text-align: left;
  font-size: 12px;
  line-height: 1.35;
  color: #444;
}

/* ---- Carousel ---- */

/* Content below slide titles: center-aligned like screenshot */
.cg-popup__slide .cg-popup__card-title {
  text-align: center;
}

.cg-popup__slide .cg-popup__card-sub {
  text-align: left;
  margin-left: auto;
  margin-right: auto;
}

.cg-popup__slide .cg-popup__list {
 /* width: fit-content; */
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.cg-popup__slide .cg-popup__links {
  /*width: fit-content; */
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 0px 20px 20px;
  /*align-items: center; */
  text-align: left;
}

.cg-popup__carousel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 0;
  min-width: 0;
  height: auto;
  overflow: visible;
  box-sizing: border-box;
}

/* Equal boxes grow/shrink together with content */
.cg-popup__panels.is-open > .cg-popup__card,
.cg-popup__panels.is-open > .cg-popup__carousel {
  transition: min-height 0.4s ease;
}

.cg-popup__slides {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 100%;
}

.cg-popup__slide {
  width: 100%;
  height: 100%;
  min-height: 100%;
  box-sizing: border-box;
}

.cg-popup__slide[hidden] {
  display: none !important;
}

.cg-popup__slide.is-active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
}

.cg-popup__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--cg-gold);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.cg-popup__nav:hover {
  background-color: var(--cg-gold-dark);
}

.cg-popup__nav:focus-visible {
  outline: 2px solid var(--cg-gold);
  outline-offset: 2px;
}

.cg-popup__nav--prev {
  left: 0;
  transform: translate(-50%, -50%);
}

.cg-popup__nav--next {
  right: 0;
  transform: translate(50%, -50%);
}

/* Body scroll lock while open */
body.cg-popup-open {
  overflow: hidden;
}

/* ---- Desktop ---- */

@media (min-width: 900px) {
  .cg-popup__dialog {
    padding: 28px 36px 22px;
    overflow: hidden;
    transform:scale(0.77);
    transform-orgin: center;
  }

  .cg-popup__panels.is-open {
    flex-direction: row;
    align-items: stretch;
    gap: 0;
  }

  /* Equal width + equal height (stretch to tallest) */
  .cg-popup__panels.is-open > .cg-popup__card,
  .cg-popup__panels.is-open > .cg-popup__carousel {
    flex: 1 1 0;
    width: 0;
    max-width: none;
    align-self: stretch;
    height: auto;
  }

  .cg-popup__divider {
    display: block;
    margin: 48px 32px;
    align-self: stretch;
  }

  .cg-popup__card {
    padding: 18px 18px 18px;
  }

  .cg-popup__media {
    margin-top: -74px;
    margin-bottom: 24px;
    padding: 0 16px;
  }

  .cg-popup__nav--prev {
    left: 0;
    transform: translate(-50%, -50%);
  }

  .cg-popup__nav--next {
    right: 0;
    transform: translate(50%, -50%);
  }

  .cg-popup__card-title {
    font-size: 16px;
  }

  .cg-popup__list li {
    font-size: 14px;
  }
}

/* ---- Mobile ---- */

@media (max-width: 899px) {
  .cg-popup {
    padding: 12px;
    align-items: flex-start;
  }

  .cg-popup__dialog {
    width: 100%;
    max-height: 96vh;
    padding: 40px 16px 20px;
    border-radius: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .cg-popup__dialog::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .cg-popup__panels.is-open {
    gap: 60px;
    padding: 0 8px;
    margin-top:30px;
  }

  .cg-popup__panels.is-open > .cg-popup__card,
  .cg-popup__panels.is-open > .cg-popup__carousel {
    width: 100%;
    flex: 0 0 auto;
  }

  .cg-popup__btn--pill {
    width: 100%;
    font-size: 13px;
    padding: 12px 18px;
  }

  .cg-popup__note {
    font-size: 10px;
  }

  .cg-popup__carousel {
    padding: 0;
    margin: 0;
  }

  .cg-popup__card {
    padding: 20px 18px 18px;
  }

  .cg-popup__nav {
    width: 30px;
    height: 30px;
  }

  .cg-popup__nav--prev {
    left: 0;
    transform: translate(-50%, -50%);
  }

  .cg-popup__nav--next {
    right: 0;
    transform: translate(50%, -50%);
  }

  .cg-popup__media {
    margin-top: -70px;
    margin-bottom: 22px;
    max-width: calc(100% - 40px);
    padding: 0 12px;
  }

  .cg-popup__media img {
    max-height: 100px;
  }

  .cg-popup__card-title {
    font-size: 15px;
  }

  .cg-popup__card-sub {
    font-size: 12px;
  }
}
/* ---Speedbump--- */
.speedbump-overlay {
      position: fixed;
      inset: 0;
      z-index: 99999;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 16px;
      background: rgba(0, 0, 0, 0.38);
      font-family: Arial, Helvetica, sans-serif;
    }
    .speedbump-overlay.is-open { display: flex; }
    .speedbump-dialog {
      position: relative;
      box-sizing: border-box;
      width: min(100%, 700px);
      background: #fff;
      color: #333;
      padding: 26px 28px 24px;
      box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
    }
    .speedbump-close {
      position: absolute;
      top: 8px;
      right: 12px;
      border: 0;
      background: transparent;
      color: #666;
      font-size: 23px;
      line-height: 1;
      cursor: pointer;
      padding: 2px 4px;
    }
    .speedbump-title {
      margin: 0 0 26px;
      text-align: center;
      font-size: clamp(22px, 3vw, 28px);
      font-weight: 400;
    }
    .speedbump-message {
      margin: 0;
      font-size: 13px;
      line-height: 1.7;
      color: #555;
    }
    .speedbump-actions {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 28px;
      margin-top: 26px;
    }
    .speedbump-continue {
      min-width: 100px;
      padding: 9px 25px;
      border: 0;
      border-radius: 3px;
      background: #000;
      color: #fff;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);
    }
    .speedbump-cancel {
      border: 0;
      background: transparent;
      color: #000;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      padding: 9px 10px;
    }
    .speedbump-continue:focus-visible,
    .speedbump-cancel:focus-visible,
    .speedbump-close:focus-visible {
      outline: 2px solid #155eef;
      outline-offset: 3px;
    }
    @media (max-width: 480px) {
      .speedbump-dialog { padding: 28px 20px 22px; }
      .speedbump-title { margin-bottom: 20px; }
      .speedbump-actions { gap: 14px; }
    }
