/* Estils generals i corporatius */
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: #f4f4f4;
  color: #333;
}

/* Capçalera i logo */
header {
  background: #0d47a1;
  color: #fff;
  padding: 2rem;
}
.header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  max-height: 80px;
  height: auto;
  width: auto;
}
.header-text h1 {
  margin: 0;
  font-size: 2.2rem;
}
.header-text p {
  margin-top: .5rem;
  font-size: 1.1rem;
}

/* Navegació */
nav {
  background: #1565c0;
  display: flex;
  justify-content: center;
  padding: 0.5rem;
}
nav a {
  color: #fff;
  margin: 0 1rem;
  text-decoration: none;
  font-weight: 700;
}
nav a:hover {
  text-decoration: underline;
}

/* Seccions i contingut */
main {
  padding: 2rem;
  max-width: 1000px;
  margin: auto;
  background: #fff;
}
section {
  margin-bottom: 2rem;
}

/* Peu de pàgina */
footer {
  background: #0d47a1;
  color: #fff;
  text-align: center;
  padding: 1rem;
}
footer a {
  color: #fff;
  text-decoration: underline;
}

/* Selector d’idioma */
.lang-switch {
  text-align: right;
  padding: .5rem 2rem 0 2rem;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-left: .5rem;
  padding: .35rem .75rem;
  border-radius: 8px;
  background: #1565c0;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s ease;
}
.lang-btn:hover {
  background: #0d47a1;
}
.lang-btn.active {
  background: #0d47a1;
}
.flag-icon {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 1px rgba(0,0,0,.4);
}

/* Estils del formulari de contacte */
.formulari-contacte {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
  margin: auto;
}
.formulari-contacte label {
  font-weight: bold;
}
.formulari-contacte input,
.formulari-contacte textarea {
  padding: .6rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  width: 100%;
}
.formulari-contacte button {
  border: 0;
  border-radius: 8px;
  padding: .75rem;
  background: #1565c0;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.formulari-contacte button:hover {
  background: #0d47a1;
}

/* Missatges del formulari */
.error-box, .success-box {
  max-width: 600px;
  margin: 1rem auto;
  padding: 1rem;
  border-radius: 8px;
}
.error-box {
  background: #ffebee;
  border: 1px solid #c62828;
  color: #c62828;
}
.success-box {
  background: #e8f5e9;
  border: 1px solid #2e7d32;
  color: #2e7d32;
}

/* Notícies */
.noticia-flex {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.noticia-text {
  flex: 2;
}
.noticia-img {
  flex: 1;
}
.noticia-img img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.15);
}

/* Banner de cookies */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #f4f4f4;
  color: #333;
  border-top: 1px solid #e0e0e0;
}
.cookie-inner {
  max-width: 1000px;
  margin: auto;
  padding: .9rem 1rem;
  display: flex;
  gap: .8rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.cookie-text {
  flex: 1 1 520px;
  font-size: .95rem;
  line-height: 1.4;
}
.cookie-actions {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.cookie-btn {
  border: 0;
  border-radius: 8px;
  padding: .5rem .9rem;
  background: #1565c0;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
.cookie-btn:hover {
  background: #0d47a1;
}
.cookie-link {
  color: #1565c0;
  text-decoration: underline;
  font-weight: 600;
}
.cookie-link:hover {
  text-decoration: none;
}
/* Punt vermell per a noves notícies */
.dot {
  height: 10px;
  width: 10px;
  background-color: red;
  border-radius: 50%;
  display: none;
  animation: blink 1s infinite;
  vertical-align: middle;
  margin-left: 5px;
}
@keyframes blink {
  50% { opacity: 0; }
}



/* Responsive */
@media (max-width: 768px) {
  .header-flex {
    flex-direction: column;
    align-items: flex-start;
  }
  nav {
    flex-direction: column;
    align-items: center;
  }
  nav a {
    margin: .4rem 0;
  }
  main {
    padding: 1rem;
  }
  .lang-switch {
    text-align: center;
    padding: .5rem;
  }
  .cookie-inner {
    padding: 1rem;
  }
  .noticia-flex {
    flex-direction: column;
  }
}

/* Botons generals corporatius */
.btn {
  border: 0;
  border-radius: 8px;
  padding: .75rem 1.5rem;
  background: #1565c0;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition: background .2s ease;
}

.btn:hover {
  background: #0d47a1;
}

.btn-blau {
  background: #1565c0;
}

.btn-blau:hover {
  background: #0d47a1;
}
