.mg-referral-rewards {
  margin: 0 0 28px;
  padding: 28px;
  color: #171717;
  background: linear-gradient(135deg, #f4f5f6 0%, #ffffff 52%, #f1f3f4 100%);
  border: 1px solid #e1e4e6;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(17, 17, 17, 0.06);
}

.mg-referral-rewards__intro {
  max-width: 680px;
  margin-bottom: 22px;
}

.mg-referral-rewards__eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: #6d757b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.mg-referral-rewards__intro h2 {
  margin: 0 0 8px;
  color: #111111;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
}

.mg-referral-rewards__intro p {
  margin: 0;
  color: #61676c;
}

.mg-referral-rewards__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mg-referral-reward-card {
  position: relative;
  display: flex;
  min-height: 310px;
  padding: 24px;
  overflow: hidden;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #dde1e4;
  border-radius: 14px;
}

.mg-referral-reward-card--active {
  border-color: #111111;
  box-shadow: 0 12px 30px rgba(17, 17, 17, 0.09);
}

.mg-referral-reward-card--active::after {
  position: absolute;
  top: -70px;
  right: -70px;
  width: 180px;
  height: 180px;
  content: "";
  background: radial-gradient(circle, rgba(17, 17, 17, 0.08), transparent 68%);
  pointer-events: none;
}

.mg-referral-reward-card--future {
  color: #737a7f;
  background: repeating-linear-gradient(135deg, #f6f7f8, #f6f7f8 12px, #f2f3f4 12px, #f2f3f4 24px);
}

.mg-referral-reward-card__top {
  display: flex;
  margin-bottom: 24px;
  align-items: center;
  justify-content: space-between;
}

.mg-referral-reward-card__icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  color: #ffffff;
  background: #111111;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.mg-referral-reward-card--future .mg-referral-reward-card__icon {
  background: #777d82;
  font-size: 20px;
}

.mg-referral-reward-card__status {
  display: inline-flex;
  padding: 6px 9px;
  color: #111111;
  background: #edf0f1;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.mg-referral-reward-card--active .mg-referral-reward-card__status {
  color: #ffffff;
  background: #111111;
}

.mg-referral-reward-card h3 {
  margin: 0 0 8px;
  color: #111111;
  font-size: 21px;
}

.mg-referral-reward-card > p {
  margin: 0 0 20px;
  line-height: 1.55;
}

.mg-referral-reward-card__balance,
.mg-referral-reward-card__future-note {
  display: flex;
  min-height: 64px;
  margin-top: auto;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: #f4f5f6;
  border-radius: 10px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mg-referral-reward-card__balance span {
  color: #6d7479;
  font-size: 13px;
}

.mg-referral-reward-card__balance strong {
  color: #111111;
  font-size: 20px;
  white-space: nowrap;
}

.mg-referral-reward-card__future-note {
  color: #747b80;
  background: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1.45;
}

.mg-referral-reward-card__button {
  width: 100%;
  min-height: 46px;
  padding: 12px 18px;
  color: #ffffff;
  background: #111111;
  border: 1px solid #111111;
  border-radius: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  transition: transform 160ms ease, background 160ms ease;
}

.mg-referral-reward-card__button:not(:disabled):hover {
  background: #2c2c2c;
  transform: translateY(-1px);
}

.mg-referral-reward-card__button:disabled {
  color: #8b9297;
  background: #e5e7e9;
  border-color: #d8dcdf;
  cursor: not-allowed;
}

.mg-referral-reward-card__message {
  min-height: 0;
  margin-top: 10px;
  color: #1f6c42;
  font-size: 13px;
  line-height: 1.5;
}

.mg-referral-reward-card__message.is-error {
  color: #a32828;
}

.mg-referral-reward-card__message code {
  padding: 2px 6px;
  color: #111111;
  background: #eef0f1;
  border-radius: 4px;
}

@media (max-width: 760px) {
  .mg-referral-rewards {
    padding: 20px;
  }

  .mg-referral-rewards__grid {
    grid-template-columns: 1fr;
  }

  .mg-referral-reward-card {
    min-height: 290px;
  }
}

.mg-cart-referral {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  margin: 0 0 22px;
  padding: 17px 18px;
  color: #111111;
  background: linear-gradient(110deg, #f1f2f3 0%, #ffffff 72%);
  border: 1px solid #d8dcdf;
  border-left: 4px solid #111111;
  align-items: center;
  gap: 14px;
  box-sizing: border-box;
}

.mg-cart-referral__mark {
  display: inline-flex;
  width: 38px;
  height: 38px;
  color: #ffffff;
  background: #111111;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.mg-cart-referral__balance {
  margin-bottom: 3px;
  line-height: 1.25;
}

.mg-cart-referral__balance span {
  color: #50565a;
  font-size: 13px;
  font-weight: 650;
}

.mg-cart-referral__balance strong {
  color: #111111;
  font-size: 17px;
  white-space: nowrap;
}

.mg-cart-referral__description {
  color: #6b7176;
  font-size: 12px;
  line-height: 1.4;
}

.mg-cart-referral__link {
  display: inline-flex;
  min-height: 38px;
  padding: 8px 13px;
  color: #ffffff !important;
  background: #111111;
  border: 1px solid #111111;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none !important;
  white-space: nowrap;
}

.mg-cart-referral__link:hover,
.mg-cart-referral__link:focus {
  color: #ffffff !important;
  background: #2c2c2c;
}

.mg-cart-referral--compact {
  grid-template-columns: auto minmax(0, 1fr);
  margin: 10px 0 12px;
  padding: 13px;
  gap: 10px;
}

.mg-cart-referral--compact .mg-cart-referral__mark {
  width: 32px;
  height: 32px;
  font-size: 10px;
}

.mg-cart-referral--compact .mg-cart-referral__balance span,
.mg-cart-referral--compact .mg-cart-referral__description {
  font-size: 11px;
}

.mg-cart-referral--compact .mg-cart-referral__balance strong {
  font-size: 14px;
}

.mg-cart-referral--compact .mg-cart-referral__link {
  grid-column: 1 / -1;
  width: 100%;
}

@media (max-width: 600px) {
  .mg-cart-referral {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 14px;
    gap: 11px;
  }

  .mg-cart-referral__link {
    grid-column: 1 / -1;
    width: 100%;
  }
}

