/* =========================================================
   Club MG - Página cliente
   Archivo: assets/css/club-mg.css
   ========================================================= */

.mg-page-club {
  min-height: 100vh;
}

/* Layout general */
.mg-club-main {
  padding-top: 92px;
  padding-bottom: 4rem;
  overflow: hidden;
}

.mg-club-hero {
  padding-top: 2rem;
}

.mg-club-hero-card,
.mg-club-login-card,
.mg-club-balance-card,
.mg-club-saved-card,
.mg-club-history-card,
.mg-club-info-card,
.mg-club-beta-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background:
    radial-gradient(circle at top left, rgba(0, 184, 148, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.035));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
  border-radius: 28px;
}

.mg-club-hero-card {
  position: relative;
  padding: 1.35rem;
}

.mg-club-hero-card::before {
  content: "";
  position: absolute;
  inset: -120px -120px auto auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(0, 184, 148, 0.16);
  filter: blur(18px);
  pointer-events: none;
}

.mg-club-pill,
.mg-club-code {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.mg-club-pill {
  padding: 0.48rem 0.78rem;
  color: #041b14;
  background: linear-gradient(135deg, #63f0be, #16c784);
  box-shadow: 0 12px 28px rgba(22, 199, 132, 0.26);
}

.mg-club-title {
  max-width: 680px;
  margin: 1rem 0 0.8rem;
  font-size: clamp(2rem, 5.2vw, 4.15rem);
  line-height: 0.98;
  font-weight: 850;
  letter-spacing: -0.055em;
}

.mg-club-lead {
  max-width: 630px;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.65;
  opacity: 0.82;
}

/* Beneficios */
.mg-club-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.3rem;
}

.mg-club-benefit {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.62rem 0.78rem;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.09);
}

.mg-club-benefit i {
  color: #29d391;
}

/* Login */
.mg-club-login-card {
  position: relative;
  z-index: 1;
  padding: 1.15rem;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.045));
}

.mg-club-login-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 850;
  letter-spacing: -0.025em;
}

.mg-club-login-card p {
  margin: 0 0 1rem;
  line-height: 1.5;
  opacity: 0.76;
}

.mg-club-form .form-label {
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.mg-club-form .form-control {
  min-height: 48px;
  border-radius: 15px;
  font-weight: 700;
}

.mg-club-form .form-text {
  font-size: 0.78rem;
  opacity: 0.7;
}

.mg-club-submit {
  min-height: 50px;
  border-radius: 16px;
  font-weight: 850;
}

.mg-club-message {
  margin-top: 0.8rem;
  padding: 0.75rem 0.85rem;
  border-radius: 16px;
  font-size: 0.88rem;
  font-weight: 700;
}

.mg-club-message.is-error {
  color: #ffd9d9;
  background: rgba(255, 77, 77, 0.14);
  border: 1px solid rgba(255, 77, 77, 0.22);
}

.mg-club-message.is-ok {
  color: #d8ffe9;
  background: rgba(22, 199, 132, 0.14);
  border: 1px solid rgba(22, 199, 132, 0.22);
}

/* Resultado */
.mg-club-result {
  padding-top: 1.4rem;
}

.mg-club-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding: 0 0.15rem;
}

.mg-club-small-label,
.mg-club-card-label {
  display: block;
  color: #29d391;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mg-club-welcome h2 {
  margin: 0.08rem 0 0;
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.mg-club-code {
  padding: 0.55rem 0.82rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
}

/* Cards de saldo */
.mg-club-balance-card,
.mg-club-saved-card,
.mg-club-history-card,
.mg-club-info-card {
  height: 100%;
  padding: 1.15rem;
}

.mg-club-balance-card {
  background:
    radial-gradient(circle at top right, rgba(22, 199, 132, 0.30), transparent 42%),
    linear-gradient(180deg, rgba(22, 199, 132, 0.18), rgba(255,255,255,0.045));
}

.mg-club-balance-card strong {
  display: block;
  margin: 0.22rem 0 0.35rem;
  font-size: clamp(2.6rem, 9vw, 5rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.07em;
}

.mg-club-saved-card strong {
  display: block;
  margin: 0.2rem 0 0.4rem;
  font-size: clamp(2rem, 6vw, 3.35rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.06em;
}

.mg-club-balance-card p,
.mg-club-saved-card p,
.mg-club-info-card p {
  margin: 0;
  line-height: 1.55;
  opacity: 0.78;
}

.mg-club-wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 52px;
  margin-top: 1rem;
  border-radius: 17px;
  font-weight: 850;
}

/* Historial */
.mg-club-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.mg-club-section-head h3,
.mg-club-info-card h3 {
  margin: 0.08rem 0 0;
  font-size: 1.22rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.mg-club-history-list {
  display: grid;
  gap: 0.65rem;
}

.mg-club-movement {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.78rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
}

.mg-club-movement-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: rgba(255,255,255,0.08);
}

.mg-club-movement-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.25;
}

.mg-club-movement-date {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.76rem;
  opacity: 0.68;
}

.mg-club-movement-amount {
  font-size: 0.98rem;
  font-weight: 900;
  white-space: nowrap;
}

.mg-club-movement.is-credit .mg-club-movement-amount,
.mg-club-movement.is-credit .mg-club-movement-icon {
  color: #29d391;
}

.mg-club-movement.is-debit .mg-club-movement-amount,
.mg-club-movement.is-debit .mg-club-movement-icon {
  color: #ffb86b;
}

.mg-club-empty {
  padding: 1rem;
  border-radius: 18px;
  font-weight: 700;
  line-height: 1.45;
  opacity: 0.72;
  background: rgba(255,255,255,0.05);
  border: 1px dashed rgba(255,255,255,0.16);
}

/* Cómo funciona */
.mg-club-steps {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.mg-club-steps li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem;
  border-radius: 18px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
  font-weight: 750;
}

.mg-club-steps i {
  display: grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  border-radius: 14px;
  color: #29d391;
  background: rgba(41, 211, 145, 0.12);
}

.mg-club-note {
  margin-top: 0.9rem;
  padding: 0.8rem;
  border-radius: 18px;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
  color: #f6e7bb;
  background: rgba(255, 193, 7, 0.10);
  border: 1px solid rgba(255, 193, 7, 0.20);
}

/* Beta */
.mg-club-beta {
  padding-top: 1.4rem;
}

.mg-club-beta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.15rem;
}

