/* ============================================================
   Sede IA Cotizador — Brand-aligned styles
   Palette: matte black + magenta-purple gradient + white
   ============================================================ */

:root {
  --bg: #08080f;
  --bg-card: #14141f;
  --bg-card-hover: #1a1a2a;
  --bg-input: #0d0d18;
  --border: #25253a;
  --border-strong: #34344e;
  --text: #ffffff;
  --text-dim: #b4b4c8;
  --text-muted: #6e6e80;
  --magenta: #ff2f8e;
  --purple: #7b3ff5;
  --gradient: linear-gradient(135deg, #ff2f8e 0%, #7b3ff5 100%);
  --gradient-soft: linear-gradient(135deg, rgba(255,47,142,0.15), rgba(123,63,245,0.15));
  --success: #2cd99b;
  --shadow-glow: 0 0 40px rgba(255, 47, 142, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Subtle radial gradient on body */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(255, 47, 142, 0.08), transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(123, 63, 245, 0.08), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

main, section, header, footer { position: relative; z-index: 1; }

/* ============ HEADER ============ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 8, 15, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 18px; letter-spacing: -0.5px; }
.brand-sede { color: var(--text); }
.brand-ia { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.brand-divider { color: var(--text-muted); margin: 0 4px; font-weight: 400; }
.brand-product { color: var(--text-dim); font-weight: 500; }
.header-nav { display: flex; gap: 24px; }
.header-nav a { color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 500; transition: color 0.2s; }
.header-nav a:hover { color: var(--text); }

/* ============ HERO ============ */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  max-width: 900px;
  margin: 0 auto;
}
.hero-eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
}
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 40px;
}
.hero-meta {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}
.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.meta-item strong {
  font-size: 24px;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.meta-item span {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============ APP ============ */
.app {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto 80px;
  padding: 0 24px;
}
@media (max-width: 900px) { .app { grid-template-columns: 1fr; } }

.form-card, .result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-glow);
}
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.card-header h2 { font-size: 22px; font-weight: 700; }

.quota-badge {
  background: var(--gradient-soft);
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}
.quota-divider { color: var(--text-muted); margin: 0 2px; }

/* ============ FORM ============ */
fieldset {
  border: none;
  margin-bottom: 28px;
}
fieldset legend {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.optional { color: var(--text-muted); font-weight: 400; font-style: italic; }

input[type="text"], input[type="number"], input[type="email"], textarea, select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--magenta);
  box-shadow: 0 0 0 3px rgba(255, 47, 142, 0.15);
}
textarea { resize: vertical; min-height: 80px; }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3e%3cpath fill='%23b4b4c8' d='M6 9L1 4h10z'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.email-gate {
  background: var(--gradient-soft);
  border-radius: var(--radius-sm);
  padding: 20px;
  border: 1px solid var(--border-strong);
}
.email-gate legend {
  background: var(--bg-card);
  padding: 0 8px;
  margin-left: -8px;
}
.email-help { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; }

