
/* ── Variables ─────────────────────────────────── */
:root {
  --navy:      #0F1B2D;
  --navy-mid:  #1A2E4A;
  --navy-light:#2C4566;
  --gold:      #C4933F;
  --gold-light:#E8C27A;
  --gold-pale: #F7EDD6;
  --cream:     #FAF7F2;
  --cream-dark:#F0EAE0;
  --stone:     #8B8275;
  --charcoal:  #1C1C1A;
  --white:     #FEFDFB;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;

  --radius-sm:  4px;
  --radius-md:  10px;
  --radius-lg:  20px;
  --shadow-sm:  0 1px 6px rgba(15,27,45,0.08);
  --shadow-md:  0 4px 20px rgba(15,27,45,0.12);
  --shadow-lg:  0 12px 48px rgba(15,27,45,0.18);
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--cream);
  color: var(--charcoal);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Tipografia ────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--navy);
}
h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; }
p  { font-weight: 300; }
em { font-family: var(--font-display); font-style: italic; }

/* ── Layout ────────────────────────────────────── */
.container { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.section    { padding: 72px 0; }
.section-sm { padding: 48px 0; }

/* ── Botó ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem; font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer; border: none;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, color 0.18s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-navy  { background: var(--navy); color: var(--white); }
.btn-navy:hover  { background: var(--navy-mid); }
.btn-gold  { background: var(--gold); color: var(--white); }
.btn-gold:hover  { background: #b0822e; }
.btn-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-lg { padding: 16px 36px; font-size: 0.95rem; }
.btn-sm { padding: 9px 18px; font-size: 0.8rem; }

/* ── Header ────────────────────────────────────── */
/* ════════════════════════════════════════════
   HEADER — disseny professional compacte
   ════════════════════════════════════════════ */
.site-header {
  background: var(--navy);
  position: sticky; top: 0; z-index: 200;
  border-bottom: 1px solid rgba(196,147,63,0.20);
  box-shadow: 0 2px 16px rgba(10,18,30,0.25);
}
.site-header .container {
  display: flex; align-items: center;
  justify-content: space-between;
  padding-top: 0; padding-bottom: 0;
  height: 54px;
}

/* ── Logo tipogràfic — sense icona ── */
.logo {
  display: flex; align-items: baseline; gap: 0;
  font-family: var(--font-display);
  font-size: 1.35rem; font-weight: 600;
  color: var(--white);
  letter-spacing: -0.02em;
  text-decoration: none;
  line-height: 1;
}
.logo-l {
  color: var(--gold);
  font-size: 1.6rem;
  font-weight: 600;
  margin-right: 1px;
  line-height: 1;
}
.logo-legals { color: var(--white); }
.logo-dot    { color: var(--gold-light); }
.logo-cat    { color: rgba(255,255,255,0.60); font-size: 1.1rem; font-weight: 400; }
.logo-tag {
  display: inline-block;
  margin-left: 10px;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(196,147,63,0.65);
  border-left: 1px solid rgba(196,147,63,0.30);
  padding-left: 10px;
  line-height: 1;
  align-self: center;
}
/* Ocultar el tag en pantalles petites */
@media (max-width: 640px) { .logo-tag { display: none; } }

/* ── Nav central ── */
.nav-links {
  display: flex; gap: 24px; align-items: center;
}
.nav-links a {
  font-size: 0.80rem; font-weight: 400;
  color: rgba(255,255,255,0.62);
  letter-spacing: 0.03em;
  transition: color 0.15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--gold-light); }