.mg-club-beta-card h2 {
  margin: 0.08rem 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.035em;
}

.mg-club-beta-card p {
  margin: 0;
  line-height: 1.55;
  opacity: 0.78;
}

.mg-club-beta-card .btn {
  flex: 0 0 auto;
  border-radius: 16px;
  font-weight: 850;
}

/* =========================================================
   Light theme
   ========================================================= */

html:not(.mg-theme-dark) .mg-page-club {
  background: #f5f7fb;
  color: #121826;
}

html:not(.mg-theme-dark) .mg-club-hero-card,
html:not(.mg-theme-dark) .mg-club-login-card,
html:not(.mg-theme-dark) .mg-club-balance-card,
html:not(.mg-theme-dark) .mg-club-saved-card,
html:not(.mg-theme-dark) .mg-club-history-card,
html:not(.mg-theme-dark) .mg-club-info-card,
html:not(.mg-theme-dark) .mg-club-beta-card {
  border-color: rgba(18, 24, 38, 0.08);
  background:
    radial-gradient(circle at top left, rgba(22, 199, 132, 0.13), transparent 38%),
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,255,255,0.82));
  box-shadow: 0 18px 46px rgba(25, 35, 60, 0.10);
}

html:not(.mg-theme-dark) .mg-club-benefit,
html:not(.mg-theme-dark) .mg-club-code,
html:not(.mg-theme-dark) .mg-club-movement,
html:not(.mg-theme-dark) .mg-club-steps li {
  background: rgba(18, 24, 38, 0.035);
  border-color: rgba(18, 24, 38, 0.08);
}

html:not(.mg-theme-dark) .mg-club-empty {
  background: rgba(18, 24, 38, 0.03);
  border-color: rgba(18, 24, 38, 0.14);
}

html:not(.mg-theme-dark) .mg-club-message.is-error {
  color: #9d1f1f;
  background: rgba(255, 77, 77, 0.10);
  border-color: rgba(255, 77, 77, 0.18);
}

html:not(.mg-theme-dark) .mg-club-message.is-ok {
  color: #087648;
  background: rgba(22, 199, 132, 0.10);
  border-color: rgba(22, 199, 132, 0.18);
}

html:not(.mg-theme-dark) .mg-club-note {
  color: #7a5500;
  background: rgba(255, 193, 7, 0.12);
  border-color: rgba(255, 193, 7, 0.24);
}

/* =========================================================
   Responsive
   ========================================================= */

@media (min-width: 768px) {
  .mg-club-hero {
    padding-top: 3rem;
  }

  .mg-club-hero-card {
    padding: 2rem;
  }

  .mg-club-login-card,
  .mg-club-balance-card,
  .mg-club-saved-card,
  .mg-club-history-card,
  .mg-club-info-card,
  .mg-club-beta-card {
    padding: 1.4rem;
  }

  .mg-club-wa-btn {
    width: auto;
    min-width: 230px;
  }
}

