/* Post-auth coupon howto + ticket — Profesia × Lidl */

.mi-reward {
  --r-navy: #0050aa;
  --r-navy-deep: #003d82;
  --r-yellow: #ffd400;
  --r-ink: #1a1a18;
  --r-muted: #5c5c58;
  --r-lidl: #0050aa;
  position: fixed;
  inset: 0;
  z-index: 10140;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0, 80, 170, 0.35), transparent 55%),
    rgba(12, 22, 38, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: Roboto, "Segoe UI", sans-serif;
  color: var(--r-ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.mi-reward.is-open {
  opacity: 1;
  pointer-events: auto;
}

.mi-reward[hidden] {
  display: none !important;
}

.mi-reward__panel {
  position: relative;
  width: min(520px, 100%);
  max-height: min(94vh, 820px);
  overflow: auto;
  border-radius: 20px;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 28px 60px rgba(0, 20, 50, 0.45);
  animation: miRewardIn 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes miRewardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.mi-reward__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #334155;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.mi-reward__close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.mi-reward__view[hidden] {
  display: none !important;
}

/* —— How-to —— */
.mi-reward__hero {
  padding: 28px 28px 18px;
  background:
    linear-gradient(165deg, #003d82 0%, #0050aa 48%, #0a6bc4 100%);
  color: #fff;
  text-align: center;
}

.mi-reward__check {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--r-yellow);
  color: var(--r-navy-deep);
  box-shadow: 0 8px 20px rgba(255, 212, 0, 0.35);
  animation: miRewardPop 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

@keyframes miRewardPop {
  from {
    transform: scale(0.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.mi-reward__hero h2 {
  margin: 0 0 12px;
  font-size: 2.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.mi-reward__hero p {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}

.mi-reward__brands {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.mi-reward__brand-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
}

.mi-reward__brand-chip img {
  display: block;
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
}

.mi-reward__brand-chip--profesia {
  width: 78px;
  padding: 0 6px;
}

.mi-reward__brand-chip--profesia img {
  width: 64px;
  height: 40px;
}

.mi-reward__brand-chip--lidl {
  width: 44px;
  padding: 0;
}

.mi-reward__brand-chip--lidl img {
  width: 30px;
  height: 30px;
}

.mi-reward__brands-x {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}

.mi-reward__body {
  padding: 24px 26px 26px;
}

.mi-reward__steps {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mi-reward__step {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px 14px 16px 12px;
  border-radius: 12px;
  background: #f3f6fb;
  border: 1px solid #e4ebf5;
}

.mi-reward__step-num {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.45rem;
  color: var(--r-navy-deep);
  background: var(--r-yellow);
}

.mi-reward__step strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--r-ink);
  margin-bottom: 4px;
}

.mi-reward__step p {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.45;
  color: var(--r-muted);
}

.mi-reward__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #0050aa, #003d82);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 80, 170, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mi-reward__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 80, 170, 0.34);
}

.mi-reward__cta svg {
  width: 22px;
  height: 22px;
}

.mi-reward__skip {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
}

.mi-reward__skip:hover {
  color: #64748b;
}

/* —— Ticket —— */
.mi-reward__ticket-wrap {
  padding: 20px 16px 18px;
  background:
    radial-gradient(ellipse 90% 50% at 50% 0%, rgba(255, 212, 0, 0.18), transparent 55%),
    linear-gradient(180deg, #f4f7fc 0%, #fff 40%);
}

.mi-reward__ticket-head {
  text-align: center;
  margin-bottom: 14px;
}

.mi-reward__ticket-kicker {
  display: inline-block;
  margin: 0 0 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff3bf;
  color: #8a6a00;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mi-reward__ticket-head h2 {
  margin: 0 0 6px;
  font-size: 2.35rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--r-navy-deep);
}

.mi-reward__ticket-head p {
  margin: 0;
  font-size: 1.12rem;
  color: var(--r-muted);
}

.mi-reward__ticket {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0, 80, 170, 0.14);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.8) inset,
    0 18px 44px rgba(0, 45, 110, 0.16),
    0 2px 0 rgba(255, 212, 0, 0.55);
  animation: miRewardTicket 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes miRewardTicket {
  from {
    opacity: 0;
    transform: rotate(-2.5deg) translateY(16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.mi-reward__ticket-shine {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.45) 48%,
    transparent 60%
  );
  transform: translateX(-120%);
  animation: miRewardShine 2.8s ease-in-out 0.6s 1;
}

@keyframes miRewardShine {
  0% {
    transform: translateX(-120%);
  }
  45%,
  100% {
    transform: translateX(120%);
  }
}

.mi-reward__ticket-top {
  position: relative;
  z-index: 1;
  padding: 22px 20px 16px;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 212, 0, 0.35), transparent 35%),
    radial-gradient(circle at 10% 90%, rgba(255, 255, 255, 0.12), transparent 40%),
    linear-gradient(155deg, #0a6bc4 0%, #0050aa 42%, #00356f 100%);
  color: #fff;
  text-align: center;
}

.mi-reward__ticket-top::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -28deg,
    transparent,
    transparent 10px,
    rgba(255, 255, 255, 0.03) 10px,
    rgba(255, 255, 255, 0.03) 11px
  );
  pointer-events: none;
}

.mi-reward__ticket-brands {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 14px;
}

.mi-reward__ticket-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.mi-reward__ticket-brand img {
  display: block;
  object-fit: contain;
  max-height: 100%;
}

.mi-reward__ticket-brand--profesia {
  width: 78px;
  padding: 0 6px;
}

.mi-reward__ticket-brand--profesia img {
  width: 64px;
  height: 40px;
}

.mi-reward__ticket-brand--lidl {
  width: 44px;
  padding: 0;
}

.mi-reward__ticket-logo {
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mi-reward__ticket-x {
  font-weight: 800;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.7);
}

.mi-reward__ticket-label {
  position: relative;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--r-yellow);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.mi-reward__ticket-value {
  position: relative;
  margin: 6px 0 0;
  font-size: 5.6rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.95;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.mi-reward__ticket-value small {
  font-size: 2.2rem;
  font-weight: 800;
  margin-left: 2px;
  vertical-align: super;
}

.mi-reward__ticket-sub {
  position: relative;
  margin: 6px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}

.mi-reward__ticket-perf {
  position: relative;
  z-index: 1;
  height: 22px;
  background:
    linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  margin: 0;
}

.mi-reward__ticket-perf::before,
.mi-reward__ticket-perf::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dfe7f3;
  transform: translateY(-50%);
  box-shadow: inset 0 0 0 1px #c5d0e0;
}

.mi-reward__ticket-perf::before {
  left: -11px;
}

.mi-reward__ticket-perf::after {
  right: -11px;
}

.mi-reward__ticket-dash {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 50%;
  border-top: 2.5px dashed #b8c7dc;
  transform: translateY(-50%);
}

.mi-reward__ticket-body {
  position: relative;
  z-index: 1;
  padding: 8px 18px 20px;
  text-align: center;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(0, 80, 170, 0.05), transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #fff 55%);
}

.mi-reward__code-label {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7b8ba3;
}

.mi-reward__code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto 14px;
  padding: 16px 20px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #f0f5fc 100%);
  border: 2px dashed #0050aa;
  box-shadow: 0 8px 20px rgba(0, 80, 170, 0.08);
  font-family: Roboto, "Segoe UI", ui-monospace, Consolas, monospace;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--r-navy-deep);
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  cursor: default;
}

