/* ===========================================================
   Components: buttons, badges, cards, inputs, mockup frames
   =========================================================== */

/* ---- Buttons ---- */
.btn {
  --_bg: var(--color-text);
  --_fg: var(--color-text-inverse);
  --_border: var(--color-text);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  border-radius: var(--radius-pill);
  border: 1px solid var(--_border);
  background: var(--_bg);
  color: var(--_fg);
  cursor: pointer;
  white-space: nowrap;
  isolation: isolate;
  overflow: hidden;
  transition: transform var(--duration-fast) var(--ease-spring),
              box-shadow var(--duration) var(--ease-out),
              background var(--duration) var(--ease-out),
              color var(--duration) var(--ease-out),
              border-color var(--duration) var(--ease-out);
  will-change: transform;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); transition-duration: 80ms; }

/* Shine sweep on hover */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-shine);
  background-size: 250% 100%;
  background-position: 200% 0;
  pointer-events: none;
  transition: background-position var(--duration-slower) var(--ease-out);
  z-index: -1;
}
.btn:hover::after { background-position: -100% 0; }

/* Variants */
.btn--primary {
  --_bg: var(--color-primary);
  --_fg: #fff;
  --_border: transparent;
  background: var(--grad-primary);
  box-shadow: var(--shadow-glow);
}
.btn--primary:hover { box-shadow: var(--shadow-glow-lg); }

.btn--accent {
  --_bg: var(--color-accent);
  --_fg: #0A2A0A;
  --_border: transparent;
  background: var(--grad-accent);
}

/* Plus tier — amber/orange gradient (matches brand assets) */
.btn--plus {
  --_bg: #F97316;
  --_fg: #fff;
  --_border: transparent;
  background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.25);
}
.btn--plus:hover { box-shadow: 0 12px 32px rgba(249, 115, 22, 0.40); }

.btn--ghost {
  --_bg: transparent;
  --_fg: var(--color-text);
  --_border: var(--color-border-strong);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  --_bg: var(--color-surface-2);
  --_border: var(--color-text);
}

.btn--soft {
  --_bg: var(--color-primary-50);
  --_fg: var(--color-primary);
  --_border: transparent;
}
.btn--soft:hover { --_bg: var(--color-primary-100); }

/* Sizes */
.btn--sm { padding: 9px 16px; font-size: var(--fs-sm); }
.btn--lg { padding: 18px 28px; font-size: var(--fs-md); }

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Magnetic effect target (JS-driven) */
.btn-magnetic { transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1); }

/* ---- Badge ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  background: var(--color-primary-50);
  color: var(--color-primary);
  border: 1px solid var(--color-primary-100);
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(146, 211, 80, 0.2);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.6; }
}

.badge--accent { background: var(--color-accent-soft); color: var(--color-accent-dark); border-color: rgba(146, 211, 80, 0.30); }
.badge--neutral { background: var(--color-surface-2); color: var(--color-text-muted); border-color: var(--color-border); }
.badge--neutral::before { display: none; }

/* ---- Cards ---- */
.card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  transition: transform var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out),
              border-color var(--duration) var(--ease-out);
  overflow: hidden;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}

/* Card with gradient border on hover */
.card--glow {
  position: relative;
}
.card--glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: var(--grad-primary);
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  transition: opacity var(--duration) var(--ease-out);
}
.card--glow:hover::before { opacity: 1; }
.card--glow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-surface);
  border-radius: inherit;
  z-index: -1;
}

.card--feature {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-8);
  min-height: 240px;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-50);
  color: var(--color-primary);
  position: relative;
  isolation: isolate;
}
.card-icon::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--grad-primary);
  border-radius: inherit;
  filter: blur(8px);
  opacity: 0;
  z-index: -1;
  transition: opacity var(--duration) var(--ease-out);
}
.card:hover .card-icon::before { opacity: 0.4; }
.card-icon svg { width: 24px; height: 24px; }

.card--feature h3 {
  font-size: var(--fs-xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-snug);
}
.card--feature p {
  color: var(--color-text-muted);
  line-height: var(--lh-relaxed);
}