/* ── Acció dreta — visible SEMPRE inclòs mòbil ── */
.header-cta {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.header-cta a {
  font-size: 0.76rem; font-weight: 500;
  color: var(--gold-light);
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color 0.15s;
  text-decoration: none;
}
.header-cta a:hover { color: #fff; }
.header-cta .btn {
  font-size: 0.76rem;
  padding: 6px 16px;
  border-radius: 3px;
}
.header-cta .sep {
  width: 1px; height: 18px;
  background: rgba(255,255,255,0.15);
}

/* ── Hero ──────────────────────────────────────── */
.hero {
  background: var(--navy);
  padding: 96px 0 80px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 75% 30%, rgba(196,147,63,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 15% 80%, rgba(44,69,102,0.60) 0%, transparent 50%);
}
/* Motiu geomètric decoratiu */
.hero::after {
  content: '';
  position: absolute;
  right: -80px; top: -80px;
  width: 500px; height: 500px;
  border: 1px solid rgba(196,147,63,0.12);
  border-radius: 50%;
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(196,147,63,0.15);
  border: 1px solid rgba(196,147,63,0.35);
  border-radius: var(--radius-lg);
  padding: 5px 14px;
  font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 24px;
}
.hero h1 {
  color: var(--white);
  max-width: 640px;
  margin-bottom: 18px;
}
.hero h1 em { color: var(--gold-light); }
.hero-sub {
  color: rgba(255,255,255,0.68);
  font-size: 1.05rem;
  max-width: 500px;
  margin-bottom: 36px;
  font-weight: 300;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.hero-note {
  font-size: 0.76rem;
  color: rgba(255,255,255,0.40);
  margin-top: 18px;
  display: flex; align-items: center; gap: 6px;
}
.hero-note::before { content: '🔒'; font-size: 0.7rem; }

/* ── Categories ────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 36px;
}
.cat-card {
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  text-decoration: none; color: inherit;
  display: block;
}
.cat-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.cat-icon { font-size: 1.8rem; margin-bottom: 10px; }
.cat-name {
  font-family: var(--font-display);
  font-size: 1.05rem; color: var(--navy);
  margin-bottom: 4px;
}
.cat-count { font-size: 0.76rem; color: var(--stone); }

/* ── Documents grid ────────────────────────────── */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
  margin-top: 28px;
}
.doc-card {
  background: var(--white);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex; flex-direction: column;
}
.doc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.doc-card-top {
  background: var(--navy);
  padding: 22px 22px 18px;
  display: flex; align-items: flex-start; gap: 14px;
}
.doc-type-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: rgba(196,147,63,0.18);
  border: 1px solid rgba(196,147,63,0.30);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.doc-card-top h3 {
  color: var(--white);
  font-size: 1rem; margin-bottom: 3px;
}
.doc-card-top p {
  color: rgba(255,255,255,0.60);
  font-size: 0.78rem; line-height: 1.4;
}

.doc-card-body { padding: 18px 22px; flex: 1; }
.doc-includes {
  list-style: none; padding: 0; margin: 0 0 14px;
}
.doc-includes li {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 0.83rem; color: var(--charcoal);
  padding: 4px 0;
  border-bottom: 1px solid var(--cream-dark);
}
.doc-includes li:last-child { border-bottom: none; }
.doc-includes li::before {
  content: '✓';
  color: var(--gold);
  font-weight: 600;
  font-size: 0.75rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.doc-card-footer {
  padding: 14px 22px 20px;
  border-top: 1px solid var(--cream-dark);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.doc-price-free {
  font-size: 0.76rem;
  color: var(--stone);
}
.doc-price-free strong {
  display: block;
  font-size: 0.85rem;
  color: var(--navy);
  font-weight: 600;
}

/* ── Badge ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px;
  border-radius: var(--radius-lg);
  font-size: 0.70rem; font-weight: 500;
  letter-spacing: 0.04em;
}
.badge-free   { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.badge-pro    { background: var(--gold-pale); color: #6B4C1E; border: 1px solid var(--gold-light); }
.badge-new    { background: var(--navy); color: var(--gold-light); border: 1px solid rgba(196,147,63,0.3); }

/* ── Feature strip ─────────────────────────────── */
.features-strip {
  background: var(--navy-mid);
  padding: 48px 0;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 28px;
}
.feature-item {
  display: flex; gap: 14px; align-items: flex-start;
}
.feature-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  background: rgba(196,147,63,0.15);
  border: 1px solid rgba(196,147,63,0.25);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.feature-item h4 { color: var(--white); margin-bottom: 3px; font-size: 0.9rem; }
.feature-item p  { color: rgba(255,255,255,0.55); font-size: 0.80rem; line-height: 1.5; }

/* ── Avís legal ────────────────────────────────── */
.legal-notice {
  background: var(--gold-pale);
  border: 1px solid rgba(196,147,63,0.30);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-size: 0.78rem;
  color: #5C3D11;
  line-height: 1.6;
  margin-top: 14px;
}
.legal-notice strong { font-weight: 600; }

/* ── Document viewer modal ─────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,18,30,0.80);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-md);
  max-width: 720px; width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  background: var(--navy);
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { color: var(--white); font-size: 1rem; }
.modal-close {
  background: rgba(255,255,255,0.10);
  border: none; color: var(--white);
  width: 30px; height: 30px;
  border-radius: 50%; cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.modal-close:hover { background: rgba(255,255,255,0.22); }
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--cream-dark);
  background: var(--cream);
  padding: 0 24px;
}
.modal-tab {
  padding: 12px 0; margin-right: 24px;
  font-size: 0.82rem; font-weight: 500;
  color: var(--stone); cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  background: none; border-top: none; border-left: none; border-right: none;
  font-family: var(--font-body);
}
.modal-tab.active { color: var(--navy); border-bottom-color: var(--gold); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--cream-dark);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}

/* ── Document preview ──────────────────────────── */
.doc-preview {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--charcoal);
}
.doc-preview h2 {
  font-size: 1.3rem;
  text-align: center;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.doc-preview .doc-subtitle {
  text-align: center;
  font-style: italic;
  color: var(--stone);
  font-size: 0.9rem;
  margin-bottom: 28px;
  display: block;
}
.doc-preview p { margin-bottom: 12px; text-align: justify; }
.doc-preview .clause-num {
  font-weight: 600; color: var(--navy);
}
.doc-preview .field {
  background: var(--gold-pale);
  border: 1px dashed var(--gold);
  border-radius: 2px;
  padding: 1px 6px;
  color: var(--navy);
  font-style: normal;
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
}
.doc-preview .field:hover { background: var(--gold-light); }
.doc-preview .blurred {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
  position: relative;
}

/* ── Form d'edició ─────────────────────────────── */
.edit-form { display: flex; flex-direction: column; gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 5px; }
.form-row label {
  font-size: 0.78rem; font-weight: 500;
  color: var(--navy); letter-spacing: 0.03em;
}
.form-row input, .form-row select, .form-row textarea {
  padding: 10px 12px;
  border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--charcoal);
  background: var(--white);
  transition: border-color 0.15s;
  width: 100%;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.form-row textarea { resize: vertical; min-height: 70px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Stripe payment ────────────────────────────── */
.payment-box {
  background: var(--navy);
  border-radius: var(--radius-md);
  padding: 28px;
  text-align: center;
  color: var(--white);
}
.payment-box h4 { color: var(--gold-light); margin-bottom: 8px; }
.payment-box p  { color: rgba(255,255,255,0.65); font-size: 0.84rem; margin-bottom: 20px; }
.payment-price {
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--gold-light);
  margin-bottom: 4px;
}
.payment-period { font-size: 0.75rem; color: rgba(255,255,255,0.45); margin-bottom: 18px; }
.payment-secure {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.40);
  margin-top: 12px;
}

/* ── Seccions especials ────────────────────────── */
.section-label {
  font-size: 0.70rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.section-title { margin-bottom: 10px; }
.section-sub {
  color: var(--stone);
  font-size: 0.95rem;
  max-width: 520px;
  margin-bottom: 36px;
}
.separator {
  width: 48px; height: 2px;
  background: var(--gold);
  margin: 16px 0 28px;
}

/* ── FAQ ────────────────────────────────────────── */
.faq-list { max-width: 680px; margin-top: 28px; }
.faq-item {
  border-bottom: 1px solid var(--cream-dark);
  padding: 18px 0;
}
.faq-item:first-child { border-top: 1px solid var(--cream-dark); }
.faq-q {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  user-select: none;
}
.faq-q::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--gold);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a {
  font-size: 0.88rem;
  color: var(--stone);
  line-height: 1.7;
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s;
}
.faq-item.open .faq-a { max-height: 300px; padding-top: 10px; }

/* ── Footer ─────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.50);
  padding: 48px 0 28px;
  margin-top: 0;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 24px;
}
.footer-brand .logo { margin-bottom: 10px; }
.footer-brand p { font-size: 0.82rem; max-width: 260px; line-height: 1.6; }
.footer-col h5 {
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
  font-family: var(--font-body);
}
.footer-col a {
  display: block;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.50);
  padding: 3px 0;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--gold-light); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.74rem;
}
.footer-bottom a { color: rgba(255,255,255,0.40); transition: color 0.15s; }
.footer-bottom a:hover { color: var(--gold-light); }

/* ── Breadcrumb ─────────────────────────────────── */
.breadcrumb {
  font-size: 0.76rem;
  color: var(--stone);
  display: flex; gap: 7px; align-items: center;
  padding: 16px 0;
}
.breadcrumb a { color: var(--navy); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--cream-dark); }

/* ── Toast ──────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--navy); color: var(--white);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transform: translateY(100px); opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 860px) {
  .nav-links { display: none; }
  /* header-cta sempre visible — és l'única acció al mòbil */
  .header-cta { display: flex; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-footer { flex-direction: column; }
  .hero { padding: 64px 0 52px; }
}
@media (max-width: 600px) {
  .docs-grid { grid-template-columns: 1fr; }
  .cat-grid  { grid-template-columns: 1fr 1fr; }
}

/* ── Animacions ─────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up   { animation: fadeUp 0.55s ease both; }
.fade-up-2 { animation: fadeUp 0.55s 0.10s ease both; }
.fade-up-3 { animation: fadeUp 0.55s 0.20s ease both; }
.fade-up-4 { animation: fadeUp 0.55s 0.30s ease both; }

/* ── Vista prèvia document (SEO + protecció) ──────────────────── */
.doc-preview-wrap {
  position: relative;
  margin: 40px 0 0;
}
.doc-preview-scroll {
  height: 420px;
  overflow-y: scroll;
  overflow-x: hidden;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-md);
  background: var(--white);
  padding: 28px 32px 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--charcoal);
  /* Scrollbar discreta */
  scrollbar-width: thin;
  scrollbar-color: var(--cream-dark) transparent;
  /* Protecció de còpia */
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}
.doc-preview-scroll::-webkit-scrollbar { width: 5px; }
.doc-preview-scroll::-webkit-scrollbar-thumb { background: var(--cream-dark); border-radius: 3px; }
/* Difuminat inferior */
.doc-preview-fade {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, rgba(250,247,242,0.97) 80%);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  pointer-events: none;
}
/* CTA dins el difuminat */
.doc-preview-cta {
  position: absolute;
  bottom: 12px; left: 0; right: 0;
  text-align: center;
  pointer-events: auto;
}
