/* Email opt-in module ("Get the best deals first"). Uses tokens from styles.css. */

.optin {
  --o-accent: #9dbcff;
  --o-soft: rgba(255, 255, 255, 0.72);
  --o-line: rgba(255, 255, 255, 0.14);
  margin: 36px 0 0;
}

.optin__card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  padding: clamp(22px, 4vw, 40px);
  overflow: hidden;
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(47, 111, 235, 0.38), transparent 55%),
    radial-gradient(80% 80% at 100% 100%, rgba(47, 111, 235, 0.22), transparent 60%),
    var(--navy);
  box-shadow: 0 30px 60px -30px rgba(11, 31, 77, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* light snowfall, fading in toward the form side */
.optin__card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.55) 1.1px, transparent 1.5px), radial-gradient(rgba(255, 255, 255, 0.28) 0.9px, transparent 1.3px);
  background-size: 52px 52px, 31px 31px;
  background-position: 0 0, 15px 22px;
  -webkit-mask-image: linear-gradient(115deg, transparent 40%, #000 100%);
  mask-image: linear-gradient(115deg, transparent 40%, #000 100%);
  pointer-events: none;
}

.optin__copy,
.optin__action,
.optin__copy > div,
.optin__perks li {
  min-width: 0;
}

.optin__copy {
  display: flex;
  align-items: center;
  gap: 20px;
}

.optin__yeti {
  flex: none;
  width: clamp(76px, 11vw, 112px);
  padding: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(157, 188, 255, 0.14), 0 14px 30px -12px rgba(0, 0, 0, 0.5);
}

.optin__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 8px;
  border: 1px solid var(--o-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--o-accent);
}

.optin__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

.optin h2 {
  margin-top: 10px;
  font: 800 clamp(1.65rem, 4.6vw, 2.4rem) / 1.04 var(--display);
  letter-spacing: -0.035em;
  color: #fff;
  text-wrap: balance;
}

.optin h2 span {
  color: var(--o-accent);
  font-style: italic;
}

.optin__perks {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  font-size: 0.93rem;
  line-height: 1.4;
  color: var(--o-soft);
}

.optin__perks li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.optin__perks i {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(157, 188, 255, 0.14);
  color: var(--o-accent);
}

.optin__perks svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.optin__perks b {
  color: #fff;
  font-weight: 650;
}

/* ---- form ---- */

.optin__action {
  position: relative;
}

.optin__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.optin__row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 36px -18px rgba(0, 0, 0, 0.55);
  transition: box-shadow 0.2s;
}

.optin__row:focus-within {
  box-shadow: 0 0 0 4px rgba(157, 188, 255, 0.45), 0 18px 36px -18px rgba(0, 0, 0, 0.55);
}

.optin__mail {
  position: absolute;
  left: 20px;
  top: 31px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  fill: none;
  stroke: #8a97b3;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.optin__row input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 12px 0 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--navy);
  font: 500 1rem var(--sans);
}

.optin__row input::placeholder {
  color: #9aa6bf;
}

.optin__row input:focus {
  outline: none;
}

.optin__row .btn {
  flex: none;
  height: 50px;
  padding: 0 20px;
  border-radius: 11px;
}

.optin__row .btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  transition: transform 0.2s;
}

.optin__row .btn:hover svg {
  transform: translateX(3px);
}

/* consent: custom box over a real (visually hidden) checkbox */
.optin__consent {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--o-line);
  border-radius: 12px;
  background: rgba(13, 34, 82, 0.92);
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--o-soft);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.optin__consent:hover {
  border-color: rgba(255, 255, 255, 0.26);
}

.optin__consent input {
  position: absolute;
  width: 20px;
  height: 20px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.optin__box {
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
}

.optin__box svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--navy);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
}

.optin__consent input:checked + .optin__box {
  border-color: var(--o-accent);
  background: var(--o-accent);
}

.optin__consent input:checked + .optin__box svg {
  opacity: 1;
  transform: none;
}

