/* ============================================
   KALKULUS — Design System
   Primary: #5b5ef4  Dark: #0f172a
   ============================================ */

html { scroll-behavior: smooth; }

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #fff;
  color: #0f172a;
}

[x-cloak] { display: none !important; }

section { scroll-margin-top: 80px; }

/* ==================== HERO ==================== */
.klk-hero-bg {
  background: linear-gradient(145deg, #12107a 0%, #1e1b9e 25%, #3730c8 55%, #5b5ef4 100%);
  position: relative;
}

/* Decorative circles — same visual language as the app */
.klk-circle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.klk-circle-1 {
  width: 700px; height: 700px;
  top: -180px; right: -120px;
  background: radial-gradient(circle, rgba(129,140,248,.18) 0%, transparent 65%);
}
.klk-circle-2 {
  width: 500px; height: 500px;
  bottom: -100px; left: -100px;
  background: radial-gradient(circle, rgba(91,94,244,.22) 0%, transparent 65%);
}
.klk-circle-3 {
  width: 300px; height: 300px;
  top: 40%; left: 28%;
  background: radial-gradient(circle, rgba(6,182,212,.1) 0%, transparent 65%);
}

/* ==================== BROWSER MOCKUP ==================== */
.klk-browser-frame {
  background: #1e293b;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.1),
    0 30px 80px rgba(10,10,30,.55),
    0 8px 20px rgba(91,94,244,.3);
  transform: perspective(1200px) rotateY(-4deg) rotateX(3deg);
  transition: transform .5s cubic-bezier(.23,1,.32,1);
}
.klk-browser-frame:hover {
  transform: perspective(1200px) rotateY(0deg) rotateX(0deg);
}
.klk-browser-top {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #0f172a;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.klk-browser-dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.klk-browser-url {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-family: monospace;
  color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.05);
  padding: 3px 12px;
  border-radius: 20px;
}
.klk-browser-frame img { width: 100%; display: block; }

/* Floating stat pills */
.klk-stat-pill {
  position: absolute;
  background: white;
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  box-shadow: 0 8px 32px rgba(15,23,42,.25);
  z-index: 20;
  animation: klk-float 3.5s ease-in-out infinite;
}
.klk-stat-pill-1 { bottom: 18%; left: -6%; animation-delay: 0s; }
.klk-stat-pill-2 { top: 12%; right: -4%; animation-delay: 1.8s; }

@keyframes klk-float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-9px); }
}

@media (max-width: 1024px) {
  .klk-stat-pill { display: none; }
  .klk-browser-frame { transform: none; }
  .klk-browser-frame:hover { transform: none; }
}

/* ==================== FEATURE CARDS ==================== */
.klk-feature-card {
  border: 1.5px solid #f1f5f9;
  border-radius: 14px;
  padding: 28px;
  background: #fff;
  transition: border-color .25s, box-shadow .25s, transform .25s;
}
.klk-feature-card:hover {
  border-color: #818cf8;
  box-shadow: 0 8px 32px rgba(91,94,244,.12);
  transform: translateY(-3px);
}
.klk-feature-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #5b5ef4 0%, #818cf8 100%);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  font-size: 22px;
  color: white;
  transition: transform .25s;
}
.klk-feature-card:hover .klk-feature-icon {
  transform: scale(1.1) rotate(-6deg);
}

