* {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
}

:root {
   --background: 220 25% 8%;
   --card: 220 20% 12%;
   --card-foreground: 210 40% 98%;
   --primary: 220 90% 56%;
   --primary-foreground: 0 0% 100%;
   --secondary: 220 20% 15%;
   --muted: 220 15% 20%;
   --muted-foreground: 215 15% 65%;
   --accent: 142 76% 36%;
   --border: 220 15% 20%;
   --radius: 0.75rem;
}

body {
   background: hsl(var(--background));
   color: hsl(var(--foreground));
   line-height: 1.6;
   overflow-x: hidden;
}

/* Animations */
@keyframes fade-in {
   from {
      opacity: 0;
      transform: translateY(20px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

@keyframes scale-in {
   from {
      opacity: 0;
      transform: scale(0.95);
   }

   to {
      opacity: 1;
      transform: scale(1);
   }
}

@keyframes rotate-slow {
   from {
      transform: rotateY(0deg);
   }

   to {
      transform: rotateY(360deg);
   }
}

@keyframes pulse-glow {

   0%,
   100% {
      box-shadow: 0 0 20px hsla(220, 90%, 56%, 0.3);
   }

   50% {
      box-shadow: 0 0 40px hsla(220, 90%, 56%, 0.6);
   }
}

@keyframes float {

   0%,
   100% {
      transform: translateY(0px);
   }

   50% {
      transform: translateY(-10px);
   }
}

.animate-fade-in {
   animation: fade-in 0.6s ease-out;
}

.animate-scale-in {
   animation: scale-in 0.4s ease-out;
}

.animate-rotate-slow {
   animation: rotate-slow 15s linear infinite;
}

.animate-pulse-glow {
   animation: pulse-glow 8s ease-in-out infinite;
}

.animate-float {
   animation: float 3s ease-in-out infinite;
}

/* planos secao */
.planos {
   position: relative;
   min-height: 100vh;
   display: flex;
   align-items: center;
   justify-content: center;
   overflow: hidden;
   
}

.planos-bg {
   position: absolute;
   inset: 0;
   z-index: 0;
}

.planos-bg img {
   width: 100%;
   height: 100%;
   object-fit: cover;
}

.planos-overlay {
   position: absolute;
   inset: 0;
   background: linear-gradient(180deg,
         hsla(220, 25%, 8%, 0.95),
         hsla(220, 25%, 8%, 0.8),
         hsl(220, 25%, 8%));
}

.planos-grid {
   position: absolute;
   inset: 0;
   z-index: 1;
   opacity: 0.1;
   background-image:
      linear-gradient(hsl(var(--primary)) 1px, transparent 1px),
      linear-gradient(90deg, hsl(var(--primary)) 1px, transparent 1px);
   background-size: 50px 50px;
}

.planos-content {
   position: relative;
   z-index: 10;
   text-align: center;
   padding: 5rem 1rem;
}

.badge {
   display: inline-flex;
   align-items: center;
   gap: 0.5rem;
   padding: 0.5rem 1rem;
   border-radius: 9999px;
   background: hsla(220, 90%, 56%, 0.1);
   border: 1px solid hsla(220, 90%, 56%, 0.2);
   margin-bottom: 2rem;
   font-size: 0.875rem;
   font-weight: 500;
   color: hsl(var(--primary));
}

h1 {
   font-size: clamp(2.5rem, 8vw, 4.5rem);
   font-weight: 800;
   line-height: 1.1;
   margin-bottom: 1.5rem;
}

.gradient-text {
   background: linear-gradient(135deg,
         hsl(var(--foreground)),
         hsl(var(--primary)),
         hsl(var(--foreground)));
   -webkit-background-clip: text;
   background-clip: text;
   -webkit-text-fill-color: transparent;
}

.planos-subtitle {
   font-size: clamp(1.125rem, 2.5vw, 1.5rem);
   color: hsl(var(--muted-foreground));
   margin-bottom: 3rem;
   max-width: 48rem;
   margin-left: auto;
   margin-right: auto;
}

.cta-buttons {
   display: flex;
   flex-wrap: wrap;
   gap: 1rem;
   justify-content: center;
   margin-bottom: 4rem;
}

.btn {
   padding: 1rem 2rem;
   font-size: 1.125rem;
   font-weight: 600;
   border-radius: var(--radius);
   border: none;
   cursor: pointer;
   transition: all 0.3s ease;
   display: inline-flex;
   align-items: center;
   gap: 0.5rem;
   text-decoration: none;
}

.btn-primary {
   background: hsl(var(--primary));
   color: hsl(var(--primary-foreground));
   box-shadow: 0 0 30px hsla(220, 90%, 56%, 0.5);
}

.btn-primary:hover {
   box-shadow: 0 0 50px hsla(220, 90%, 56%, 0.7);
   transform: scale(1.05);
}

.btn-outline {
   background: transparent;
   color: hsl(var(--foreground));
   border: 1px solid hsla(220, 90%, 56%, 0.3);
}

.btn-outline:hover {
   background: hsla(220, 90%, 56%, 0.1);
}

.features-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
   gap: 1.5rem;
   max-width: 60rem;
   margin: 0 auto;
}

.feature-card {
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 0.75rem;
   padding: 1.5rem;
   border-radius: var(--radius);
   background: hsla(220, 20%, 12%, 0.5);
   backdrop-filter: blur(10px);
   border: 1px solid hsla(220, 15%, 20%, 0.5);
}

.feature-icon {
   padding: 0.75rem;
   border-radius: 9999px;
   background: hsla(220, 90%, 56%, 0.1);
}

.feature-icon.accent {
   background: hsla(142, 76%, 36%, 0.1);
}

/* Plans secao */
.plans-secao {
   padding: 5rem 0;
   background: hsl(var(--background));
}

.secao-header {
   text-align: center;
   margin-bottom: 3rem;
}

.secao-header h2 {
   font-size: clamp(2rem, 5vw, 3rem);
   font-weight: 800;
   margin-bottom: 1rem;
}

.secao-header p {
   font-size: 1.25rem;
   color: hsl(var(--muted-foreground));
}

/* Toggle */
.toggle-container {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 1rem;
   padding: 1rem;
   border-radius: var(--radius);
   background: hsla(220, 20%, 12%, 0.5);
   backdrop-filter: blur(10px);
   border: 1px solid hsla(220, 15%, 20%, 0.3);
   margin: 0 auto 0rem;
   max-width: fit-content;
}

.toggle-label {
   font-size: 1.125rem;
   font-weight: 500;
   cursor: pointer;
   transition: color 0.3s;
}

.toggle-label.active {
   color: hsl(var(--primary));
}

.toggle-label.inactive {
   color: hsl(var(--muted-foreground));
}

.toggle-switch {
   position: relative;
   width: 60px;
   height: 25.5px;
   background: hsl(var(--muted));
   border-radius: 15px;
   cursor: pointer;
   transition: background 0.3s;
}

.toggle-switch.active {
   background: hsl(var(--primary));
}

.toggle-slider {
   position: absolute;
   top: 3px;
   left: 3px;
   width: 20px;
   height: 20px;
   background: white;
   border-radius: 50%;
   transition: transform 0.3s;
}

.toggle-switch.active .toggle-slider {
   transform: translateX(35px);
}

/* Carousel */
.carousel {
   position: relative;
   max-width: 100%;
   margin: 0 auto;
}

.embla {
   overflow: hidden;
}

.embla__container {
   display: flex;
}

.embla__slide {
   flex: 0 0 100%;
   min-width: 0;
}

.carousel-btn {
   position: absolute;
   top: 50%;
   transform: translateY(-50%);
   z-index: 20;
   width: 3rem;
   height: 3rem;
   border-radius: 50%;
   background: hsla(220, 20%, 12%, 0.8);
   backdrop-filter: blur(10px);
   border: 1px solid hsla(220, 15%, 20%, 0.5);
   color: hsl(var(--foreground));
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
   transition: all 0.3s;
}

.carousel-btn:hover {
   background: hsla(220, 90%, 56%, 0.2);
   border-color: hsl(var(--primary));
}

.carousel-btn.prev {
   left: 1rem;
}

.carousel-btn.next {
   right: 1rem;
}

/* Plan Card */
.plan-card {
   position: relative;
   width: 100%;
   min-height: 90vh;
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 2rem 1rem;
}

.plan-bg {
   position: absolute;
   inset: 0;
   z-index: 0;
}

.plan-bg img {
   width: 100%;
   height: 100%;
   object-fit: cover;
}

.plan-overlay {
   position: absolute;
   inset: 0;
   background: linear-gradient(180deg,
         hsla(220, 25%, 8%, 0.9),
         hsla(220, 25%, 8%, 0.85),
         hsla(220, 25%, 8%, 0.9));
}

.plan-content {
   position: relative;
   z-index: 10;
   width: 100%;
   max-width: 90rem;
}

.plan-header {
   text-align: center;
   margin-bottom: 3rem;
}

.plan-header h3 {
   font-size: clamp(2rem, 4vw, 3rem);
   font-weight: 800;
   margin-bottom: 1rem;
}

.plan-description {
   font-size: 1.25rem;
   color: hsl(var(--muted-foreground));
   max-width: 48rem;
   margin: 0 auto;
}

/* Robot Cards */
.robots-grid {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
   gap: 1.5rem;
   margin-bottom: 2rem;
}

.robot-card {
   position: relative;
   display: flex;
   flex-direction: column;
   align-items: center;
   padding: 1.5rem;
   min-height: 250px;
   border-radius: var(--radius);
   background: linear-gradient(135deg,
         hsla(220, 20%, 12%, 0.2),
         hsla(220, 20%, 15%, 0.1));
   backdrop-filter: blur(10px);
   border: 1px solid hsla(0, 0%, 100%, 0.1);
   transition: all 0.3s;
}

.robot-card:hover {
   border-color: hsla(220, 90%, 56%, 0.8);
   box-shadow: 0 0 30px hsla(220, 100%, 50%, 0.3);
}

.robot-image-wrapper {
   position: relative;
   margin-bottom: 1.5rem;
}

.robot-image-border {
   width: 6rem;
   height: 6rem;
   border-radius: 50%;
   background: linear-gradient(135deg,
         hsla(220, 90%, 56%, 0.2),
         hsla(142, 76%, 36%, 0.2));
   padding: 2px;
}

.robot-image-inner {
   width: 100%;
   height: 100%;
   border-radius: 50%;
   background: hsla(220, 20%, 12%, 0.8);
   backdrop-filter: blur(10px);
   display: flex;
   align-items: center;
   justify-content: center;
   overflow: hidden;
}

.robot-image {
   width: 5rem;
   height: 5rem;
   object-fit: contain;
   transition: transform 0.5s;
}

.robot-card:hover .robot-image {
   transform: scale(1.1);
}

.robot-name {
   font-size: 1.25rem;
   font-weight: 700;
   margin-bottom: 1rem;
   text-align: center;
}

.robot-description {
   flex: 1;
   font-size: 0.875rem;
   color: hsl(var(--muted-foreground));
   line-height: 1.6;
   text-align: left;
   max-height: 150px;
   overflow-y: auto;
   padding-right: 0.5rem;
}

.robot-description::-webkit-scrollbar {
   width: 6px;
}

.robot-description::-webkit-scrollbar-thumb {
   background: hsla(220, 90%, 56%, 0.3);
   border-radius: 3px;
}

.robot-description::-webkit-scrollbar-track {
   background: transparent;
}

/* Features List */
.features-box {
   max-width: 48rem;
   margin: 0 auto 3rem;
   padding: 1.5rem;
   border-radius: var(--radius);
   background: hsla(220, 20%, 12%, 0.5);
   backdrop-filter: blur(10px);
   border: 1px solid hsla(220, 15%, 20%, 0.3);
}

.features-box h4 {
   font-size: 1.5rem;
   font-weight: 800;
   text-align: center;
   margin-bottom: 1.5rem;
}

.features-list {
   display: grid;
   grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
   gap: 1rem;
   list-style: none;
}

.feature-item {
   display: flex;
   align-items: flex-start;
   gap: 0.75rem;
}

.feature-check {
   flex-shrink: 0;
   margin-top: 0.25rem;
   padding: 0.25rem;
   border-radius: 50%;
   background: hsla(142, 76%, 36%, 0.2);
}

.feature-text {
   color: hsl(var(--muted-foreground));
}

/* Pricing */
.pricing-secao {
   text-align: center;
   margin-bottom: 2rem;
}

.price-display {
   display: inline-flex;
   align-items: baseline;
   gap: 0.5rem;
   margin-bottom: 0.5rem;
}

.price {
   font-size: 2.5rem;
   font-weight: 800;
   color: hsl(var(--primary));
}

.price-period {
   font-size: 1rem;
   color: hsl(var(--muted-foreground));
}

.savings {
   font-size: 0.875rem;
   color: hsl(var(--accent));
}

.btn-cta {
   padding: 1rem 2rem;
   font-size: 1rem;
   font-weight: 700;
   border-radius: var(--radius);
   background: linear-gradient(135deg,
         hsl(var(--primary)),
         hsl(var(--accent)));
   color: white;
   border: none;
   cursor: pointer;
   transition: all 0.2s;
   box-shadow: 0 5px 40px hsla(0, 0%, 0%, 0.4);
}

.btn-cta:hover {
   transform: scale(1.02);
   box-shadow: 0 0 30px hsla(220, 90%, 56%, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
   .planos-content {
      padding: 3rem 1rem;
   }

   .features-grid {
      grid-template-columns: 1fr;
   }

   .robots-grid {
      grid-template-columns: 1fr;
   }

   .carousel-btn {
      width: 2.5rem;
      height: 2.5rem;
   }
   
   .price {
      font-size: 2rem;
      font-weight: 800;
      color: hsl(var(--primary));
   }

   .btn {
      padding: 0.875rem 1.5rem;
      font-size: 1rem;
   }

   .btn-cta {
      padding: 1.25rem 2rem;
      font-size: 1rem;
   }
}

/* ================================================================ */
/* MODAL DE UPGRADE - RESPONSIVO E SEM SCROLL DO FUNDO              */
/* ================================================================ */

/* UPDATE DE PLANO */
.upgrade-row small {
   display: block;
   color: #888;
   font-size: 0.75rem;
   margin-top: 2px;
}

.upgrade-info strong {
   display: block;
   margin-bottom: 5px;
}

/* Impede scroll do body quando modal está aberto */
body.modal-open {
   overflow: hidden;
   position: fixed;
   width: 100%;
   height: 100%;
}

.modal-overlay {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background: rgba(0, 0, 0, 0.8);
   display: flex;
   align-items: center;
   justify-content: center;
   z-index: 9999;
   backdrop-filter: blur(6px);
   overflow-y: auto;
   padding: 20px;
}

.modal-box {
   position: relative;
   max-width: 480px;
   width: 100%;
   margin: auto;
   background: linear-gradient(145deg, #1a1a2e, #16213e);
   padding: 28px;
   border-radius: 16px;
   border: 1px solid rgba(255, 255, 255, 0.1);
   box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
   color: #fff;
   max-height: 90vh;
   overflow-y: auto;
}

.modal-box h3 {
   margin-bottom: 16px;
   font-size: 1.4rem;
   color: #fff;
   display: flex;
   align-items: center;
   gap: 10px;
}

.modal-close {
   position: absolute;
   top: 15px;
   right: 20px;
   cursor: pointer;
   font-size: 24px;
   font-weight: bold;
   color: #888;
   transition: color 0.2s;
   z-index: 10;
}

.modal-close:hover {
   color: #fff;
}

/* Card de comparação de preços */
.upgrade-card {
   background: rgba(255, 255, 255, 0.03);
   border-radius: 12px;
   padding: 0;
   margin: 16px 0;
   overflow: hidden;
}

/* Comparação de planos lado a lado */
.plans-comparison {
   display: grid;
   grid-template-columns: 1fr auto 1fr;
   gap: 0;
   align-items: stretch;
}

.plan-box {
   padding: 20px 16px;
   text-align: center;
}

.plan-box.atual {
   background: rgba(255, 255, 255, 0.05);
}

.plan-box.novo {
   background: rgba(102, 126, 234, 0.15);
}

.plan-box-label {
   font-size: 0.75rem;
   text-transform: uppercase;
   letter-spacing: 1px;
   color: #888;
   margin-bottom: 8px;
}

.plan-box-name {
   font-size: 1rem;
   font-weight: 600;
   color: #fff;
   margin-bottom: 12px;
   min-height: 24px;
}

.plan-box-price {
   font-size: 1.5rem;
   font-weight: 700;
}

.plan-box.atual .plan-box-price {
   color: #888;
   text-decoration: line-through;
   text-decoration-color: #f87171;
}

.plan-box.novo .plan-box-price {
   color: #4ade80;
}

.plan-box-interval {
   font-size: 0.8rem;
   color: #888;
   margin-top: 4px;
}

.plan-arrow {
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 0 8px;
   color: #667eea;
   font-size: 1.5rem;
}

/* Seção de cálculo */
.calculation-section {
   padding: 20px;
   border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.calc-row {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 10px 0;
}

.calc-row:not(:last-child) {
   border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.calc-label {
   color: #aaa;
   font-size: 0.9rem;
   display: flex;
   align-items: center;
   gap: 8px;
}

.calc-label-icon {
   font-size: 1rem;
}

.calc-value {
   font-weight: 600;
   font-size: 1rem;
}

.calc-value.credito {
   color: #4ade80;
}

.calc-value.debito {
   color: #f87171;
}

/* Total destacado */
.total-section {
   background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
   padding: 20px;
   border-top: 2px solid rgba(102, 126, 234, 0.3);
}

.total-row {
   display: flex;
   justify-content: space-between;
   align-items: center;
}

.total-label {
   font-size: 1rem;
   font-weight: 600;
   color: #fff;
}

.total-value {
   font-size: 1.6rem;
   font-weight: 700;
   color: #fff;
}

.total-value.gratis {
   color: #4ade80;
}

/* Badge de tipo */
.upgrade-badge {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   padding: 6px 12px;
   border-radius: 20px;
   font-size: 0.75rem;
   font-weight: 600;
   text-transform: uppercase;
   letter-spacing: 0.5px;
}

.upgrade-badge.upgrade {
   background: rgba(74, 222, 128, 0.15);
   color: #4ade80;
   border: 1px solid rgba(74, 222, 128, 0.3);
}

.upgrade-badge.downgrade {
   background: rgba(251, 191, 36, 0.15);
   color: #fbbf24;
   border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Info boxes */
.info-box {
   padding: 14px 16px;
   border-radius: 10px;
   margin-top: 12px;
   font-size: 0.85rem;
   line-height: 1.5;
}

.info-box.success {
   background: rgba(74, 222, 128, 0.1);
   border-left: 3px solid #4ade80;
   color: #a7f3d0;
}

.info-box.warning {
   background: rgba(251, 191, 36, 0.1);
   border-left: 3px solid #fbbf24;
   color: #fde68a;
}

.info-box.info {
   background: rgba(102, 126, 234, 0.1);
   border-left: 3px solid #667eea;
   color: #c7d2fe;
}

.info-box strong {
   display: block;
   margin-bottom: 4px;
   color: inherit;
}

/* Botões */
.modal-actions {
   display: flex;
   justify-content: flex-end;
   gap: 12px;
   margin-top: 20px;
}

.modal-btn {
   padding: 14px 24px;
   border: none;
   border-radius: 10px;
   cursor: pointer;
   font-weight: 600;
   font-size: 0.95rem;
   transition: all 0.2s;
}

.modal-btn-primary {
   background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
   color: #fff;
   flex: 1;
}

.modal-btn-primary:hover:not(:disabled) {
   transform: translateY(-2px);
   box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.modal-btn-primary:disabled {
   opacity: 0.5;
   cursor: not-allowed;
   transform: none;
}

.modal-btn-secondary {
   background: rgba(255, 255, 255, 0.08);
   color: #fff;
   border: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-btn-secondary:hover {
   background: rgba(255, 255, 255, 0.15);
}

/* Spinner */
.spinner {
   display: inline-block;
   width: 18px;
   height: 18px;
   border: 2px solid rgba(255, 255, 255, 0.3);
   border-radius: 50%;
   border-top-color: #fff;
   animation: spin 0.8s linear infinite;
   margin-right: 8px;
   vertical-align: middle;
}

@keyframes spin {
   to { transform: rotate(360deg); }
}

/* ================================================================ */
/* RESPONSIVO                                                       */
/* ================================================================ */

@media (max-width: 520px) {
   .modal-overlay {
      padding: 10px;
      align-items: flex-start;
      padding-top: 20px;
   }
   
   .modal-box {
      padding: 20px 16px;
      border-radius: 12px;
      max-height: calc(100vh - 40px);
   }
   
   .modal-box h3 {
      font-size: 1.2rem;
   }
   
   /* Stack de planos em mobile */
   .plans-comparison {
      grid-template-columns: 1fr;
      gap: 0;
   }
   
   .plan-arrow {
      padding: 8px 0;
      transform: rotate(90deg);
   }
   
   .plan-box {
      padding: 16px;
   }
   
   .plan-box-price {
      font-size: 1.3rem;
   }
   
   .calculation-section {
      padding: 16px;
   }
   
   .calc-row {
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
   }
   
   .calc-value {
      align-self: flex-end;
   }
   
   .total-section {
      padding: 16px;
   }
   
   .total-row {
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
   }
   
   .total-value {
      font-size: 1.4rem;
      align-self: flex-end;
   }
   
   .modal-actions {
      flex-direction: column-reverse;
   }
   
   .modal-btn {
      width: 100%;
      text-align: center;
   }
   
   .info-box {
      font-size: 0.8rem;
   }
}


/* Seção de atualizar cartão */
.card-update-section {
   display: flex;
   align-items: center;
   justify-content: space-between;
   padding: 14px 16px;
   margin-top: 12px;
   background: rgba(255, 255, 255, 0.03);
   border: 1px dashed rgba(255, 255, 255, 0.15);
   border-radius: 10px;
}

.card-update-text {
   font-size: 0.85rem;
   color: #aaa;
}

.card-update-btn {
   background: transparent;
   border: 1px solid rgba(102, 126, 234, 0.5);
   color: #667eea;
   padding: 8px 16px;
   border-radius: 8px;
   font-size: 0.85rem;
   font-weight: 600;
   cursor: pointer;
   transition: all 0.2s;
   display: inline-flex;
   align-items: center;
   gap: 6px;
}

.card-update-btn:hover {
   background: rgba(102, 126, 234, 0.1);
   border-color: #667eea;
   transform: translateY(-1px);
}

.card-update-btn:disabled {
   opacity: 0.5;
   cursor: not-allowed;
   transform: none;
}

/* Responsivo */
@media (max-width: 520px) {
   .card-update-section {
      flex-direction: column;
      gap: 12px;
      text-align: center;
   }
   
   .card-update-btn {
      width: 100%;
      justify-content: center;
   }
}