/* Glass card variant */
.card--glass {
  background: color-mix(in srgb, var(--color-surface) 70%, transparent);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
}

/* ---- Inputs ---- */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: var(--fs-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 14px 18px;
  font-size: var(--fs-base);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  transition: border-color var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out),
              background var(--duration) var(--ease-out);
}
.field input::placeholder { color: var(--color-text-soft); }
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-50);
  outline: none;
}

/* ---- Pricing toggle ---- */
.toggle-group {
  display: inline-flex;
  padding: 4px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  position: relative;
}
.toggle-group__btn {
  position: relative;
  padding: 8px 18px;
  font-size: var(--fs-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-muted);
  border-radius: var(--radius-pill);
  transition: color var(--duration) var(--ease-out);
  z-index: 1;
}
.toggle-group__btn[aria-pressed="true"] {
  color: var(--color-text);
}
.toggle-group__indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  background: var(--color-surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: left var(--duration) var(--ease-out), width var(--duration) var(--ease-out);
}

/* ---- Pricing cards ----
   Brand-aligned with the in-app design and the social brand assets:
     · Gratis → plain card, gray border
     · Plus   → orange outline + amber gradient ribbon "POPULAR"   + amber gradient button
     · Pro    → indigo outline + indigo gradient ribbon "MEJOR VALOR" + indigo gradient button
   Cards stay outlined (never solid-filled) so feature lists remain legible.   */

.pricing-card {
  position: relative;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  transition: transform var(--duration) var(--ease-out),
              box-shadow var(--duration) var(--ease-out),
              border-color var(--duration) var(--ease-out);
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* Plus — amber/orange accent */
.pricing-card--plus {
  border: 2px solid #F97316;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.06), 0 8px 24px rgba(249, 115, 22, 0.10);
}
.pricing-card--plus:hover {
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.10), 0 16px 40px rgba(249, 115, 22, 0.20);
}

/* Pro — indigo accent with subtle tinted background */
.pricing-card--pro {
  border: 2px solid var(--color-primary);
  background:
    linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, rgba(99, 102, 241, 0) 60%),
    var(--color-surface);
  box-shadow: var(--shadow-glow);
}
.pricing-card--pro:hover { box-shadow: var(--shadow-glow-lg); }

[data-theme="dark"] .pricing-card--pro {
  background:
    linear-gradient(180deg, rgba(129, 140, 248, 0.10) 0%, rgba(129, 140, 248, 0) 60%),
    var(--color-surface);
}

/* Slight scale up on Pro at desktop sizes — establishes hierarchy. */
@media (min-width: 1024px) {
  .pricing-card--pro { transform: scale(1.03); }
  .pricing-card--pro:hover { transform: scale(1.03) translateY(-4px); }
}

/* Ribbons — sit centered above the card like a tab. */
.pricing-card__ribbon {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  z-index: 1;
}
.pricing-card__ribbon--popular {
  background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.40);
}
.pricing-card__ribbon--featured {
  background: var(--grad-primary);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.40);
}

/* Card content — uniform across all three variants. */
.pricing-card h3 { font-size: var(--fs-xl); }
.pricing-card .price {
  font-family: var(--font-display);
  font-size: clamp(40px, 5vw, 56px);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: 1;
}
.pricing-card .price span {
  font-size: var(--fs-base);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  letter-spacing: 0;
  white-space: nowrap;
}

/* Secondary line under the price (e.g. "Facturado anual · $119.99"). */
.pricing-card .price__note {
  display: block;
  margin-top: 6px;
  font-size: var(--fs-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-soft);
  letter-spacing: 0;
  line-height: 1.4;
}

.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pricing-features li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
}
.pricing-features li svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-accent-dark);
}
.pricing-features li.muted { opacity: 0.5; text-decoration: line-through; }

