/* =========================================================
   SEÇÃO DE PLANOS E SERVIÇOS & MODAL DETALHADO (7SD)
   ========================================================= */

.plans-section {
  position: relative;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 110px 0;
}

.plans-section .section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 48px;
  gap: 30px;
}

.plans-section .section-head h2 {
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
  margin-top: 12px;
  letter-spacing: -0.04em;
  color: #ffffff;
}

.plans-section .section-head-desc {
  max-width: 440px;
  color: var(--muted, #c9c6d5);
  font-size: 15px;
  line-height: 1.68;
  margin: 0;
}

/* Grid de Planos - 100% Adaptativo, Flexível e Centralizado */
.plans-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  position: relative;
  z-index: 2;
  width: 100%;
  justify-content: center;
  align-items: stretch;
}

/* Tablet: 2 colunas equilibradas (640px a 991px) */
@media (min-width: 640px) and (max-width: 991px) {
  .plans-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    max-width: 100%;
  }
}

/* Desktop: Colunas baseadas na contagem de planos (>= 992px) */
@media (min-width: 992px) {
  .plans-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  /* Quando há 5 ou mais planos visíveis */
  .plans-grid[data-count="5"],
  .plans-grid.plans-count-5,
  .plans-grid:has(> .plan-card:nth-child(5)) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  /* Quando há 4 planos visíveis: ocupam o container completamente em 4 colunas */
  .plans-grid[data-count="4"],
  .plans-grid.plans-count-4,
  .plans-grid:has(> .plan-card:nth-child(4):last-child) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  /* Quando há 3 planos visíveis: ocupam o container completamente em 3 colunas */
  .plans-grid[data-count="3"],
  .plans-grid.plans-count-3,
  .plans-grid:has(> .plan-card:nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  /* Quando há 2 planos visíveis: 2 colunas equilibradas e centralizadas */
  .plans-grid[data-count="2"],
  .plans-grid.plans-count-2,
  .plans-grid:has(> .plan-card:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Quando há 1 plano visível: 1 coluna centralizada */
  .plans-grid[data-count="1"],
  .plans-grid.plans-count-1,
  .plans-grid:has(> .plan-card:nth-child(1):last-child) {
    grid-template-columns: minmax(280px, 480px);
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Card Individual de Plano */
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(145deg, rgba(35, 16, 58, 0.45), rgba(15, 8, 26, 0.7));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 28px 24px 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.7s ease,
              filter 0.7s ease,
              border-color 0.35s ease,
              box-shadow 0.35s ease,
              background 0.35s ease;
  overflow: hidden;
}

.plan-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(184, 107, 255, 0.4), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.plan-card:hover {
  transform: translateY(-7px);
  border-color: rgba(184, 107, 255, 0.45);
  box-shadow: 0 16px 40px rgba(123, 46, 255, 0.18),
              0 0 25px rgba(184, 107, 255, 0.1);
  background: linear-gradient(145deg, rgba(46, 20, 77, 0.6), rgba(19, 10, 33, 0.85));
}

.plan-card:hover::before {
  opacity: 1;
}

.plan-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.plan-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(184, 107, 255, 0.12);
  border: 1px solid rgba(184, 107, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--h, #b86bff);
  transition: transform 0.3s ease, background 0.3s ease;
}

.plan-card:hover .plan-icon-wrapper {
  transform: scale(1.08) rotate(-4deg);
  background: rgba(184, 107, 255, 0.22);
  border-color: rgba(184, 107, 255, 0.5);
  box-shadow: 0 0 16px rgba(184, 107, 255, 0.3);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-radius: 999px;
  background: rgba(184, 107, 255, 0.12);
  border: 1px solid rgba(184, 107, 255, 0.3);
  color: #e4c4ff;
}

.plan-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.plan-title {
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 10px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.plan-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted, #c9c6d5);
  margin: 0 0 24px;
  min-height: 58px;
}

/* Área de Preço */
.plan-price-wrapper {
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 20px;
}

.plan-price-prefix {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #9d94aa;
  display: block;
  margin-bottom: 3px;
}

.plan-price-value {
  font-size: 26px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.plan-price-value span.period {
  font-size: 13px;
  font-weight: 500;
  color: #c9c6d5;
}

/* Botão [ CONHECER ] */
.plan-btn-trigger {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7b2eff, #9a49ff);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(123, 46, 255, 0.28);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.plan-btn-trigger:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(154, 73, 255, 0.45);
  background: linear-gradient(135deg, #8a42ff, #a95eff);
  border-color: rgba(255, 255, 255, 0.3);
}

.plan-btn-trigger svg {
  width: 15px;
  height: 15px;
  transition: transform 0.25s ease;
}

.plan-btn-trigger:hover svg {
  transform: translateX(3px);
}

/* =========================================================
   POPUP MODAL DE DETALHES DO PLANO (7SD TIERS & FEATURES)
   ========================================================= */

.plan-modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: rgba(6, 3, 12, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s ease;
}

.plan-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.plan-modal-container {
  width: min(1080px, 100%);
  max-height: 92vh;
  background: #110920;
  background-image: radial-gradient(circle at 50% 0%, rgba(123, 46, 255, 0.18), transparent 60%);
  border: 1px solid rgba(184, 107, 255, 0.35);
  border-radius: 24px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.75),
              0 0 50px rgba(123, 46, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.plan-modal-overlay.is-active .plan-modal-container {
  transform: scale(1) translateY(0);
}

/* Modal Header */
.plan-modal-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.plan-modal-header-info {
  flex: 1;
}

.plan-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #c48eff;
  margin-bottom: 8px;
}

.plan-modal-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b86bff;
  box-shadow: 0 0 8px #b86bff;
}

.plan-modal-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 8px;
  letter-spacing: -0.03em;
}

.plan-modal-subtitle {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted, #c9c6d5);
  margin: 0;
  max-width: 740px;
}

.plan-modal-close {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e5e0ee;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.plan-modal-close:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
  transform: rotate(90deg);
}

/* Modal Body / Scrollable Content */
.plan-modal-body {
  padding: 28px 32px;
  overflow-y: auto;
  max-height: calc(92vh - 120px);
}

.plan-modal-body::-webkit-scrollbar {
  width: 6px;
}
.plan-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
.plan-modal-body::-webkit-scrollbar-thumb {
  background: rgba(184, 107, 255, 0.3);
  border-radius: 4px;
}
.plan-modal-body::-webkit-scrollbar-thumb:hover {
  background: rgba(184, 107, 255, 0.6);
}

/* Tiers Grid inside Modal */
.plan-tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
  align-items: stretch;
}

/* Single Tier Card inside Modal */
.plan-tier-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.3s ease;
}

.plan-tier-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(184, 107, 255, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* Popular / Featured Tier */
.plan-tier-card.is-popular {
  background: linear-gradient(180deg, rgba(123, 46, 255, 0.16), rgba(25, 12, 42, 0.85));
  border: 1.5px solid rgba(184, 107, 255, 0.65);
  box-shadow: 0 10px 35px rgba(123, 46, 255, 0.22),
              0 0 25px rgba(184, 107, 255, 0.15);
}

.plan-tier-popular-tag {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #7b2eff, #b86bff);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 4px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(123, 46, 255, 0.4);
  white-space: nowrap;
}

.plan-tier-name {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px;
}

.plan-tier-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted, #c9c6d5);
  margin: 0 0 18px;
  min-height: 40px;
}

.plan-tier-price-box {
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.plan-tier-price {
  font-size: 30px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.plan-tier-price .tier-period {
  font-size: 14px;
  font-weight: 500;
  color: #c9c6d5;
}

/* Features List */
.plan-tier-features {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.plan-tier-features li {
  font-size: 12.5px;
  line-height: 1.5;
  color: #e2dcf0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.plan-tier-features li svg {
  width: 16px;
  height: 16px;
  color: #10b981;
  flex-shrink: 0;
  margin-top: 2px;
}

/* CTA Button inside Tier */
.plan-tier-cta {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 12px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.plan-tier-card.is-popular .plan-tier-cta {
  background: linear-gradient(135deg, #7b2eff, #a855f7);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(123, 46, 255, 0.35);
}

.plan-tier-card.is-popular .plan-tier-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(154, 73, 255, 0.5);
  background: linear-gradient(135deg, #8a3eff, #b969ff);
}

.plan-tier-card:not(.is-popular) .plan-tier-cta {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.plan-tier-card:not(.is-popular) .plan-tier-cta:hover {
  background: rgba(184, 107, 255, 0.2);
  border-color: rgba(184, 107, 255, 0.5);
  transform: translateY(-2px);
  color: #ffffff;
}

.plan-tier-cta svg {
  width: 16px;
  height: 16px;
}

/* Bottom Note inside Modal */
.plan-modal-footer-note {
  margin-top: 24px;
  padding: 18px 24px;
  border-radius: 14px;
  background: rgba(123, 46, 255, 0.08);
  border: 1px dashed rgba(184, 107, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.plan-modal-footer-note p {
  margin: 0;
  font-size: 13px;
  color: #c9c6d5;
  line-height: 1.5;
}

.plan-modal-footer-note p strong {
  color: #ffffff;
}

.plan-modal-footer-note a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--h, #b86bff);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s ease;
}

.plan-modal-footer-note a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* =========================================================
   RESPONSIVIDADE (TABLET & MOBILE)
   ========================================================= */

@media (max-width: 991px) and (min-width: 640px) {
  .plans-grid,
  .plans-grid[data-count],
  .plans-grid[class*="plans-count-"],
  .plans-grid:has(> .plan-card) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    max-width: 100%;
  }
}

@media (max-width: 639px) {
  .plans-section {
    padding: 70px 0;
  }

  .plans-section .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
  }

  .plans-grid,
  .plans-grid[data-count],
  .plans-grid[class*="plans-count-"],
  .plans-grid:has(> .plan-card) {
    grid-template-columns: 1fr !important;
    gap: 18px;
    max-width: 100%;
  }

  .plan-card {
    padding: 24px 20px;
    max-width: 100%;
  }

  .plan-title {
    font-size: 20px;
    line-height: 1.3;
  }

  .plan-desc {
    min-height: auto;
    margin-bottom: 18px;
    font-size: 13.5px;
    line-height: 1.55;
  }

  .plan-price-wrapper {
    margin-top: 10px;
    padding-top: 16px;
    margin-bottom: 18px;
  }

  .plan-price-value {
    font-size: 28px;
  }

  .plan-btn-trigger {
    padding: 14px 20px;
    font-size: 13px;
  }

  .plan-modal-overlay {
    padding: 12px;
  }

  .plan-modal-container {
    max-height: 94vh;
    border-radius: 18px;
  }

  .plan-modal-header {
    padding: 20px 20px 16px;
  }

  .plan-modal-body {
    padding: 20px;
    max-height: calc(94vh - 100px);
  }

  .plan-tiers-grid {
    grid-template-columns: 1fr !important;
  }
}
