/* =========================================================
   FULL D’ESTILS — DOSSIERS GUIA FPE / PIF

   1) Layout general i hero
   2) Targetes de cas i accions
   3) Flux de passos i navegació
   4) Modals (pop-ups i multi-pas)
   5) Índex lateral específic
   6) Taules i scroll
   7) Supòsits, errors i layout d’errors
   8) Glossari i checklist
   9) Botons dossiers
   ========================================================= */


/* ========== 1) Layout general i hero ========== */

.dossier-hero {
  background-image: url("../assets/images/Imatge bloc 8.jpg");
  background-size: cover;
  background-position: center;
}


.dossier-content {
  max-width: 1000px;
  margin: 0 auto;
}


.cases-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}


body.only-one-dossier .content .sect {
  display: none;
}
body.only-one-dossier .content .sect.is-current {
  display: block;
}


/* ========== 2) Targetes de cas i accions ========== */


.case-card {
  border: 1px solid #dce3ea;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  max-width: 100%;
  margin: 0 auto 2.5rem;
}


.case-title {
  background: #004987;
  color: white;
  padding: .75rem 1rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 1rem;
}


.case-card h2 {
  margin-top: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--brand);
}
.case-card p {
  margin: 0.5rem 0 0.75rem;
}
.case-card ul {
  margin: 0 0 0.75rem 1.1rem;
}


.case-card .btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
}


.case-actions {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.0rem;
  flex-wrap: wrap;   
}


.step-banner {
  background: #004987;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  padding: 0.4rem 0.75rem;
  margin: 0 0 0.75rem;
  border-radius: 3px;
}


#ex1 h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #004987;
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
}


/* ========== 3) Flux de passos i navegació ========== */


.step-flow {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}


.step-flow .step-screen {
  display: none;
}


.step-flow .step-screen.is-active {
  display: block;
}


.case-card .case-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  background: #e6f2fb;   
  color: #004987;        
  text-decoration: none;
  cursor: pointer;
}


.case-card .case-actions .btn-primary,
.case-card .case-actions .btn-outline {
  background: #e6f2fb;
  border: none;
  color: #004987;
}

.case-card .case-actions .btn:hover {
  background: #d3e7fa;
}


.step-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
}

.step-nav .btn {
  width: 150px;
  height: 35px;
  font-size: .9rem;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 40px;
}


.step-nav .btn-outline {
  border: 2px solid #004987;
  color: #004987;
  background: #ffffff;
}


.step-nav .btn-primary {
  background: #004987;
  color: white;
  border: none;
}


.case-modal .step-nav .step-prev[disabled] {
  display: none;
}


/* ========== 4) Modals (pop-ups i multi-pas) ========== */


.modal,
.case-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;            
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 99999;
}


.modal.show,
.case-modal.show {
  display: flex;
}


.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}


.modal__panel {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  max-width: 800px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}


.modal-close,
.modal__close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  border: none;
  background: none;
  font-size: 1.3rem;
  cursor: pointer;
}


.case-modal .modal__close {
  background: #004987;
  color: #ffffff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  transition: background .2s ease;
  border: none;
}
.case-modal .modal__close:hover {
  background: #00345f;
}


.modal .modal-close {
  background: #004987;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  transition: background .2s;
}
.modal .modal-close:hover {
  background: #00345f;
}


.modal.show[hidden],
.case-modal.show[hidden] {
  display: flex !important;
}


.modal__close {
  background-color: transparent !important;
  color: #004987 !important;
  font-size: 28px;
  font-weight: bold;
  border: none;
  top: 20px;
  right: 20px;
}
.modal__close:hover {
  color: #002d5c !important;
}


.modal-title {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #004987;
}


.btn-modal {
  border: 1px solid #004987;
  background: #fff;
  color: #004987;
  padding: .55rem 1rem;
  border-radius: 8px;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: .45rem;
  font-size: .95rem;
  font-weight: 500;

  width: 100%;
  max-width: 240px;
}
.btn-modal:hover {
  background: #e6f1f7;
}


.btn-icon {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  flex-shrink: 0;
}


/* ========== 5) Índex lateral específic (TOC dossiers) ========== */

.sidenav-list {
  padding: 1rem 1rem 1.25rem;
}

.sidenav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: 1rem;
}

.sidenav-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}


.sidenav-close {
  border: none;
  background: #004987;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}


/* ========== 6) Taules i scroll ========== */


.dossier-content table,
.case-modal .modal__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.95rem;
}


.dossier-content th,
.case-modal .modal__body th {
  background-color: #004987;
  color: #ffffff;
  font-weight: 700;
  text-align: left;
  padding: 0.6rem 0.8rem;
}


