/* AcademyX Promocode Page — Mobile-first */

.promo-page {
  min-height: 100dvh;
  padding-bottom: 2rem;
}

/* ── Sticky promocode bar (mobile) ── */
.promo-activate-section {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(2, 11, 24, 0.95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(0, 174, 239, 0.15);
  padding: 1rem clamp(1rem, 4vw, 1.5rem);
}

.promo-activate-inner {
  max-width: 28rem;
  margin: 0 auto;
}

.promo-activate-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.promo-input-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.promo-input {
  width: 100%;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.875rem;
  padding: 0.95rem 1.1rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.promo-input:focus {
  outline: none;
  border-color: #00AEEF;
  box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.15);
}

.promo-input::placeholder {
  color: #6b7280;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
}

.promo-input.valid {
  border-color: rgba(34, 197, 94, 0.6);
}

.promo-input.invalid {
  border-color: rgba(239, 68, 68, 0.6);
}

.promo-activate-btn {
  width: 100%;
  padding: 0.95rem 1.25rem;
  border: none;
  border-radius: 0.875rem;
  background: linear-gradient(90deg, #00D2FF 0%, #0072FF 100%);
  color: #021018;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.25s, opacity 0.25s;
}

.promo-activate-btn:hover:not(:disabled) {
  box-shadow: 0 0 24px rgba(0, 174, 239, 0.45);
}

.promo-activate-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.promo-activate-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.promo-status {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  min-height: 1.25rem;
  text-align: center;
  transition: opacity 0.3s;
}

.promo-status.success { color: #4ade80; }
.promo-status.error { color: #f87171; }

.promo-partner-badge {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(0, 174, 239, 0.12);
  border: 1px solid rgba(0, 174, 239, 0.3);
  color: #00AEEF;
  font-size: 0.8rem;
  font-weight: 700;
}

.promo-partner-badge.visible {
  display: inline-flex;
  animation: badgeSlide 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes badgeSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Pricing section ── */
.promo-pricing-section {
  padding: 1.75rem clamp(1rem, 4vw, 2rem) 2.5rem;
  max-width: 80rem;
  margin: 0 auto;
}

.promo-pricing-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.promo-pricing-header .eyebrow {
  color: #00AEEF;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.promo-pricing-header h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  color: #fff;
  margin: 0.5rem 0 0.75rem;
}

.promo-pricing-header .divider {
  width: 4rem;
  height: 3px;
  background: linear-gradient(90deg, #00AEEF, #2563eb);
  border-radius: 999px;
  margin: 0 auto;
}

/* Mobile: vertical stack, featured card first */
.promo-cards {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.promo-card {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1.5rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.35s, box-shadow 0.35s;
}

.promo-card.featured {
  order: -1;
  border-color: rgba(0, 174, 239, 0.45);
  box-shadow: 0 0 30px rgba(0, 174, 239, 0.12);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.85) 0%, rgba(2, 6, 23, 0.9) 100%);
}

.promo-card.discounted {
  border-color: rgba(37, 211, 102, 0.45);
  box-shadow: 0 0 32px rgba(37, 211, 102, 0.15);
}

.promo-card.discount-reveal {
  animation: cardDiscountReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardDiscountReveal {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(37, 211, 102, 0);
  }
  35% {
    transform: scale(1.025);
    box-shadow: 0 0 48px rgba(37, 211, 102, 0.35);
    border-color: rgba(37, 211, 102, 0.7);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 32px rgba(37, 211, 102, 0.15);
  }
}

.promo-card.featured.discount-reveal {
  animation-name: cardDiscountRevealFeatured;
}

@keyframes cardDiscountRevealFeatured {
  0% { transform: translateY(-0.75rem) scale(1); }
  35% { transform: translateY(-0.75rem) scale(1.03); box-shadow: 0 0 56px rgba(37, 211, 102, 0.4); }
  100% { transform: translateY(-0.75rem) scale(1); }
}

@media (max-width: 767px) {
  .promo-card.featured.discount-reveal {
    animation-name: cardDiscountReveal;
  }
}

.promo-pricing-section.discount-glow {
  animation: sectionGlow 1.2s ease-out;
}

@keyframes sectionGlow {
  0% { filter: brightness(1); }
  30% { filter: brightness(1.15); }
  100% { filter: brightness(1); }
}

.promo-price-new.price-pop {
  animation: pricePop 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pricePop {
  0% { transform: scale(0.6); opacity: 0; filter: blur(4px); }
  55% { transform: scale(1.12); opacity: 1; filter: blur(0); }
  100% { transform: scale(1); }
}

.promo-discount-tag.tag-pop {
  animation: tagPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

@keyframes tagPop {
  0% { transform: scale(0) rotate(-12deg); opacity: 0; }
  70% { transform: scale(1.15) rotate(3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.promo-activate-section.activated {
  animation: activatePulse 0.8s ease-out;
  border-bottom-color: rgba(37, 211, 102, 0.4);
}

@keyframes activatePulse {
  0% { box-shadow: inset 0 0 0 rgba(37, 211, 102, 0); }
  40% { box-shadow: inset 0 -3px 24px rgba(37, 211, 102, 0.25); }
  100% { box-shadow: inset 0 0 0 rgba(37, 211, 102, 0); }
}

.promo-flash {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  background: radial-gradient(circle at 50% 30%, rgba(37, 211, 102, 0.35) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

.promo-flash.active {
  opacity: 1;
  animation: flashFade 0.9s ease-out forwards;
}

@keyframes flashFade {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

.promo-sparkles {
  position: fixed;
  inset: 0;
  z-index: 91;
  pointer-events: none;
  overflow: hidden;
}

.sparkle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #25D366, 0 0 16px rgba(37, 211, 102, 0.6);
  animation: sparkleFly 1s ease-out forwards;
}

.sparkle:nth-child(odd) {
  background: #25D366;
  width: 4px;
  height: 4px;
}

@keyframes sparkleFly {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--tx), var(--ty)) scale(0);
  }
}

.promo-card-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 0.375rem;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  color: #9ca3af;
}

.promo-card.featured .promo-card-badge {
  background: rgba(0, 174, 239, 0.12);
  color: #00AEEF;
}

.promo-featured-tag {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  background: #00AEEF;
  color: #020617;
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: -2rem auto 1rem;
  width: fit-content;
  box-shadow: 0 0 15px rgba(0, 174, 239, 0.4);
}

.promo-card.featured .promo-featured-tag {
  display: flex;
}

.promo-card-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 0.75rem;
}

/* Price animation container */
.promo-price-wrap {
  position: relative;
  min-height: 3.5rem;
  height: auto;
  overflow: visible;
  margin-bottom: 0.35rem;
}

.promo-card.discounted .promo-price-wrap {
  min-height: 5.25rem;
}

.promo-card[data-course="bundle"] .promo-price-row.original {
  display: none;
}

.promo-card[data-course="bundle"] .promo-price-row.discounted {
  position: relative;
  transform: none;
  opacity: 1;
}

.promo-card[data-course="bundle"] .promo-discount-tag {
  opacity: 1;
  transform: scale(1);
}

.promo-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  width: 100%;
  overflow: visible;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s;
}

.promo-price-row.original {
  position: absolute;
  top: 0;
  left: 0;
}

.promo-price-row.discounted {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(100%);
  opacity: 0;
}

.promo-card.discounted .promo-price-row.original {
  transform: translateY(-100%);
  opacity: 0;
}

.promo-card.discounted .promo-price-row.discounted {
  transform: translateY(0);
  opacity: 1;
}

.promo-price {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 2.25rem;
  color: #00AEEF;
  line-height: 1;
}

.promo-price-new {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 2.25rem;
  color: #4ade80;
  line-height: 1;
  text-shadow: 0 0 20px rgba(74, 222, 128, 0.35);
}

.promo-currency {
  font-size: 1.1rem;
  font-weight: 700;
}

.promo-discount-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.375rem;
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  font-size: 0.68rem;
  font-weight: 800;
  margin-left: 0;
  flex: 0 0 auto;
  white-space: nowrap;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s 0.2s, transform 0.4s 0.2s;
}

.promo-price-row.discounted .promo-discount-tag {
  flex-basis: 100%;
  width: fit-content;
}

.promo-card.discounted .promo-discount-tag {
  opacity: 1;
  transform: scale(1);
}

.promo-lessons {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.promo-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 1rem;
}

.promo-card.featured .promo-divider {
  background: rgba(0, 174, 239, 0.15);
}

.promo-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  flex: 1;
}

.promo-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: #d1d5db;
  margin-bottom: 0.65rem;
  line-height: 1.4;
}

.promo-features li i {
  color: #00AEEF;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.promo-register-btn {
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 0.875rem;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.promo-register-btn:hover {
  background: #20bd5a;
  box-shadow: 0 0 28px rgba(37, 211, 102, 0.5);
  transform: translateY(-1px);
}

.promo-register-btn:active {
  transform: scale(0.98);
}

.promo-card.featured .promo-register-btn {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #fff;
}

.promo-card.featured .promo-register-btn:hover {
  box-shadow: 0 0 32px rgba(37, 211, 102, 0.55);
}

/* ── Compact header ── */
.promo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem clamp(1rem, 4vw, 1.5rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.promo-header-logo img {
  height: 44px;
  width: auto;
}

.promo-header-back {
  color: #9ca3af;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s;
}

.promo-header-back:hover {
  color: #00AEEF;
}

/* ── Modal (mobile-optimized) ── */
.promo-modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.promo-modal-root.hidden {
  display: none;
}

.promo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.promo-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  max-height: 92dvh;
  overflow-y: auto;
  border-radius: 1.5rem 1.5rem 0 0;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(0, 174, 239, 0.25);
  border-bottom: none;
  animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.promo-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.promo-form-group {
  margin-bottom: 1rem;
}

.promo-form-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ca3af;
  margin-bottom: 0.35rem;
}

.promo-form-input {
  width: 100%;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  color: #fff;
  font-size: 0.9rem;
}

.promo-form-input:focus {
  outline: none;
  border-color: #00AEEF;
}

.promo-price-summary {
  background: rgba(0, 174, 239, 0.08);
  border: 1px solid rgba(0, 174, 239, 0.2);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.promo-price-summary .line {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  color: #9ca3af;
}

.promo-price-summary .total {
  display: flex;
  justify-content: space-between;
  font-weight: 800;
  color: #4ade80;
  font-size: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.promo-submit-btn {
  width: 100%;
  padding: 1rem;
  border: none;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: box-shadow 0.25s, transform 0.15s;
}

.promo-submit-btn:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(37, 211, 102, 0.5);
}

.promo-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toast */
.promo-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 200;
  background: #00AEEF;
  color: #020617;
  padding: 0.85rem 1.25rem;
  border-radius: 0.875rem;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 10px 30px rgba(0, 174, 239, 0.35);
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: calc(100vw - 2rem);
  text-align: center;
}

.promo-toast.show {
  transform: translateX(-50%) translateY(0);
}

.promo-toast.success {
  background: #25D366;
  color: #fff;
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
}

/* ── Desktop overrides ── */
@media (min-width: 768px) {
  .promo-input-row {
    flex-direction: row;
  }

  .promo-activate-btn {
    width: auto;
    min-width: 10rem;
    flex-shrink: 0;
  }

  .promo-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: stretch;
  }

  .promo-card.featured {
    order: 0;
    transform: translateY(-0.75rem);
  }

  .promo-card {
    padding: 2rem;
  }

  .promo-modal-root {
    align-items: center;
  }

  .promo-modal-panel {
    border-radius: 1.5rem;
    border-bottom: 1px solid rgba(0, 174, 239, 0.25);
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
  }
}

@media (min-width: 1024px) {
  .promo-activate-section {
    position: relative;
    top: auto;
    background: transparent;
    border-bottom: none;
    padding-top: 2rem;
  }

  .promo-activate-inner {
    max-width: 32rem;
  }
}
