/* New Year variant of the shared offer dialog: Figma xZJZHfANqh2IIsKNrAPJmT
   5760:2756, a 495 × 644 card. Decorative layers keep the frame's geometry in
   card units (--u = 1 Figma px), so the composition scales with the card; text
   and the form stay in the flow. Heads and the snowflake overhang the card,
   which the dialog's bleed keeps visible. */
.offer-dialog--winter {
  /* Px, not rem: the overhang is 11.3% of the card width (55/495), so the
     bleed must not grow with the reader's text size and squeeze the card. */
  --offer-bleed: 30px;
  --offer-top-bleed: 48px;
  width: min(calc(495px + 2 * var(--offer-bleed)), calc(100% - 1rem));
  scrollbar-color: #7f9be8 #1c3a9f;
}
@media (width >= 40rem) {
  .offer-dialog--winter { --offer-bleed: 56px; }
}
.offer-dialog--winter .offer-dialog__card {
  --u: calc(100cqw / 495);
  border: 1px solid rgb(255 255 255 / 48%);
  /* cqw on the card itself would resolve against the viewport: fixed radius. */
  border-radius: 1.875rem;
  background: linear-gradient(#1c49d2, #20327a);
}
.offer-dialog--winter .offer-dialog__close { color: #1c49d2; }
.offer-dialog__scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: clip;
  border-radius: inherit;
  pointer-events: none;
}
.offer-dialog__scene > * { position: absolute; display: block; max-width: none; }
.offer-dialog__texture {
  left: calc(-176 * var(--u));
  top: 0;
  width: calc(872 * var(--u));
  height: calc(379 * var(--u));
  opacity: .64;
  filter: blur(calc(50 * var(--u)));
}
.offer-dialog__texture img { width: 100%; height: 100%; object-fit: fill; }
.offer-dialog__texture::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgb(5 38 150 / 0%) 85.096%, #052696); }
.offer-dialog__characters {
  left: calc(-51 * var(--u));
  top: calc(-43 * var(--u));
  width: calc(602 * var(--u));
  height: calc(482 * var(--u));
  object-fit: cover;
}
/* image 370: 342 × 284.77 crop of a decor sheet, its visible part pre-cut. */
.offer-dialog__trees {
  left: calc((-183 + 23.1534) * var(--u));
  top: calc(162 * var(--u));
  width: calc(318.8407 * var(--u));
  height: calc(284.7765 * var(--u));
  filter: blur(calc(.75 * var(--u)));
}
.offer-dialog__glow {
  left: calc(-250 * var(--u));
  top: calc(284 * var(--u));
  width: calc(991 * var(--u));
  height: calc(360 * var(--u));
  background: #0032ca;
  filter: blur(calc(75 * var(--u)));
}
.offer-dialog__overhang {
  position: absolute;
  z-index: 0;
  top: calc(-47.5 * var(--u));
  left: calc(1 * var(--u));
  width: calc(550 * var(--u));
  height: calc(446.837 * var(--u));
  pointer-events: none;
}
.offer-dialog__overhang > * { position: absolute; display: block; max-width: none; }
.offer-dialog__heads { left: 0; top: 0; width: calc(550 * var(--u)); height: calc(196.5 * var(--u)); }
/* image 473 (transparent PNG) in its 183 × 202.34 rotated box. */
.offer-dialog__snowflake {
  left: calc((362 + (183.0239 - 152.517) / 2) * var(--u));
  top: calc((273.154 + (202.3372 - 176.832) / 2) * var(--u));
  width: calc(152.517 * var(--u));
  height: calc(176.832 * var(--u));
  border-radius: calc(57 * var(--u));
  object-fit: cover;
  object-position: bottom;
  rotate: -10.83deg;
  filter: blur(calc(10.9 * var(--u)));
}
.offer-dialog--winter .offer-dialog__body {
  z-index: 1;
  padding: calc(340 * var(--u)) 2rem 2.125rem;
}
/* The 463 px title box of the frame is wider than the form column. */
.offer-dialog--winter h2 { margin-inline: -1rem; margin-top: 1.0625rem; font-size: clamp(1.5rem, calc(36.83 * var(--u)), 2.301875rem); line-height: 1; }
.offer-dialog--winter h2 + .offer-dialog__subtitle { margin-top: .3125rem; }
.offer-dialog--winter .offer-form { margin-top: 1.5rem; }
.offer-dialog--winter .offer-form__consents { gap: .5rem; margin-top: 1.875rem; }
/* The thanks fills the body below the art (Figma ASUbb6hQZf8cAetY2CnRN6 6820:3474). */
.offer-dialog--winter .offer-form[data-sent] > .form-success { inset: calc(340 * var(--u)) 0 2.125rem; }
.offer-dialog--winter .offer-consent > span { color: rgb(255 255 255 / 56%); opacity: .58; font-size: .5625rem; }
@container offer-dialog (max-width: 28rem) {
  .offer-dialog--winter .offer-dialog__body { padding-inline: 1.25rem; }
  .offer-dialog--winter .offer-consent > span { font-size: .6875rem; opacity: .8; }
}
/* Checkboxes as in the frame (5760:2737/2738): #f3f3f3 at .43, a faint border,
   3px corners; checked shows a white tick. Native input, so keyboard, form
   validation and assistive technology are unchanged. */
.offer-dialog--winter .offer-consent input {
  appearance: none;
  display: grid;
  place-items: center;
  width: .8125rem;
  height: .8125rem;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 3px;
  background: rgb(243 243 243 / 43%);
  cursor: pointer;
}
.offer-dialog--winter .offer-consent input::after {
  content: "";
  width: 40%;
  height: 65%;
  margin-top: -12%;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  rotate: 45deg;
  opacity: 0;
}
.offer-dialog--winter .offer-consent input:checked { background: rgb(243 243 243 / 60%); }
.offer-dialog--winter .offer-consent input:checked::after { opacity: 1; border-color: #1c49d2; }
.offer-dialog--winter .offer-consent input:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@container offer-dialog (max-width: 28rem) {
  .offer-dialog--winter .offer-consent input { width: 1.125rem; height: 1.125rem; }
}

@media (width < 48rem) {
  .offer-dialog--winter {
    /* Reserve only the visible head overhang, not the PNG's transparent edge.
       Override the browser's dialog max-width so it cannot shrink the form. */
    --offer-bleed: clamp(8px, calc(3.125vw - 2px), 14px);
    --offer-top-bleed: 26px;
    width: min(calc(495px + 2 * var(--offer-bleed)), 100%);
    max-width: 100%;
  }
  .offer-dialog--winter .offer-dialog__card {
    /* Reserve the normal-size form first. Only the decorative scene shrinks
       in short browser windows; larger text still uses the dialog's scroll. */
    --offer-art-height: min(calc(260 * var(--u)), clamp(80px, calc(100svh - 488px), 176px));
    --offer-art-unit: calc(var(--offer-art-height) / 340);
  }
  .offer-dialog--winter :is(.offer-dialog__scene, .offer-dialog__overhang) {
    /* Keep all photo layers proportional without changing the title's unit. */
    --u: var(--offer-art-unit);
  }
  /* Centre the original 495-unit art frame at its smaller mobile scale. */
  .offer-dialog--winter .offer-dialog__characters { left: calc(50% - 298.5 * var(--u)); }
  .offer-dialog--winter .offer-dialog__texture { left: calc(50% - 423.5 * var(--u)); }
  .offer-dialog--winter .offer-dialog__trees { left: calc(50% - 407.3466 * var(--u)); }
  .offer-dialog--winter .offer-dialog__glow { left: calc(50% - 497.5 * var(--u)); }
  .offer-dialog--winter .offer-dialog__body { padding: var(--offer-art-height) 12px 1rem; }
  .offer-dialog--winter h2 { margin: .5rem 0 0; }
  .offer-dialog--winter .offer-dialog__subject { margin-top: .5rem; padding-block: .375rem; }
  .offer-dialog--winter .offer-form { margin-top: .75rem; }
  .offer-dialog--winter .offer-form[data-sent] > .form-success { inset: var(--offer-art-height) 0 1rem; }
  .offer-dialog--winter .offer-form__row { gap: .5rem; }
  .offer-dialog--winter .offer-phone { min-height: 3.25rem; }
  .offer-dialog--winter .offer-form__submit { min-height: 3rem; padding-block: .75rem; }
  .offer-dialog--winter .offer-form__consents { margin-top: .75rem; }
  .offer-dialog--winter .offer-dialog__overhang {
    left: calc(50% - 246.5 * var(--u));
    width: calc(550 * var(--u));
    overflow: clip;
  }
}
