/* ============ RESET & BASE ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a8a;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --dark: #0a0e1a;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 40px -10px rgba(15,23,42,0.15);
  --shadow-xl: 0 30px 60px -15px rgba(15,23,42,0.25);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--gray-900);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background: white;
}

img, svg { display: block; max-width: 100%; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }

/* ============ NAV ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--gray-200);
}

.nav-inner {
  max-width: 1200px; /* Ampliat */
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--gray-900);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo span { color: var(--blue-600); }
.logo-light { color: white; }
.logo-light span { color: var(--blue-500); }

.nav-links {
  display: flex;
  gap: 2rem;
  font-size: 0.92rem;
  font-weight: 500;
}
.nav-links a {
  color: var(--gray-600);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--gray-900); }

.nav-cta { display: flex; gap: 0.6rem; align-items: center; }

/* ============ BOTONES ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue-600);
  color: white;
  box-shadow: 0 1px 2px rgba(37,99,235,0.3), 0 4px 12px -4px rgba(37,99,235,0.4);
}
.btn-primary:hover {
  background: var(--blue-700);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37,99,235,0.3), 0 8px 20px -4px rgba(37,99,235,0.5);
}

.btn-secondary {
  background: white;
  color: var(--gray-900);
  border: 1.5px solid var(--gray-300);
}
.btn-secondary:hover {
  border-color: var(--gray-500);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-700);
}
.btn-ghost:hover { color: var(--gray-900); }

.btn-white {
  background: white;
  color: var(--blue-700);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3);
}
.btn-white:hover { transform: translateY(-2px); }

.btn-lg { padding: 0.95rem 1.7rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ============ HERO HOME ============ */
.home-hero { background: linear-gradient(135deg, #0a0e1a 0%, #1e3a8a 50%, #2563eb 100%); color: white; padding: 6rem 1.5rem 5rem; text-align: center; position: relative; overflow: hidden; }
.home-hero::before { content: ""; position: absolute; top: -50%; left: -10%; width: 500px; height: 500px; background: radial-gradient(circle, rgba(255,255,255,0.1), transparent 70%); border-radius: 50%; }
.home-hero-content { position: relative; max-width: 800px; margin: 0 auto; }
.home-hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 1.2rem; }
.home-hero h1 span { background: linear-gradient(135deg, #60a5fa, #22d3ee); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.home-hero p { font-size: 1.25rem; opacity: 0.9; max-width: 600px; margin: 0 auto 2.5rem; }
.home-hero-cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.home-hero-cta .btn-white { background: white; color: var(--blue-700); padding: 1rem 2rem; font-size: 1.05rem; }
.home-hero-cta .btn-outline { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.4); padding: 1rem 2rem; font-size: 1.05rem; }
.home-hero-cta .btn-outline:hover { background: rgba(255,255,255,0.1); border-color: white; }

/* ============ TRUST BAR ============ */
.trust-bar { background: var(--gray-50); border-bottom: 1px solid var(--gray-200); padding: 1.5rem; text-align: center; }
.trust-bar p { font-size: 0.9rem; color: var(--gray-500); margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.trust-logos { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; opacity: 0.7; }
.trust-logos span { font-weight: 700; font-size: 1.1rem; color: var(--gray-700); }

/* ============ SECCIÓ DEMO ANIMADA ============ */
.demo-section { padding: 6rem 1.5rem; background: var(--gray-50); border-top: 1px solid var(--gray-200); border-bottom: 1px solid var(--gray-200); }
.demo-container { max-width: 1200px; margin: 0 auto; } /* Ampliat */
.demo-title { font-size: 2.5rem; font-weight: 800; text-align: center; margin-bottom: 4rem; letter-spacing: -0.02em; }

.demo-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 3rem; align-items: center; } /* Ampliat la columna de la dreta */
@media (max-width: 900px) { .demo-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* Text de l'esquerra */
.demo-texts { position: relative; min-height: 300px; }
.demo-text-item { position: absolute; top: 0; left: 0; width: 100%; opacity: 0; visibility: hidden; transition: all 0.5s ease; transform: translateY(10px); }
.demo-text-item.active { opacity: 1; visibility: visible; transform: translateY(0); }
.demo-text-item h3 { font-size: 1.8rem; font-weight: 800; margin-bottom: 1rem; color: var(--gray-900); }
.demo-text-item p { font-size: 1.05rem; color: var(--gray-600); margin-bottom: 1.5rem; line-height: 1.6; }
.demo-text-item ul { list-style: none; padding: 0; }
.demo-text-item li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; color: var(--gray-700); margin-bottom: 0.6rem; }
.demo-text-item li span { color: #10b981; font-weight: 900; }

/* Maqueta de la dreta */
.demo-visual { position: relative; }
.mockup-window { background: white; border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15); overflow: hidden; }
.mockup-header { background: var(--gray-50); padding: 0.8rem 1rem; display: flex; align-items: center; gap: 0.5rem; border-bottom: 1px solid var(--gray-200); }
.mockup-dot { width: 10px; height: 10px; border-radius: 50%; }
.mockup-dot.red { background: #ef4444; }
.mockup-dot.yellow { background: #f59e0b; }
.mockup-dot.green { background: #10b981; }
.mockup-url { margin-left: 1rem; font-size: 0.75rem; color: var(--gray-500); background: white; padding: 0.2rem 0.6rem; border-radius: 4px; font-family: monospace; }

.mockup-body { padding: 2rem; position: relative; min-height: 340px; }

.mockup-step { position: absolute; top: 2rem; left: 2rem; right: 2rem; opacity: 0; visibility: hidden; transition: all 0.5s ease; transform: translateX(20px); }
.mockup-step.active { opacity: 1; visibility: visible; transform: translateX(0); }

/* Estils interns de la maqueta */
.mockup-field { margin-bottom: 1rem; }
.mockup-field label { display: block; font-size: 0.75rem; color: var(--gray-500); margin-bottom: 0.3rem; font-weight: 600; }
.mockup-input { background: white; border: 1px solid var(--gray-200); padding: 0.6rem 0.8rem; border-radius: 6px; font-size: 0.9rem; color: var(--gray-800); }
.mockup-totals { margin-top: 1.5rem; border-top: 1px solid var(--gray-100); padding-top: 1rem; }
.mockup-row { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--gray-600); margin-bottom: 0.4rem; }
.mockup-row.total { font-size: 1.1rem; font-weight: 800; color: var(--blue-600); margin-top: 0.5rem; border-top: 2px solid var(--gray-100); padding-top: 0.5rem; }
.mockup-btn { background: var(--blue-600); color: white; text-align: center; padding: 0.7rem; border-radius: 6px; font-weight: 600; font-size: 0.9rem; margin-top: 1rem; }

.mockup-search { background: var(--gray-50); border: 1px solid var(--gray-200); padding: 0.6rem 0.8rem; border-radius: 6px; font-size: 0.85rem; color: var(--gray-500); margin-bottom: 1rem; }
.mockup-list-item { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem; border-bottom: 1px solid var(--gray-100); }
.mockup-list-item strong { font-size: 0.85rem; color: var(--gray-900); }
.mockup-list-item small { font-size: 0.75rem; color: var(--gray-500); }
.mockup-total-mini { font-weight: 700; color: var(--gray-900); font-size: 0.9rem; }

.mockup-secure-icon { font-size: 3rem; text-align: center; margin-bottom: 1rem; }
.mockup-secure-text { text-align: center; }
.mockup-secure-text strong { display: block; font-size: 1.1rem; margin-bottom: 0.3rem; }
.mockup-secure-text p { font-size: 0.85rem; color: var(--gray-500); }
.mockup-secure-badge { background: #ecfdf5; color: #059669; text-align: center; padding: 0.6rem; border-radius: 8px; font-weight: 600; font-size: 0.85rem; margin-top: 1.5rem; border: 1px solid #a7f3d0; }

/* ============ SECCIONS GENERALS ============ */
.home-section { max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem; } /* Ampliat */
.home-section h2 { font-size: 1.8rem; font-weight: 800; text-align: center; margin-bottom: 0.8rem; }
.home-section .lead { text-align: center; color: var(--gray-600); max-width: 550px; margin: 0 auto 3rem; font-size: 1rem; }
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; } /* Targetes una mica més amples */
.article-card { display: block; background: white; border: 1px solid var(--gray-200); border-radius: 16px; padding: 1.5rem; text-decoration: none; color: inherit; transition: all 0.25s ease; position: relative; }
.article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--blue-200); }
.article-card::after {
  content: "→";
  position: absolute;
  bottom: 1.5rem;
  right: 1.5rem;
  color: var(--blue-600);
  font-weight: 800;
  opacity: 0;
  transform: translateX(-5px);
  transition: all 0.2s;
}
.article-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}
.article-cat { display: inline-block; background: var(--blue-50); color: var(--blue-700); font-size: 0.65rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.8rem; }
.article-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 0.4rem; line-height: 1.35; color: var(--gray-900); }
.article-card p { color: var(--gray-600); font-size: 0.85rem; line-height: 1.5; margin-bottom: 0.8rem; }
.article-meta { font-size: 0.75rem; color: var(--gray-500); }
.ver-todos-wrap { text-align: center; margin: 3rem 0 0; }
.ver-todos-btn { display: inline-flex; align-items: center; gap: 0.6rem; background: var(--blue-600); color: white; padding: 0.9rem 2rem; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 1rem; transition: all 0.2s ease; box-shadow: 0 4px 14px rgba(37,99,235,0.3); }
.ver-todos-btn:hover { background: var(--blue-700); transform: translateY(-2px); }

