/* ═══════════════════════════════════════════════════════════════════════════
   Reserves ATECA — Full corporatiu de documentació
   Paleta extreta de la interfície de l'aplicació (home.png)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Variables de marca ─────────────────────────────────────────────────── */
:root {
  /* Indigo / brand principal */
  --ateca-900:   #1e1b4b;
  --ateca-800:   #312e81;
  --ateca-700:   #3730a3;
  --ateca-600:   #4f46e5;
  --ateca-500:   #6366f1;
  --ateca-400:   #818cf8;
  --ateca-300:   #a5b4fc;
  --ateca-200:   #c7d2fe;
  --ateca-100:   #e0e7ff;

  /* Violet (gradient accent) */
  --ateca-violet: #c084fc;

  /* Semàntics */
  --ateca-orange: #f97316;   /* incidències / advertències */
  --ateca-green:  #10b981;   /* dispositius / èxit */
  --ateca-red:    #ef4444;   /* error / eliminar */
}

/* ═══════════════════════════════════════════════════════════════════════════
   Hero de la pàgina d'inici
   ═══════════════════════════════════════════════════════════════════════════ */

.mdx-hero {
  background: linear-gradient(135deg, var(--ateca-900) 0%, var(--ateca-800) 45%, var(--ateca-900) 100%);
  padding: 4rem 0 5rem;
  overflow: hidden;
  position: relative;
}

/* Decoració de fons: cercles desenfocats */
.mdx-hero::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.mdx-hero::after {
  content: "";
  position: absolute;
  bottom: -60px;
  left: 10%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.mdx-hero__inner {
  display: flex;
  align-items: center;
  gap: 3rem;
  position: relative;
  z-index: 1;
}

/* ── Contingut esquerre ── */
.mdx-hero__teaser {
  flex: 1;
  min-width: 0;
}

.mdx-hero__teaser .mdx-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--ateca-300);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  margin-bottom: 1.25rem;
}

.mdx-hero__teaser h1 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  color: #ffffff;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.mdx-hero__teaser h1 .mdx-hero__accent {
  background: linear-gradient(90deg, var(--ateca-400), var(--ateca-violet));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mdx-hero__teaser p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ateca-300);
  margin: 0 0 2rem;
  max-width: 420px;
}

/* Botons CTA */
.mdx-hero__teaser .mdx-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.mdx-hero__teaser .md-button {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.mdx-hero__teaser .md-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.mdx-hero__teaser .md-button--primary {
  background: var(--ateca-600);
  border-color: var(--ateca-600);
  color: #ffffff;
}

.mdx-hero__teaser .md-button--primary:hover {
  background: var(--ateca-500);
  border-color: var(--ateca-500);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5);
}

.mdx-hero__teaser .md-button:not(.md-button--primary) {
  border: 1.5px solid rgba(165, 180, 252, 0.35);
  color: var(--ateca-300);
  background: transparent;
}

.mdx-hero__teaser .md-button:not(.md-button--primary):hover {
  border-color: rgba(165, 180, 252, 0.7);
  color: #ffffff;
  background: rgba(99, 102, 241, 0.1);
}

/* Stats ràpids */
.mdx-hero__stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.mdx-hero__stat-item {
  display: flex;
  flex-direction: column;
}

.mdx-hero__stat-item .stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1;
}