.dossier-content td,
.case-modal .modal__body td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #dbe5f0;
  vertical-align: top;
}


.dossier-content tbody tr:nth-child(even),
.case-modal .modal__body tbody tr:nth-child(even) {
  background-color: #f4f8fc;
}


@media (hover: hover) {
  .dossier-content tbody tr:hover,
  .case-modal .modal__body tbody tr:hover {
    background-color: #e6f2fb;
  }
}


.table-scroll {
  width: 100%;
  overflow-x: auto;
}
.table-scroll table {
  min-width: 600px;
}


/* ========== 7) Supòsits, errors i layout d’errors ========== */


.suposits-row .sup-btn {
  display: inline-block;
  padding: .65rem 1.5rem;
  border-radius: 40px;
  border: 2px solid var(--brand);
  background: #e8f3ff;
  color: var(--brand);
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
  margin: 0 .5rem;
  text-align: center;
}


.suposits-row .sup-btn.is-active {
  background: var(--brand);
  color: white;
}


.case-card button,
.case-card .btn,
.suposits-row .sup-btn {
  color: #004987 !important;
}


.case-card button.is-active,
.case-card .btn.is-active,
.suposits-row .sup-btn.is-active {
  color: #004987 !important;
}


.error-banner{
  background:#00508E;
  padding:0.9rem 1.25rem;
  border-radius:0.75rem 0.75rem 0 0;
  color:#fff;
}

.error-title{
  margin:0;
  font-size:1rem;
  font-weight:700;
}


.error-actions{
  margin-top:1.5rem;
  display:flex;
  gap:1rem;
  flex-wrap:wrap;
}

.error-actions .error-btn{
  flex:1 1 0;
}


.error-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:0.4rem;
  padding:0.75rem 1rem;
  border-radius:999px;
  border:2px solid #00508E;
  background:#fff;
  color:#00508E;
  font-weight:600;
  cursor:pointer;
}

.error-btn-icon{
  font-size:1.1rem;
  line-height:1;
}


.errors-layout__inner {
  max-width: 1200px;
  padding-inline: 2.5rem;
}


.error-card {
  padding: 2.5rem 3rem;
}


/* ========== 8) Glossari i checklist ========== */


.alphabet-nav {
  margin: 2rem 0 2.5rem;
  text-align: center;
}

.alphabet-container {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
}

.alphabet-container button {
  padding: .4rem .7rem;
  border-radius: 999px;
  border: 1px solid #004987;
  background: #e6f2fb;
  color: #004987;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: background .2s, color .2s, transform .1s;
}
.alphabet-container button:hover {
  background: #004987;
  color: #fff;
  transform: translateY(-1px);
}


.glossary-section {
  margin-bottom: 3rem;
}
.glossary-section h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #004987;
  margin-bottom: 1rem;
}

.glossary-term {
  background: #fff;
  border: 1px solid #dce3ea;
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  margin-bottom: .9rem;
  box-shadow: 0 3px 10px rgba(0,0,0,.04);
}
.glossary-term h3 {
  margin: 0 0 .4rem;
  font-weight: 700;
  color: #004987;
}
.glossary-term p {
  margin: 0;
}


.checklist-card {
  margin-top: 1.75rem;
}

.checklist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.checklist-table thead th {
  background-color: #005a98;
  color: #fff;
  font-weight: 700;
  padding: 0.4rem 0.6rem;
  border: 1px solid #333;
}

.checklist-table td {
  border: 1px solid #333;
  padding: 0.35rem 0.6rem;
  vertical-align: top;
}

.checklist-table .check-col {
  width: 2.5rem;
  text-align: center;
}

.checklist-table input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
}


.dossier-checklist .page {
  padding-bottom: 6rem;
}
.dossier-checklist .checklist-table {
  margin-bottom: 4rem;
}

/* ========== 9) Botons dossiers ========== */
.site-footer {
  background: #004987;
  color: #fff;
  margin-top: 2rem;

 
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
}

.site-footer__inner {
  max-width: 1200px;      
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  text-align: center;
  font-size: .9rem;
}


.sidenav-list a.is-active {
  font-weight: 700;
  color: #004987;
}


.section-nav {
  margin-top: 2.5rem;
  margin-bottom: 0;
  padding-bottom: 2rem;

  /* >>> Afegit per separar i alinear botons <<< */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30rem;      /* ← separació entre els dos botons */
  flex-wrap: wrap;
}

.section-nav a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #aedfe6;
  color: #002d5c;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.section-nav a:hover {
  background: #003766;
  color: #d3e7fa;
}

.section-btn,
.section-btn-prev {
  display: inline-block;
  margin: 0;
}

