/* afi informàtica — estils del lloc (sense Tailwind: abans es carregava cada visita des d'un CDN) */
:root {
  --afi-light: #64c3de;
  --afi-medium: #4a91c2;
  --afi-dark: #37589f;
  --afi-gray: #6c757d;
  --ink: #1f2937;
  --soft: #f9fafb;
  --line: #e5e7eb;
  --red: #dc2626;
  --header-h: 80px;
  --nc-accent: #37589f;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; font-size: 17px; line-height: 1.6; color: var(--ink); background: #fff; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--afi-dark); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; }
.container { width: min(1200px, 100% - 40px); margin: 0 auto; }

.btn {
  display: inline-block; text-align: center; cursor: pointer; text-decoration: none; font: inherit; font-weight: 700;
  padding: 12px 30px; border-radius: 999px; border: 2px solid transparent; transition: box-shadow .3s, background .3s, color .3s;
}
.btn:hover { box-shadow: 0 8px 20px rgba(55,88,159,.25); }
.btn--gradient { background: linear-gradient(90deg, var(--afi-light), var(--afi-dark)); color: #fff; }
.btn--outline { border-color: var(--afi-medium); color: var(--afi-dark); }
.btn--outline:hover { background: var(--afi-medium); color: #fff; }
.btn--white { background: #fff; color: var(--afi-dark); }
.btn--ghost { border-color: #fff; color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--afi-dark); }
.btn--support { background: linear-gradient(90deg, #ef4444, #b91c1c); color: #fff !important; padding: 8px 24px; }
.btn:disabled { opacity: .6; cursor: wait; }
.gradient-text { background: linear-gradient(90deg, var(--afi-light), var(--afi-dark)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Capçalera */
.site-header { position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h); background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 32px; }
.nav a:not(.btn) { color: var(--afi-gray); font-weight: 500; text-decoration: none; }
.nav a:not(.btn):hover { color: var(--afi-dark); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; margin: 5px 0; background: var(--afi-gray); }

/* Portada */
.hero { padding: calc(var(--header-h) + 90px) 0 90px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(34px, 4.6vw, 50px); }
.lead { font-size: 19px; color: var(--afi-gray); margin: 0 0 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 16px; }
.actions--center { justify-content: center; }
.hero-photo { position: relative; }
.hero-photo::before { content: ''; position: absolute; inset: 0; background: var(--afi-light); opacity: .2; border-radius: 10px; transform: rotate(3deg) scale(1.05); }
.hero-photo img { position: relative; border-radius: 10px; box-shadow: 0 20px 40px rgba(0,0,0,.18); }

/* Seccions */
.section { padding: 80px 0; }
.section--soft { background: var(--soft); }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 56px; }
.section-head h2 { font-size: clamp(30px, 3.6vw, 38px); }
.section-head p { font-size: 18px; color: var(--afi-gray); margin: 0; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.08); transition: transform .3s, box-shadow .3s; }
.card:hover { transform: translateY(-5px); box-shadow: 0 16px 30px rgba(0,0,0,.1); }

.services { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.service { padding: 32px 28px; }
.service h3 { font-size: 20px; }
.service p { margin: 0; color: var(--afi-gray); }
.icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 24px; border-radius: 50%; background: linear-gradient(90deg, var(--afi-light), var(--afi-dark)); }
.icon svg { width: 32px; height: 32px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon--img img { width: 40px; height: auto; }

.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.product { overflow: hidden; display: flex; flex-direction: column; }
.product-banner { height: 220px; display: grid; place-items: center; background: linear-gradient(90deg, var(--afi-light), var(--afi-dark)); }
.product:nth-child(even) .product-banner { background: linear-gradient(90deg, var(--afi-dark), var(--afi-medium)); }
.product-banner h3 { color: #fff; font-size: 38px; margin: 0; }
.product-body { padding: 30px 30px 34px; display: flex; flex-direction: column; flex: 1; }
.product-body h4 { font-size: 23px; }
.product-body > p { color: var(--afi-gray); margin: 0 0 20px; }
.checks { list-style: none; margin: 0 0 28px; padding: 0; }
.checks li { position: relative; padding: 4px 0 4px 30px; }
.checks li::before { content: ''; position: absolute; left: 0; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--afi-medium) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.5 2.5L14 7.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat; }
.product-body .btn { align-self: flex-start; margin-top: auto; }

/* Crida */
.cta { padding: 80px 0; text-align: center; color: #fff; background: linear-gradient(135deg, rgba(55,88,159,.95), rgba(100,195,222,.85)); }
.cta h2 { font-size: clamp(28px, 3.6vw, 38px); }
.cta p { max-width: 760px; margin: 0 auto 32px; font-size: 18px; opacity: .92; }

/* Contacte */
.contact-card { max-width: 980px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 40px rgba(0,0,0,.12); }
.contact-info { padding: 48px; color: #fff; background: linear-gradient(135deg, var(--afi-light), var(--afi-dark)); }
.contact-info h3 { font-size: 24px; margin-bottom: 28px; }
.info-row { display: flex; gap: 14px; margin-bottom: 24px; }
.info-row svg { flex: none; width: 24px; height: 24px; margin-top: 2px; fill: #fff; }
.info-row h4 { font-size: 17px; margin: 0 0 4px; }
.info-row p { margin: 0; }
.info-row a { color: #fff; }
.form { padding: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; align-content: start; background: #fff; }
.form .full { grid-column: 1 / -1; }
.form label { display: block; font-size: 14px; font-weight: 500; color: var(--afi-gray); }
.form input[type="text"], .form input[type="email"], .form textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 14px; font: inherit; font-size: 16px; color: var(--ink);
  border: 1px solid #d1d5db; border-radius: 6px;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--afi-light); border-color: transparent; }
.form textarea { resize: vertical; min-height: 120px; }
.form .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.form .check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--afi-dark); flex: none; }
.form .hp { position: absolute; left: -9999px; }
.form-status { margin: 0; font-size: 15px; text-align: center; }
.form-status:empty { display: none; }
.form-status.is-error { color: #b91c1c; }

/* Peu */
.site-footer { background: var(--afi-dark); color: #d1d5db; padding: 56px 0 32px; font-size: 16px; }
.site-footer a { color: #d1d5db; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.footer-logo { height: 40px; width: auto; margin-bottom: 16px; }
.site-footer h3 { color: #fff; font-size: 18px; margin-bottom: 16px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-contact li { display: flex; gap: 8px; }
.footer-contact svg { flex: none; width: 20px; height: 20px; margin-top: 3px; fill: #d1d5db; }
.footer-bottom { margin-top: 48px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.15); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer-bottom p { margin: 0; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-legal button { color: #d1d5db; text-decoration: none; }
.footer-legal button:hover { color: #fff; }

/* Pàgines legals */
.legal { padding: calc(var(--header-h) + 50px) 0 80px; }
.legal .container { max-width: 860px; }
.legal h1 { font-size: clamp(30px, 4vw, 40px); }
.legal h2 { font-size: 22px; color: var(--afi-dark); margin-top: 1.6em; }
.legal table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal th, .legal td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal th { background: var(--soft); }
.legal .todo { background: #fff3cd; padding: 0 4px; border-radius: 3px; }

/* Mode edició: la barra de l'editor ocupa 48 px */
.is-admin .site-header { top: 48px; }

@media (max-width: 1024px) {
  .services { grid-template-columns: 1fr 1fr; }
  .products { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 18px; background: #fff; box-shadow: 0 8px 12px rgba(0,0,0,.08); }
  .nav.is-open { display: flex; }
  .nav a:not(.btn) { padding: 10px 0; }
  .nav .btn { margin-top: 10px; }
  .hero { padding-top: calc(var(--header-h) + 40px); }
  .hero-grid, .contact-card, .form { grid-template-columns: 1fr; }
  .services, .footer-grid { grid-template-columns: 1fr; }
  .contact-info, .form { padding: 32px 24px; }
  .section { padding: 60px 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
}