/* ============ BANNER FINAL ============ */
.free-banner { background: linear-gradient(135deg, #10b981, #059669); color: white; border-radius: 16px; padding: 3rem 2rem; text-align: center; margin: 0; position: relative; overflow: hidden; box-shadow: 0 20px 40px -10px rgba(16, 185, 129, 0.2); }
.free-banner::before { content: ""; position: absolute; top: -50%; right: -10%; width: 300px; height: 300px; background: radial-gradient(circle, rgba(255,255,255,0.15), transparent 70%); border-radius: 50%; }
.free-banner-content { position: relative; max-width: 600px; margin: 0 auto; }
.free-banner .badge-free { display: inline-block; background: rgba(255,255,255,0.2); padding: 0.25rem 0.8rem; border-radius: 100px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.7rem; }
.free-banner h2 { color: white; font-size: clamp(1.4rem, 2.5vw, 1.8rem); margin-bottom: 0.6rem; }
.free-banner p { font-size: 0.95rem; opacity: 0.95; margin-bottom: 1.5rem; line-height: 1.5; max-width: 500px; margin-left: auto; margin-right: auto; }
.free-banner .features-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.free-banner .features-list span { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 500; }
.free-banner .features-list span::before { content: "✓"; font-weight: 800; font-size: 1rem; }
.free-banner .btn-white { background: white; color: #059669; padding: 0.8rem 1.8rem; font-size: 0.95rem; font-weight: 700; border-radius: 10px; text-decoration: none; display: inline-block; transition: transform 0.2s; }
.free-banner .btn-white:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(0,0,0,0.3); }

/* ============ FOOTER ============ */
.footer { background: var(--dark); color: var(--gray-300); padding: 3.5rem 0 1.8rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-brand p { font-size: 0.9rem; color: #94a3b8; margin: 0.9rem 0 1.3rem; max-width: 280px; }
.footer-social { display: flex; gap: 0.6rem; }
.footer-social a { width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,0.06); color: white; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 600; transition: background 0.2s; }
.footer-social a:hover { background: rgba(255,255,255,0.12); }

.footer h4 { color: white; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
.footer a { color: #94a3b8; text-decoration: none; display: block; padding: 0.25rem 0; font-size: 0.9rem; transition: color 0.15s; }
.footer a:hover { color: white; }
.footer-small { font-size: 0.82rem; color: #64748b; margin-top: 0.7rem; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1.5rem; display: flex; justify-content: space-between; font-size: 0.85rem; color: #64748b; flex-wrap: wrap; gap: 1rem; }

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 640px) {
  .home-section { padding: 3rem 1.5rem; }
  .nav-inner { padding: 0.8rem 1rem; }
  .home-hero-cta { flex-direction: column; }
  .home-hero-cta .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .trust-logos { gap: 1.5rem; }
}

/* Amagar els blocs d'anuncis fins que estiguin actius */
.ad-slot, .ad-slot-home, .ad-slot-section, div[class*="ad-slot"] {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}
/* Estils per al gràfic de la calculadora */
.calc-visual-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.calc-visual-text h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.calc-visual-text p {
  font-size: 0.95rem;
  color: var(--gray-600);
  margin: 0;
  line-height: 1.6;
}

.calc-visual-chart {
  background: var(--gray-50);
  border-radius: 12px;
  padding: 1.5rem 1.5rem 0.5rem;
  border: 1px solid var(--gray-200);
}

.chart-bar-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 120px;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(to top, var(--blue-600), var(--blue-400));
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: height 0.3s ease;
}

.chart-bar:hover {
  background: linear-gradient(to top, var(--blue-700), var(--blue-500));
}

.chart-label {
  position: absolute;
  top: -1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gray-700);
  white-space: nowrap;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--gray-500);
  border-top: 2px solid var(--gray-300);
  padding-top: 0.5rem;
}

@media (max-width: 640px) {
  .calc-visual-intro {
    grid-template-columns: 1fr;
  }
}