/* ============ BUTTONS ============ */
.btn-primary, .btn-secondary, .btn-action {
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  font-size: 15px;
}
.btn-primary {
  background: var(--gradient);
  color: white;
  padding: 16px 24px;
  width: 100%;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 30px rgba(255, 47, 142, 0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  padding: 10px 16px;
}
.btn-secondary:hover { color: var(--text); border-color: var(--magenta); }
.btn-action {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 10px 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-action:hover { color: var(--text); border-color: var(--magenta); background: var(--bg-card-hover); }
.btn-full { width: 100%; }
.form-disclaimer { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 12px; }
.btn-loading { display: inline-flex; align-items: center; gap: 8px; }
.btn-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ RESULT ============ */
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.result-content {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  white-space: pre-wrap;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
  max-height: 600px;
  overflow-y: auto;
}
.result-content h1, .result-content h2, .result-content h3 { color: var(--text); margin-top: 16px; margin-bottom: 8px; }
.result-content strong { color: var(--text); font-weight: 700; }
.result-content table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.result-content td, .result-content th { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }

.result-upsell {
  margin-top: 24px;
  padding: 24px;
  background: var(--gradient-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  text-align: center;
}
.result-upsell h3 { margin-bottom: 8px; font-size: 18px; }
.result-upsell p { color: var(--text-dim); margin-bottom: 16px; }
.result-upsell a { display: inline-block; padding: 12px 28px; width: auto; }

/* ============ PRICING ============ */
.pricing {
  padding: 80px 24px;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.pricing h2 { font-size: 36px; font-weight: 800; margin-bottom: 8px; letter-spacing: -1px; }
.pricing-sub { color: var(--text-dim); margin-bottom: 48px; font-size: 16px; }
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 800px; margin: 0 auto; }
@media (max-width: 700px) { .pricing-grid { grid-template-columns: 1fr; } }

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: left;
  position: relative;
}
.pricing-card-pro {
  border-color: var(--magenta);
  box-shadow: 0 0 60px rgba(255, 47, 142, 0.2);
  background: linear-gradient(180deg, rgba(255,47,142,0.05) 0%, var(--bg-card) 50%);
}
.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient);
  color: white;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 999px;
}
.pricing-tier {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.pricing-price {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.pricing-price span { font-size: 16px; color: var(--text-muted); font-weight: 500; }
.price-old { font-size: 24px !important; color: var(--text-muted) !important; text-decoration: line-through; }
.price-new { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.pricing-note { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; }
.pricing-note code { background: var(--bg-input); padding: 2px 8px; border-radius: 4px; font-size: 12px; color: var(--magenta); }
.pricing-features { list-style: none; margin-bottom: 28px; }
.pricing-features li { padding: 8px 0; color: var(--text-dim); font-size: 14px; }
.pricing-features li.muted { color: var(--text-muted); text-decoration: line-through; }
.pricing-features strong { color: var(--text); }

/* ============ HOW ============ */
.how {
  padding: 80px 24px;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}
.how h2 { font-size: 36px; font-weight: 800; margin-bottom: 48px; letter-spacing: -1px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 700px) { .how-grid { grid-template-columns: 1fr; } }
.how-step { padding: 32px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.how-num {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  color: white;
  font-weight: 800;
  font-size: 20px;
  border-radius: 50%;
  margin: 0 auto 16px;
}
.how-step h3 { margin-bottom: 8px; font-size: 18px; }
.how-step p { color: var(--text-dim); font-size: 14px; }

/* ============ FAQ ============ */
.faq {
  padding: 80px 24px;
  max-width: 800px;
  margin: 0 auto;
}
.faq h2 { font-size: 36px; font-weight: 800; margin-bottom: 32px; text-align: center; letter-spacing: -1px; }
.faq details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}
.faq details:hover { border-color: var(--border-strong); }
.faq details[open] { border-color: var(--magenta); }
.faq summary {
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--magenta); font-size: 20px; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--text-dim); margin-top: 12px; font-size: 14px; }

/* ============ FOOTER ============ */
.site-footer {
  padding: 60px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer-brand {
  font-weight: 800;
  font-size: 24px;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.site-footer p {
  color: var(--text-dim);
  margin-bottom: 24px;
}
.footer-links {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--magenta); }
.footer-fine {
  color: var(--text-muted);
  font-size: 12px;
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--success);
  color: var(--text);
  padding: 14px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  transition: transform 0.3s ease-out;
  z-index: 1000;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--magenta); }

/* ============ AUTH UI ============ */
.nav-auth-btn { background: transparent; border: 1px solid var(--border-strong); color: var(--text); font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
.nav-auth-btn:hover { border-color: var(--magenta); color: var(--magenta); }
.user-badge { display: inline-block; background: var(--gradient); color: white; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 1px; margin-right: 12px; }
.nav-link-btn { background: transparent; border: none; color: var(--text-dim); font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; padding: 4px 8px; transition: color 0.2s; }
.nav-link-btn:hover { color: var(--text); }
#userMenu { display: flex; align-items: center; gap: 4px; }

.link-btn { background: transparent; border: none; color: var(--magenta); font-family: inherit; font-size: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-decoration-color: rgba(255,47,142,0.4); }
.link-btn:hover { text-decoration-color: var(--magenta); }

/* Auth modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none !important; }
[hidden] { display: none !important; }
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 40px 32px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), var(--shadow-glow);
  position: relative;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--bg-input); color: var(--text); }

/* Pro tier state */
body.pro .quota-badge { background: var(--gradient); color: white; border-color: transparent; }
body.pro .quota-badge::before { content: "PRO · "; font-weight: 800; }
body.pro .quota-badge .quota-divider, body.pro .quota-badge span:not(.quota-divider) { display: none; }
body.pro .quota-badge::after { content: "Ilimitadas"; }
body.pro .result-upsell { display: none !important; }

/* ===== Bundle pricing card (3rd tier) ===== */
.pricing-grid {
  grid-template-columns: repeat(3, 1fr) !important;
  max-width: 1100px !important;
}
@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: 1fr !important; max-width: 480px !important; }
}
.pricing-card-bundle {
  border-color: #7c3aed;
  box-shadow: 0 0 60px rgba(124, 58, 237, 0.25);
  background: linear-gradient(180deg, rgba(124,58,237,0.06) 0%, rgba(34,211,238,0.03) 50%, var(--bg-card) 100%);
}
.pricing-card-bundle .price-new {
  background: linear-gradient(135deg, #7c3aed, #22d3ee);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   MODE SELECTOR (v2 — 4-mode form)
   ============================================================ */
.mode-selector legend {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}
@media (min-width: 900px) {
  .mode-grid { grid-template-columns: repeat(4, 1fr); }
}
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 14px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.mode-card:hover {
  border-color: var(--text-dim);
  background: rgba(255, 255, 255, 0.03);
}
.mode-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode-card:has(input[type="radio"]:checked) {
  border-color: var(--magenta);
  background: linear-gradient(180deg, rgba(255,47,142,0.10) 0%, var(--bg-input) 100%);
  box-shadow: 0 0 24px rgba(255, 47, 142, 0.15);
}
.mode-card:has(input[type="radio"]:checked) .mode-title {
  color: var(--text);
}
.mode-icon {
  font-size: 22px;
  line-height: 1;
}
.mode-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
}
.mode-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}
