/* ===============================
   GLOBAL SAFETY
================================ */
*,
*::before,
*::after{
  box-sizing: border-box;
}

html, body{
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ===============================
   THEME TOKENS (FINAL)
================================ */
:root{
  --bg-main:#0b0d13;
  --panel:#141827;
  --panel2:#10131d;

  --text:#f2f4fa;
  --muted:#aab0c4;

  --border:rgba(255,255,255,.08);
  --shadow:0 14px 40px rgba(0,0,0,.45);

  --accent:#ffd200;

  --cta1:#c0bd16;
  --cta2:#ffab4b;

  --radius:18px;
}

/* ===============================
   PAGE CONTAINER
================================ */
.main-content .container{
  max-width: 1200px;
  margin: 0 auto;
  padding: 38px 18px 60px;
  width: 100%;
}

.topup-title{
  text-align:center;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 900;
  color: var(--text);
  margin-bottom: 26px;
  text-shadow: 0 10px 35px rgba(0,0,0,.6);
}

/* ===============================
   COUPON BAR (DESKTOP)
================================ */
.coupon-box{
  width: fit-content;
  max-width: 100%;
  margin: 0 0 28px 0;
  padding: 12px;
  border-radius: 999px;

  display: inline-flex;
  gap: 10px;
  align-items: center;

  background: linear-gradient(180deg, rgba(25,30,48,.95), rgba(16,19,30,.95));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.coupon-box input{
  width: 260px; /* fixed desktop */
  height: 44px;
  border-radius: 999px;
  padding: 0 14px;

  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: var(--text);
  outline: none;
  min-width: 0;
}

.coupon-box button,
.coupon-clear{
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;

  background: var(--accent);
  color: #0b0b0b;
  font-weight: 900;

  transition: transform .15s ease, filter .15s ease;
}

.coupon-box button:hover,
.coupon-clear:hover{
  transform: translateY(-2px);
  filter: brightness(1.02);
}

#couponFeedback{
  margin: 0;
  white-space: nowrap;
  color: #22c55e;
  font-weight: 800;
  font-size: 13px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===============================
   GRID
================================ */
.topup-cards{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  align-items: stretch;
  width: 100%;
  margin: 0;          /* ✅ NO margin-right here */
  padding: 0;
}

/* ===============================
   CARD
================================ */
.card{
  position: relative;

  background: linear-gradient(180deg, #151a27, #0f1320);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);

  padding: 22px 22px 18px;

  display:flex;
  flex-direction: column;
  min-height: 330px;

  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.card:hover{
  transform: translateY(-6px);
  border-color: rgba(255,210,0,.18);
  box-shadow: 0 20px 55px rgba(0,0,0,.55);
}

.plan-head{ margin-bottom: 14px; }

.price-row{
  display:flex;
  align-items:center;
  gap: 10px;
}

/* ✅ PRICE (ONE SOURCE OF TRUTH) */
.price{
  font-size: 30px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: .3px;

  display: flex;
  align-items: baseline;
  gap: 10px;

  max-width: 100%;
  flex-wrap: wrap; /* ✅ long text wrap, no overflow */
}

.price.discounted{
  color: #22c55e;
}

.price span{
  font-size: 16px;
  font-weight: 700;
  color: rgba(242,244,250,.55);
  text-decoration: line-through;
}

.period{
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

.divider{
  height: 1px;
  background: rgba(255,255,255,.07);
  margin: 12px 0 14px;
}

/* features list */
.features{
  list-style:none;
  padding:0;
  margin: 0 0 18px;

  display:flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text);
}

.features li{
  display:flex;
  align-items:center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .15px;
}

.features li.ok::before{
  content:"✓";
  width: 22px;
  height: 22px;
  display:grid;
  place-items:center;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #ffffff;
  font-weight: 900;
}

.features li.lock{
  color: rgba(242,244,250,.55);
}
.features li.lock::before{
  content:"🔒";
  width: 22px;
  height: 22px;
  display:grid;
  place-items:center;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  filter: grayscale(1);
}

/* CTA */
.extend-btn{
  margin-top: auto;
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 10px;
  cursor:pointer;

  background: linear-gradient(90deg, var(--cta1), var(--cta2));
  color: #000;
  font-weight: 900;
  letter-spacing: .3px;

  transition: transform .15s ease, filter .15s ease;
}
.extend-btn:hover{ transform: translateY(-2px); filter: brightness(1.03); }
.extend-btn:active{ transform: translateY(0); }

/* Recommended */
.card.recommended{
  border-color: rgba(255,210,0,.28);
  box-shadow: 0 0 0 3px rgba(255,210,0,.10), var(--shadow);
}
.card.recommended::before{
  content:"Санал болгох";
  position:absolute;
  top: 8px;
  right: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,210,0,.12);
  border: 1px solid rgba(255,210,0,.28);
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

/* ===============================
   RESPONSIVE
================================ */

/* Tablet */
@media (min-width: 641px) and (max-width: 900px){
  .topup-cards{
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }
  .price{ font-size: 30px; }
}

/* Laptop */
@media (min-width: 901px) and (max-width: 1199px){
  .topup-cards{
    grid-template-columns: repeat(3, 1fr);
  }
  .price{ font-size: 32px; }
}

/* Large desktop */
@media (min-width: 1200px){
  .topup-cards{
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Mobile */
@media (max-width: 640px){
  .main-content .container{
    padding: 24px 12px 40px;
    max-width: 100%;
  }

  .topup-title{
    font-size: 24px;
    margin-bottom: 18px;
  }

  /* coupon => stack 100% */
  .coupon-box{
    width: 100%;
    max-width: 100%;
    margin: 0 auto 22px;
    display:flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
  }

  .coupon-box input{
    width: 100%;
  }

  .coupon-box button,
  .coupon-clear{
    width: 100%;
    border-radius: 12px;
  }

  #couponFeedback{
    width: 100%;
    text-align:center;
    white-space: normal; /* ✅ нэг мөр forced биш */
  }

  .topup-cards{
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .card{
    padding: 18px 16px 16px;
    min-height: auto;
  }

  .price{
    font-size: 26px;
  }

  .price span{
    font-size: 14px;
  }

  .features li{
    font-size: 13px;
  }

  .extend-btn{
    height: 44px;
    font-size: 14px;
  }
}

/* Small phones */
@media (max-width: 420px){
  .topup-title{ font-size: 22px; }
  .price{ font-size: 24px; }
  .features li{ font-size: 12.5px; }
  .extend-btn{ height: 42px; }
}