.optin__consent input:focus-visible + .optin__box {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.optin__consent:has(input:checked) {
  border-color: rgba(157, 188, 255, 0.4);
  background: rgb(22, 47, 104);
  color: rgba(255, 255, 255, 0.88);
}

.optin__consent a {
  color: var(--o-accent);
  text-underline-offset: 2px;
}

.optin__consent.is-missing {
  border-color: #ffb4ad;
  background: rgb(52, 46, 86);
}

.optin__consent.is-missing .optin__box {
  border-color: #ffb4ad;
}

.optin .signup__msg {
  min-height: 0;
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: #ffb4ad;
}

.optin .signup__msg:not(:empty) {
  margin-top: 10px;
}

.optin__fine {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.52);
}

.optin__fine svg,
.optin .signup__done svg {
  flex: none;
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.optin .signup__done {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(157, 188, 255, 0.3);
  border-radius: 16px;
  background: rgba(157, 188, 255, 0.12);
  color: #fff;
  font-weight: 600;
}

.optin .signup__done svg {
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: var(--o-accent);
  stroke: var(--navy);
  stroke-width: 3;
  box-sizing: content-box;
}

/* ---- compact version under the Top 100 banner ---- */

.optin--compact {
  margin: 14px 0 4px;
}

.optin--compact .optin__card {
  gap: 14px;
  padding: 18px 20px;
  border-radius: 20px;
}

.optin--compact .optin__yeti {
  width: 60px;
  padding: 4px;
  box-shadow: 0 0 0 4px rgba(157, 188, 255, 0.14);
}

.optin--compact .optin__eyebrow {
  padding: 2px 8px 2px 7px;
  font-size: 0.64rem;
}

.optin--compact h2 {
  margin-top: 6px;
  font-size: clamp(1.3rem, 4.4vw, 1.7rem);
}

.optin--compact .optin__perks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  font-size: 0.83rem;
}

.optin--compact .optin__perks i {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

.optin--compact .optin__perks svg {
  width: 12px;
  height: 12px;
}

.optin--compact .optin__perks li:nth-child(3) {
  display: none;
}

.optin--compact .optin__row input,
.optin--compact .optin__row .btn {
  height: 46px;
}

.optin--compact .optin__mail {
  top: 29px;
}

.optin--compact .optin__consent {
  padding: 9px 11px;
  font-size: 0.79rem;
}

.optin--compact .optin__fine {
  display: none;
}

/* inside the Top 100 grid: a full-width row */
.t-optin {
  grid-column: 1 / -1;
  list-style: none;
}

.t-optin .optin {
  margin: 6px 0;
}

@media (min-width: 900px) {
  .optin__card {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    gap: 44px;
  }

  .optin--compact .optin__card {
    gap: 32px;
  }
}

@media (max-width: 520px) {
  /* yeti beside the eyebrow + headline, perks full width underneath */
  .optin__copy {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0 14px;
  }

  .optin__copy > div {
    display: contents;
  }

  .optin__yeti {
    grid-row: 1 / 3;
    width: 64px;
    padding: 4px;
  }

  .optin__eyebrow {
    justify-self: start;
    align-self: end;
  }

  .optin h2 {
    align-self: start;
    margin-top: 8px;
  }

  .optin__perks {
    grid-column: 1 / -1;
  }

  .optin__row {
    flex-direction: column;
    align-items: stretch;
  }

  .optin__row input {
    flex: none;
  }

  .optin__row .btn {
    width: 100%;
  }

  /* compact banner: keep email + button on one line to save height */
  .optin--compact .optin__row {
    flex-direction: row;
    align-items: center;
  }

  .optin--compact .optin__row .btn {
    width: auto;
    padding: 0 14px;
  }

  .optin--compact .optin__row .btn svg {
    display: none;
  }

  .optin--compact .optin__row input {
    flex: 1;
    padding-left: 36px;
  }

  .optin--compact .optin__mail {
    left: 16px;
  }

  .optin--compact .optin__perks {
    margin-top: 12px;
  }

  .optin--compact .optin__perks li:nth-child(2) {
    display: none;
  }

  .optin--compact .optin__yeti {
    width: 52px;
  }
}
