/* ===================================================================
   UPGRADE MODAL - Mobile-First High-Converting Paywall & Plans
   =================================================================== */

/* ========== BACKDROP ========== */
.modal-upgrade-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  animation: modalFadeIn 0.25s ease-out;
}

.modal-upgrade-backdrop.modal-upgrade-active {
  display: flex !important;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== MODAL CONTENT CONTAINER ========== */
.modal-upgrade-content {
  position: relative;
  background: linear-gradient(180deg, #0f172a 0%, #090d16 100%);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 1.5rem;
  padding: 1.25rem 1rem;
  max-width: 460px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.85), 0 0 30px rgba(6, 182, 212, 0.15);
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-upgrade-content::-webkit-scrollbar {
  display: none;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========== TOP BAR (NO OVERLAPS) ========== */
.modal-upgrade-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  position: relative;
}

.modal-upgrade-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.modal-upgrade-close {
  width: 2rem;
  height: 2rem;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(71, 85, 105, 0.6);
  border-radius: 9999px;
  color: #94a3b8;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.modal-upgrade-close:hover,
.modal-upgrade-close:active {
  background: rgba(51, 65, 85, 0.9);
  color: #ffffff;
  transform: scale(0.95);
}

/* ========== HEADER ========== */
.modal-upgrade-header {
  text-align: left;
  margin-bottom: 1rem;
}

.modal-upgrade-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: #f8fafc;
  line-height: 1.25;
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.01em;
}

.modal-upgrade-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
  margin: 0;
}

/* ========== PLANS LIST ========== */
.modal-upgrade-plans {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

/* ========== PLAN CARD ========== */
.modal-upgrade-plan-card {
  position: relative;
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(51, 65, 85, 0.6);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.modal-upgrade-plan-card:active {
  transform: scale(0.99);
}

/* Card Variants */
.modal-upgrade-plan-emerald {
  background: rgba(6, 78, 59, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
}

.modal-upgrade-plan-cyan {
  background: rgba(8, 51, 68, 0.28);
  border-color: rgba(6, 182, 212, 0.55);
  box-shadow: 0 4px 20px -2px rgba(6, 182, 212, 0.15);
}

.modal-upgrade-plan-featured {
  border: 2px solid #06b6d4;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.25);
}

.modal-upgrade-plan-amber {
  background: rgba(69, 26, 3, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
}

.modal-upgrade-plan-amber.modal-upgrade-plan-featured {
  border: 2px solid #f59e0b;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.22);
}

/* Plan Top Row */
.modal-upgrade-plan-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.45rem;
}

.modal-upgrade-plan-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1 1 auto;
}

.modal-upgrade-plan-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.modal-upgrade-plan-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.modal-upgrade-plan-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.modal-upgrade-price-value {
  font-size: 1.15rem;
  font-weight: 900;
  color: #38bdf8;
  font-family: monospace, sans-serif;
  line-height: 1;
  white-space: nowrap;
}

.modal-upgrade-plan-emerald .modal-upgrade-price-value {
  color: #34d399;
}

.modal-upgrade-plan-amber .modal-upgrade-price-value {
  color: #fbbf24;
}

.modal-upgrade-price-period {
  font-size: 0.68rem;
  color: #94a3b8;
  white-space: nowrap;
}

/* Plan Badge */
.modal-upgrade-plan-badge {
  font-size: 0.6rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  max-width: 100%;
  flex-shrink: 0;
}

.modal-badge-emerald {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.modal-badge-cyan {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.modal-badge-amber {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

/* Features List */
.modal-upgrade-plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-upgrade-plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.72rem;
  color: #cbd5e1;
  line-height: 1.3;
}

.modal-upgrade-plan-features .check-icon {
  color: #34d399;
  font-weight: 900;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* CTA Buttons */
.modal-upgrade-plan-cta {
  width: 100%;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  margin-top: 0.25rem;
}

.modal-upgrade-plan-cta:active {
  transform: scale(0.97);
}

.modal-upgrade-cta-emerald {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #022c22;
}

.modal-upgrade-cta-cyan {
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  color: #082f49;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.modal-upgrade-cta-amber {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #451a03;
}

/* Free Tier Box */
.modal-upgrade-free-box {
  background: rgba(30, 41, 59, 0.4);
  border: 1px dashed rgba(71, 85, 105, 0.6);
  border-radius: 0.85rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
}

.modal-upgrade-free-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-upgrade-free-info .free-gift-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.modal-upgrade-free-info strong {
  display: block;
  font-size: 0.76rem;
  color: #e2e8f0;
}

.modal-upgrade-free-info p {
  font-size: 0.68rem;
  color: #94a3b8;
  margin: 0.1rem 0 0 0;
  line-height: 1.25;
}

/* Footer Trust */
.modal-upgrade-footer {
  text-align: center;
  border-top: 1px solid rgba(51, 65, 85, 0.5);
  padding-top: 0.65rem;
}

.modal-upgrade-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.66rem;
  color: #64748b;
}

/* ===================================================================
   CHECKOUT REAL EMBED (ASAAS)
   =================================================================== */
.modal-upgrade-checkout {
  animation: modalFadeIn 0.25s ease-out;
}

.modal-upgrade-checkout-header {
  text-align: center;
  margin-bottom: 1rem;
}

.modal-upgrade-checkout-header h3 {
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 0.25rem 0;
}

.modal-upgrade-checkout-header p {
  font-size: 0.8rem;
  color: #38bdf8;
  font-weight: 700;
  margin: 0;
}

/* ========== MODO CLARO — MODAL UPGRADE ========== */
html:not(.dark) .modal-upgrade-backdrop {
  background: rgba(15, 23, 42, 0.45);
}
html:not(.dark) .modal-upgrade-content {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
}
html:not(.dark) .modal-upgrade-close {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}
html:not(.dark) .modal-upgrade-title,
html:not(.dark) .modal-upgrade-checkout-header h3,
html:not(.dark) .modal-upgrade-free-info strong {
  color: #0f172a;
}
html:not(.dark) .modal-upgrade-subtitle,
html:not(.dark) .modal-upgrade-free-info p,
html:not(.dark) .modal-upgrade-trust {
  color: #475569;
}
html:not(.dark) .modal-upgrade-badge {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0369a1;
}
html:not(.dark) .modal-upgrade-plan-card {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}
html:not(.dark) .modal-upgrade-plan-name {
  color: #0f172a;
}
html:not(.dark) .modal-upgrade-price-period,
html:not(.dark) .modal-upgrade-plan-features li {
  color: #334155;
}
html:not(.dark) .modal-upgrade-plan-features .check-icon {
  color: #059669;
}
html:not(.dark) .modal-upgrade-plan-emerald {
  background: #ecfdf5;
  border-color: #6ee7b7;
}
html:not(.dark) .modal-upgrade-plan-emerald .modal-upgrade-price-value {
  color: #047857;
}
html:not(.dark) .modal-badge-emerald {
  background: #d1fae5;
  border-color: #34d399;
  color: #065f46;
}
html:not(.dark) .modal-upgrade-plan-cyan {
  background: #f0f9ff;
  border-color: #7dd3fc;
  box-shadow: 0 4px 16px -4px rgba(2, 132, 199, 0.14);
}
html:not(.dark) .modal-upgrade-plan-cyan .modal-upgrade-price-value {
  color: #0369a1;
}
html:not(.dark) .modal-upgrade-plan-amber {
  background: #fffbeb;
  border-color: #f59e0b;
  box-shadow: 0 4px 18px -4px rgba(217, 119, 6, 0.18);
}
html:not(.dark) .modal-upgrade-plan-amber .modal-upgrade-price-value {
  color: #b45309;
}
html:not(.dark) .modal-badge-amber {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}
html:not(.dark) .modal-upgrade-cta-emerald {
  background: linear-gradient(135deg, #059669, #047857);
  color: #ffffff;
}
html:not(.dark) .modal-upgrade-cta-cyan {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
}
html:not(.dark) .modal-upgrade-cta-amber {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
}
html:not(.dark) .modal-upgrade-free-box {
  background: #f8fafc;
  border-color: #cbd5e1;
}
html:not(.dark) .modal-upgrade-footer {
  border-color: #e2e8f0;
}