@media (max-width: 767.98px) {
  .mg-club-main {
    padding-top: 78px;
    padding-bottom: 2.8rem;
  }

  .mg-club-hero {
    padding-top: 1rem;
  }

  .mg-club-hero-card {
    border-radius: 24px;
  }

  .mg-club-title {
    margin-top: 0.85rem;
  }

  .mg-club-benefits {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mg-club-benefit {
    justify-content: flex-start;
    border-radius: 18px;
  }

  .mg-club-login-card {
    margin-top: 0.25rem;
  }

  .mg-club-welcome {
    align-items: flex-start;
    flex-direction: column;
  }

  .mg-club-code {
    align-self: flex-start;
  }

  .mg-club-balance-card strong {
    font-size: 3.25rem;
  }

  .mg-club-movement {
    grid-template-columns: 38px 1fr;
  }

  .mg-club-movement-icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
  }

  .mg-club-movement-amount {
    grid-column: 2;
    justify-self: start;
    margin-top: -0.25rem;
  }

  .mg-club-beta-card {
    align-items: stretch;
    flex-direction: column;
  }

  .mg-club-beta-card .btn {
    width: 100%;
  }
}

/* =========================================================
   Club MG - Accordions
   ========================================================= */

.mg-club-accordion-card {
  padding: 0;
  overflow: hidden;
}

.mg-club-accordion-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem;
  border: 0;
  color: inherit;
  text-align: left;
  background: transparent;
}

.mg-club-accordion-btn strong {
  display: block;
  margin-top: 0.08rem;
  font-size: 1.22rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.mg-club-accordion-btn i {
  display: grid;
  place-items: center;
  width: 38px;
  min-width: 38px;
  height: 38px;
  border-radius: 14px;
  color: #29d391;
  background: rgba(41, 211, 145, 0.12);
  transition: transform 0.22s ease, background 0.22s ease;
}

.mg-club-accordion-btn:not(.collapsed) i {
  transform: rotate(180deg);
  background: rgba(41, 211, 145, 0.20);
}

.mg-club-accordion-body {
  padding: 0 1.15rem 1.15rem;
}

/* Mejor tacto en mobile */
@media (max-width: 767.98px) {
  .mg-club-accordion-btn {
    padding: 1rem;
  }

  .mg-club-accordion-btn strong {
    font-size: 1.08rem;
  }

  .mg-club-accordion-body {
    padding: 0 1rem 1rem;
  }
}

/* Corrige altura del accordion cerrado en desktop */
.mg-club-history-card.mg-club-accordion-card {
  height: auto;
  min-height: 0;
  align-self: flex-start;
}

/* =========================================================
   Club MG - Scroll interno de movimientos
   ========================================================= */

.mg-club-history-list {
  max-height: 430px;
  overflow-y: auto;
  padding-right: 0.25rem;
  scrollbar-width: thin;
}

/* Chrome / Edge */
.mg-club-history-list::-webkit-scrollbar {
  width: 7px;
}

.mg-club-history-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
}

.mg-club-history-list::-webkit-scrollbar-thumb {
  background: rgba(41, 211, 145, 0.45);
  border-radius: 999px;
}

.mg-club-history-list::-webkit-scrollbar-thumb:hover {
  background: rgba(41, 211, 145, 0.7);
}

@media (max-width: 767.98px) {
  .mg-club-history-list {
    max-height: 360px;
  }
}

/* =========================================================
   Club MG - Accordion Cómo funciona
   ========================================================= */

.mg-club-info-accordion-card {
  height: auto;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  align-self: flex-start;
}

.mg-club-info-top {
  padding: 0;
}

.mg-club-info-toggle {
  padding-bottom: 0.75rem;
}

.mg-club-info-accordion-card .mg-club-order-btn {
  width: calc(100% - 2.3rem) !important;
  margin: 0 1.15rem 1.15rem;
  min-height: 50px;
  border-radius: 16px;
  font-weight: 850;
}

.mg-club-info-accordion-card .mg-club-steps {
  margin-top: 0;
}

.mg-club-info-accordion-card .mg-club-note {
  margin-top: 0.85rem;
}

@media (max-width: 767.98px) {
  .mg-club-info-accordion-card .mg-club-order-btn {
    width: calc(100% - 2rem) !important;
    margin: 0 1rem 1rem;
  }
}

/* Ajuste botón "Hacer un pedido" dentro de Cómo funciona */
.mg-club-info-accordion-card .mg-club-order-btn {
  min-height: 42px;
  height: 42px;
  padding: 0.45rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Login Club MG más compacto */
.mg-club-login-card h2 {
  margin-bottom: 1rem;
}

@media (max-width: 767.98px) {
  .mg-club-login-card h2 {
    font-size: 1.55rem;
  }
}

/* Mobile: compactar beneficios del hero */
@media (max-width: 767.98px) {
  .mg-club-benefits {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .mg-club-benefit {
    min-height: 52px;
    justify-content: center;
    padding: 0.58rem 0.55rem;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1.15;
    border-radius: 18px;
  }

  .mg-club-benefit:nth-child(3) {
    grid-column: 1 / -1;
    justify-self: center;
    width: min(100%, 285px);
  }
}