/* ==========================================================================
   Raffle result screens
   - No prize: Figma 2002:2133 /ABRIR-NO-PREMIADO (frame 402, footer at y 567)
   - Prize:    Figma 2002:2051 /ABRIR-PREMIADO (frame 402, footer at y 1030), measured on
               a capture of the frame; coupon art from Figma 2218:1087 (assets/cupones/).
   ========================================================================== */

/* 567px of content + 615px footer */
.page--sorteo {
  --page-height: 1182px;
}

.sorteo-res {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-top: 171px;
  text-align: center;
  color: var(--color-blanco);
  font-family: var(--font-body);
}

.sorteo-res__title {
  width: 344px;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 81px;
  line-height: 0.86;
  letter-spacing: 2.43px;
  color: var(--color-dorado);
  text-transform: lowercase;
}

.sorteo-res__lead {
  width: 311px;
  /* Figma: text box starts at y 234, 7px above the title box bottom */
  margin: -7px 0 0;
  font-size: 18px;
  line-height: 1.4;
}

.sorteo-res__card {
  box-sizing: border-box;
  width: 333px;
  min-height: 73px;
  margin: 15px 0 0;
  /* 2 lines of 18px/1.4 centred in the 73px box */
  padding: 9px 0;
  border: 2px solid var(--color-dorado);
  border-radius: 17px;
  font-size: 18px;
  line-height: 1.4;
  white-space: nowrap;
}

.sorteo-res__note {
  width: 263px;
  margin: 24px 0 0;
  font-size: 16px;
  line-height: 1.4;
}

.sorteo-res__note[hidden] {
  display: none;
}

/* ---------- Prize (Figma 2002:2051, frame 402 × 1645, footer at y 1030) ----------
   In this frame the top wave sits 34px higher than the shared app header (its lower
   edge is at y 61 instead of 95). The header stays where every screen has it and the
   whole content moves down by that offset, so the spacing below the wave is the design's. */
.page--sorteo-premio {
  --premio-shift: 34px;
  --page-height: calc(1645px + var(--premio-shift));
}

.page--sorteo-premio .page__decor-layer {
  top: var(--premio-shift);
}

/* The redemption code box is not in the Figma frame: when it is shown, everything below
   the coupon (copy, lower decorations, footer) moves down by its height + margin. */
.page--sorteo-premio.has-codigo {
  --codigo-h: 118px;
  --page-height: calc(1645px + var(--premio-shift) + var(--codigo-h));
}

.premio-decor-low {
  position: absolute;
  inset: 0;
  transform: translateY(var(--codigo-h, 0px));
}

.premio {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-top: calc(152px + var(--premio-shift));
  text-align: center;
  color: var(--color-blanco);
  font-family: var(--font-body);
}

.premio__title,
.premio__bye {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.86;
  text-transform: lowercase;
  white-space: nowrap;
}

.premio__title {
  font-size: 81px;
  letter-spacing: 2.43px;
  color: var(--color-dorado);
}

.premio__lead {
  margin: 15px 0 0;
  font-size: 24px;
  line-height: 33px;
  white-space: nowrap;
}

.premio__lead--intro {
  margin-top: 10px;
}

/* Coupon: 306 × 202 like every coupon of the sheet (Figma 2218:1087) */
.premio__cupon {
  width: 306px;
  min-height: 202px;
  margin-top: 21px;
}

.premio__cupon-img {
  display: block;
  width: 306px;
  height: 202px;
}

.premio__cupon-img[hidden],
.premio__cupon-texto[hidden] {
  display: none;
}

/* Fallback when a prize has no coupon art yet (e.g. a prize added from the dashboard) */
.premio__cupon-texto {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 202px;
  margin: 0;
  padding: 24px;
  border-radius: 17px;
  background-color: var(--color-dorado);
  color: var(--color-granate);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Redemption code: 104px box + 14px margin = --codigo-h */
.premio__codigo {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 306px;
  height: 104px;
  margin-top: 14px;
  border: 2px solid var(--color-dorado);
  border-radius: 17px;
}

.premio__codigo[hidden] {
  display: none;
}

.premio__codigo-label,
.premio__codigo-valor,
.premio__codigo-vigencia {
  margin: 0;
  white-space: nowrap;
}

.premio__codigo-label {
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--color-dorado);
}

.premio__codigo-valor {
  font-weight: 700;
  font-size: 36px;
  line-height: 42px;
  letter-spacing: 4px;
  /* Keeps the box optically centred despite the trailing letter-spacing */
  margin-right: -4px;
  user-select: all;
}

.premio__codigo-vigencia {
  font-size: 14px;
  line-height: 20px;
}

.premio__text {
  margin: 29px 0 0;
  font-size: 16px;
  line-height: 1.4;
  white-space: nowrap;
}

.premio__actions {
  position: relative;
  width: 333px;
  margin-top: 24px;
}

.premio__cta {
  width: 333px;
  min-height: 57px;
}

/* Sits in the gap under the button so the copy below never moves */
.premio__status {
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  margin: 1px 0 0;
  font-weight: 700;
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
  color: var(--color-dorado-blanco);
}

.premio__status:empty {
  display: none;
}

.premio__text--thanks {
  margin-top: 19px;
}

.premio__bye {
  margin-top: 9px;
  font-size: 60px;
  letter-spacing: 1.8px;
  color: var(--color-dorado-blanco);
}

/* ---------- Result screen CTA (raffle entry) ---------- */
.result-cta__status {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  z-index: 5;
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  color: var(--color-dorado-blanco);
}

.result-cta__status:empty {
  display: none;
}

/* Same solid muted gold as the returning-user CTA: baubles hang behind this button */
.result-cta__btn:disabled,
.result-cta__btn.is-disabled {
  background-color: #87744b;
  color: #302526;
  opacity: 1;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}