/* ---- App Store / Google Play buttons ---- */
.store-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.store-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  background: #0A0A0F;
  color: #fff;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  border: 1px solid #1A1A22;
  transition: transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration) var(--ease-out);
}
[data-theme="dark"] .store-btn,
:root:not([data-theme="light"]) .store-btn { background: #fff; color: #0A0A0F; border-color: #E5E7EB; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .store-btn { background: #fff; color: #0A0A0F; border-color: #E5E7EB; }
}
.store-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.store-btn svg { width: 26px; height: 26px; }
.store-btn__txt { display: flex; flex-direction: column; line-height: 1.1; text-align: left; }
.store-btn__top { font-size: 10px; opacity: 0.75; letter-spacing: 0.04em; }
.store-btn__name { font-size: 16px; font-weight: var(--weight-bold); letter-spacing: -0.01em; }
.store-btn--soon { opacity: 0.55; pointer-events: none; }

/* ---- Phone mockup frame ---- */
.phone {
  --phone-w: 280px;
  --phone-h: 580px;
  position: relative;
  width: var(--phone-w);
  height: var(--phone-h);
  border-radius: 44px;
  background: linear-gradient(160deg, #1A1A22 0%, #0A0A0F 100%);
  padding: 10px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06),
    inset 0 0 0 1px rgba(255,255,255,0.04),
    0 60px 120px -30px rgba(79, 70, 229, 0.45),
    var(--shadow-xl);
}
.phone::before {
  content: '';
  position: absolute;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  width: 90px; height: 28px;
  background: #000;
  border-radius: 99px;
  z-index: 2;
}
.phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: var(--color-bg-soft);
}
.phone__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* ---- Marquee row ---- */
.marquee {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
          mask-image: linear-gradient(to right, transparent, black 12%, black 88%, transparent);
}
.marquee__track {
  display: flex;
  gap: var(--space-12);
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-md);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.marquee__item svg { width: 22px; height: 22px; color: var(--color-text-soft); }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---- FAQ ---- */
.faq {
  border-top: 1px solid var(--color-border);
}
.faq details {
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--color-border);
  transition: padding var(--duration) var(--ease-out);
}
.faq summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--fs-lg);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  color: var(--color-text);
  transition: color var(--duration-fast) var(--ease-out);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--color-primary); }
.faq summary::after {
  content: '';
  width: 20px; height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M5 9l7 7 7-7'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
  transition: transform var(--duration) var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(180deg); }
.faq details[open] { padding-bottom: var(--space-6); }
.faq details > p {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
  line-height: var(--lh-relaxed);
  max-width: 720px;
}
.faq details > ul {
  margin-top: var(--space-3);
  margin-left: var(--space-5);
  list-style: disc;
}
.faq details > ul li { color: var(--color-text-muted); margin-bottom: 4px; }

/* ---- Stats row ---- */
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-block: var(--space-2);
}
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(36px, 4.4vw, 56px);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  background: var(--grad-primary);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat__label {
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* ---- Status pill (live/coming/etc) ---- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  padding: 4px 10px;
  background: var(--color-surface-2);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
}
.status-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* ---- Form messages ---- */
.form-msg {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-3);
}
.form-msg--success { background: var(--color-accent-soft); color: var(--color-accent-dark); border: 1px solid rgba(146, 211, 80, 0.35); }
.form-msg--error   { background: var(--color-red-soft);    color: var(--color-red);          border: 1px solid rgba(239, 68, 68, 0.35); }

/* ---- Link with arrow ---- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  font-weight: var(--weight-semibold);
  font-size: var(--fs-sm);
  transition: gap var(--duration-fast) var(--ease-spring);
}
.link-arrow:hover { gap: 10px; }
.link-arrow::after {
  content: '→';
  display: inline-block;
  transition: transform var(--duration-fast) var(--ease-spring);
}
.link-arrow:hover::after { transform: translateX(2px); }

/* ---- Bullet list ---- */
.bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.bullets li {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  font-size: var(--fs-base);
  color: var(--color-text);
}
.bullets li::before {
  content: '';
  flex-shrink: 0;
  width: 22px; height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--color-accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2392D350' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 14px no-repeat;
}