.mi-reward__barcode {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 14px;
  padding: 12px 14px 8px;
  max-width: 100%;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.mi-reward__ean {
  display: block;
  max-width: 100%;
  height: auto;
}

.mi-reward__meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 16px;
}

.mi-reward__meta-chip {
  padding: 10px 8px;
  border-radius: 12px;
  background: #f3f6fb;
  border: 1px solid #e4ebf5;
  text-align: center;
}

.mi-reward__meta-chip span {
  display: block;
  margin-bottom: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.mi-reward__meta-chip strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--r-ink);
  line-height: 1.25;
}

.mi-reward__meta {
  margin: 0 0 18px;
  font-size: 1.35rem;
  color: var(--r-muted);
  line-height: 1.5;
}

.mi-reward__meta strong {
  color: var(--r-ink);
}

.mi-reward__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Кнопка крупнее на экране самого купона */
#miRewardTicket .mi-reward__cta {
  font-size: 1.35rem;
  padding: 17px 18px;
  background: linear-gradient(135deg, #ffd400 0%, #f5c400 45%, #e6b800 100%);
  color: var(--r-navy-deep);
  box-shadow: 0 10px 24px rgba(230, 180, 0, 0.35);
}

#miRewardTicket .mi-reward__cta:hover {
  box-shadow: 0 14px 28px rgba(230, 180, 0, 0.42);
}

@media (prefers-reduced-motion: reduce) {
  .mi-reward__ticket-shine {
    animation: none !important;
    display: none;
  }
}

/* Отдельное окно ошибки поверх купона */
.mi-reward__err-modal {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(12, 22, 38, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mi-reward__err-modal[hidden] {
  display: none !important;
}

.mi-reward__err-modal.is-open {
  opacity: 1;
}

.mi-reward__err-card {
  width: min(360px, 100%);
  padding: 26px 22px 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(0, 20, 50, 0.35);
  text-align: center;
  transform: translateY(10px) scale(0.97);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.mi-reward__err-modal.is-open .mi-reward__err-card {
  transform: none;
}

.mi-reward__err-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fef2f2;
  border: 2px solid #fecaca;
  color: #dc2626;
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
}

.mi-reward__err-card h3 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 800;
  color: #991b1b;
  letter-spacing: -0.02em;
}

.mi-reward__err-card p {
  margin: 0 0 18px;
  font-size: 1.08rem;
  line-height: 1.5;
  color: #64748b;
}

.mi-reward__err-ok {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
  font-size: 1.12rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(185, 28, 28, 0.28);
}

.mi-reward__err-ok:hover {
  filter: brightness(1.05);
}

@media (max-width: 420px) {
  .mi-reward__hero,
  .mi-reward__body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .mi-reward__hero h2 {
    font-size: 2.15rem;
  }

  .mi-reward__hero p {
    font-size: 1.22rem;
  }

  .mi-reward__step strong {
    font-size: 1.25rem;
  }

  .mi-reward__step p {
    font-size: 1.15rem;
  }

  .mi-reward__ticket-head h2 {
    font-size: 2.05rem;
  }

  .mi-reward__ticket-head p {
    font-size: 1.15rem;
  }

  .mi-reward__ticket-value {
    font-size: 4.5rem;
  }

  .mi-reward__code {
    font-size: 1.5rem;
  }

  .mi-reward__barcode {
    padding: 8px 6px 4px;
  }

  .mi-reward__meta {
    font-size: 1.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mi-reward,
  .mi-reward__panel,
  .mi-reward__check,
  .mi-reward__ticket,
  .mi-reward__cta {
    animation: none !important;
    transition: none !important;
  }
}