.mdx-hero__stat-item .stat-label {
  font-size: 0.78rem;
  color: var(--ateca-500);
  margin-top: 0.2rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Imatge dreta ── */
.mdx-hero__image {
  flex: 1.1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.mdx-hero__image img {
  width: 100%;
  max-width: 560px;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(99, 102, 241, 0.15);
  transition: transform 0.3s ease;
}

.mdx-hero__image img:hover {
  transform: translateY(-4px) scale(1.01);
}

/* ── Responsive ── */
@media screen and (max-width: 76.1875em) {
  .mdx-hero__inner {
    flex-direction: column;
    text-align: center;
  }

  .mdx-hero__teaser p {
    max-width: 100%;
  }

  .mdx-hero__teaser .mdx-hero__cta {
    justify-content: center;
  }

  .mdx-hero__stats {
    justify-content: center;
  }

  .mdx-hero__image {
    width: 100%;
    max-width: 540px;
  }
}

@media screen and (max-width: 44.9375em) {
  .mdx-hero {
    padding: 2.5rem 0 3rem;
  }

  .mdx-hero__teaser h1 {
    font-size: 1.75rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Captures de pantalla — .screenshot i .screenshot-sm
   Ús: ![alt](path){ .screenshot }
   ═══════════════════════════════════════════════════════════════════════════ */

.screenshot {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.07),
    0 10px 30px -5px rgba(30, 27, 75, 0.12);
  margin: 1.5rem auto;
}

/* Versió compacta per a detalls petits */
.screenshot-sm {
  display: block;
  max-width: 480px;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 6px 16px rgba(30, 27, 75, 0.10);
  margin: 1rem auto;
}

/* Peu de foto opcional: *text en cursiva* just a sota de .screenshot */
.screenshot + em,
.screenshot-sm + em {
  display: block;
  text-align: center;
  font-size: 0.82rem;
  color: var(--md-default-fg-color--light);
  margin-top: -1rem;
  margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Insígnies de rol — .badge-admin / .badge-gestor / .badge-usuari
   Ús inline: `Admin`{ .badge-admin }
   ═══════════════════════════════════════════════════════════════════════════ */

.badge-admin,
.badge-gestor,
.badge-usuari {
  display: inline-flex;
  align-items: center;
  font-size: 0.70rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 99px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

/* Admin: navy fosc — replica el botó "Admin" de l'app */
.badge-admin {
  background: var(--ateca-900);
  color: #ffffff;
}

/* Gestor: indigo mitjà */
.badge-gestor {
  background: var(--ateca-600);
  color: #ffffff;
}

/* Usuari: indigo molt clar */
.badge-usuari {
  background: var(--ateca-100);
  color: var(--ateca-700);
  border: 1px solid var(--ateca-200);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Placeholder de captura pendent
   Ús: !!! pending-screenshot "Nom de la captura"
       Captura pendent: descripció del que cal afegir.
   ═══════════════════════════════════════════════════════════════════════════ */

.md-typeset .admonition.pending-screenshot,
.md-typeset details.pending-screenshot {
  border-color: var(--ateca-400);
}

.md-typeset .pending-screenshot > .admonition-title,
.md-typeset .pending-screenshot > summary {
  background-color: rgba(129, 140, 248, 0.12);
}

.md-typeset .pending-screenshot > .admonition-title::before,
.md-typeset .pending-screenshot > summary::before {
  background-color: var(--ateca-400);
  /* Icona càmera via SVG inline */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 15.2A3.2 3.2 0 0 1 8.8 12 3.2 3.2 0 0 1 12 8.8 3.2 3.2 0 0 1 15.2 12 3.2 3.2 0 0 1 12 15.2M20 4h-3.17L15 2H9L7.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 15.2A3.2 3.2 0 0 1 8.8 12 3.2 3.2 0 0 1 12 8.8 3.2 3.2 0 0 1 15.2 12 3.2 3.2 0 0 1 12 15.2M20 4h-3.17L15 2H9L7.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z'/%3E%3C/svg%3E");
}

/* ═══════════════════════════════════════════════════════════════════════════
   Ajustos globals de marca sobre el tema Material
   ═══════════════════════════════════════════════════════════════════════════ */

/* Accent del tema en mode clar: reforçar amb el color de marca */
[data-md-color-scheme="default"] {
  --md-primary-fg-color:        var(--ateca-700);
  --md-primary-fg-color--light: var(--ateca-500);
  --md-primary-fg-color--dark:  var(--ateca-900);
  --md-accent-fg-color:         var(--ateca-600);
}

/* Accent del tema en mode fosc */
[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        var(--ateca-400);
  --md-primary-fg-color--light: var(--ateca-300);
  --md-primary-fg-color--dark:  var(--ateca-200);
  --md-accent-fg-color:         var(--ateca-400);
}