/* ==================== PRICING BG ==================== */
.klk-precios-bg {
  background: linear-gradient(145deg, #0d0c4e 0%, #12107a 30%, #1e1b9e 65%, #3730a3 100%);
  position: relative;
  overflow: hidden;
}

/* ==================== PRICING CARDS ==================== */
.klk-plan-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  padding: 32px;
  color: white;
  position: relative;
  transition: all .25s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
}
.klk-plan-card:hover {
  background: rgba(255,255,255,.12);
  transform: translateY(-5px);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.klk-plan-card--popular {
  background: rgba(255,255,255,.97);
  color: #0f172a;
  border-color: transparent;
  box-shadow: 0 20px 60px rgba(91,94,244,.35);
}
.klk-plan-card--popular:hover { background: #fff; }

.klk-plan-badge {
  position: absolute;
  top: -13px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #5b5ef4, #818cf8);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 16px;
  border-radius: 20px;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.klk-plan-name {
  font-size: 12px;
  font-weight: 700;
  opacity: .6;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 14px;
}
.klk-plan-price {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  margin-bottom: 4px;
}
.klk-plan-currency {
  font-size: 18px;
  font-weight: 700;
  color: #818cf8;
  margin-top: 10px;
}
.klk-plan-card--popular .klk-plan-currency { color: #5b5ef4; }
.klk-plan-amount {
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
}
.klk-plan-period {
  font-size: 12px;
  opacity: .5;
  margin-bottom: 16px;
}
.klk-plan-desc {
  font-size: 14px;
  opacity: .65;
  line-height: 1.65;
  margin-bottom: auto;
  padding-bottom: 24px;
  flex: 1;
}
.klk-plan-btn {
  display: block;
  text-align: center;
  padding: 13px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  transition: all .2s;
  background: rgba(255,255,255,.12);
  color: white;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.2);
}
.klk-plan-btn:hover { background: rgba(255,255,255,.2); color: white; }
.klk-plan-btn--popular {
  background: linear-gradient(135deg, #5b5ef4, #818cf8);
  color: white;
  border-color: transparent;
}
.klk-plan-btn--popular:hover {
  background: linear-gradient(135deg, #4f52d7, #7079da);
  box-shadow: 0 4px 16px rgba(91,94,244,.4);
  transform: translateY(-1px);
}

/* Allow "Más popular" badge to overflow above the card edge */
.precios-swiper.swiper {
  overflow: visible !important;
}
.precios-swiper .swiper-wrapper {
  padding-top: 22px;
}

/* Swiper overrides for pricing */
.precios-swiper .swiper-button-prev,
.precios-swiper .swiper-button-next {
  color: white;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  width: 44px; height: 44px;
  border-radius: 50%;
  transition: background .2s;
}
.precios-swiper .swiper-button-prev:hover,
.precios-swiper .swiper-button-next:hover { background: rgba(255,255,255,.2); }
.precios-swiper .swiper-button-prev::after,
.precios-swiper .swiper-button-next::after { font-size: 14px; font-weight: 700; }
.precios-swiper .swiper-pagination-bullet { background: rgba(255,255,255,.35); }
.precios-swiper .swiper-pagination-bullet-active { background: white; }

/* Loading spinner */
.klk-plan-loading { text-align: center; padding: 60px 20px; }
.klk-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: white;
  border-radius: 50%;
  animation: klk-spin .75s linear infinite;
  margin: 0 auto 12px;
}
@keyframes klk-spin { to { transform: rotate(360deg); } }

/* ==================== FORM ==================== */
.klk-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #0f172a;
  background: white;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
.klk-input:focus {
  border-color: #5b5ef4;
  box-shadow: 0 0 0 3px rgba(91,94,244,.1);
}
.klk-input::placeholder { color: #94a3b8; }

.klk-input.klk-invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}
.klk-input.klk-valid {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.08);
}
.klk-field-error {
  display: none;
  font-size: 12px;
  color: #ef4444;
  margin-top: 5px;
  padding-left: 2px;
}
.klk-field-error.visible { display: block; }

/* ==================== LOGOS ==================== */
.klk-logo-img {
  height: 34px;
  max-width: 110px;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: .55;
  transition: filter .25s, opacity .25s;
  user-select: none;
}
.klk-logo-img:hover { filter: none; opacity: 1; }

/* Fix dark logos on white bg */
.klk-logo-dark { filter: grayscale(100%) brightness(.25); }
.klk-logo-dark:hover { filter: brightness(.25); }

/* ==================== MODAL ==================== */
.klk-modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,23,42,.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.klk-modal-box {
  background: white;
  border-radius: 16px;
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 80px rgba(15,23,42,.4);
}
.klk-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.klk-modal-body {
  padding: 24px;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #374151;
}
.klk-modal-body h4 { font-size: 1rem; font-weight: 700; color: #0f172a; margin: 16px 0 6px; }
.klk-modal-body ol { padding-left: 20px; }
.klk-modal-body li { margin-bottom: 10px; }
.klk-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
}
