/* ===== PAGINA DOCUMENTI ===== */

.mp-documents-page{
  min-height: calc(100vh - 56px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.mp-documents-shell{
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.mp-documents-card{
  background: transparent;
  border-radius: 0;
  overflow: visible;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

.mp-documents-header{
  background: linear-gradient(180deg, #0c778b 0%, #16bfd8 100%);
  color: #fff;
  padding: 18px 20px 62px;
}

.mp-documents-header-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mp-documents-user{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mp-documents-avatar{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  flex: 0 0 42px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, #f3d3b0 0 32%, transparent 33%),
    radial-gradient(circle at 50% 78%, #d9e2ec 0 38%, transparent 39%),
    #b7c5d3;
  border: 2px solid rgba(255,255,255,.72);
}

.mp-documents-avatar img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mp-documents-hello{
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

.mp-documents-logout{
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
}

.mp-documents-logout:hover{
  background: rgba(255,255,255,.10);
}

.mp-documents-body{
  background: #f8f8f8;
  padding: 14px 18px 26px;
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  margin-top: -36px;
  min-height: calc(100vh - 170px);
}

.mp-documents-titlebar{
  position: relative;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.mp-documents-back,
.mp-document-modal-back,
.mp-document-viewer-back{
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #3a4a5c;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.mp-documents-back{
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.mp-documents-back:hover,
.mp-document-modal-back:hover{
  color: #3a4a5c;
  background: rgba(0,0,0,.04);
  text-decoration: none;
}

.mp-documents-title{
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  color: #3a4a5c;
}

.mp-documents-title .mp-highlight-soft{
  font-weight: 800;
}

.mp-documents-info{
  min-height: 88px;
  border-radius: 8px;
  background: #e8f7fa;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px 10px 4px;
  margin-bottom: 24px;
  overflow: hidden;
}

.mp-documents-info p{
  margin: 0;
  color: #263646;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.02;
}

.mp-documents-info strong{
  color: #0ea2bb;
  font-weight: 800;
}

.mp-documents-helper{
  position: relative;
  width: 82px;
  height: 72px;
}

.mp-documents-helper img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mp-documents-list{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mp-document-item{
  min-height: 66px;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  padding: 11px 10px;
}

.mp-document-state-initial{
  background: #1a7fa8;
  color: #fff;
}

.mp-document-state-certified,
.mp-document-state-valid{
  background: #e8f7f2;
  color: #11806e;
}

.mp-document-state-rejected{
  background: #fdf0e6;
  border: 1px solid #ff9b58;
  color: #ff8d43;
}

.mp-document-view,
.mp-document-action{
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  cursor: pointer;
}

.mp-document-view{
  width: 18px;
  height: 18px;
  padding: 0;
  color: currentColor;
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.mp-document-action{
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: currentColor;
  background: rgba(255,255,255,.46);
  font-size: 20px;
}

.mp-document-action:disabled{
  opacity: .42;
  color: rgba(255,255,255,.82);
  cursor: default;
}

.mp-document-state-certified .mp-document-action,
.mp-document-state-valid .mp-document-action{
  background: #cceee8;
  color: #11806e;
}

.mp-document-state-rejected .mp-document-action{
  background: #ffe3c9;
  color: #ff8d43;
}

.mp-document-main{
  min-width: 0;
}

.mp-document-upload{
  margin: 0 0 1px;
  font-size: 9px;
  font-style: italic;
  line-height: 1;
}

.mp-document-upload strong{
  font-style: normal;
  font-weight: 800;
}

.mp-document-name{
  margin: 0;
  color: currentColor;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
}

.mp-document-file{
  margin: 1px 0 0;
  color: #263646;
  font-size: 11px;
  line-height: 1.05;
}

.mp-document-state-initial .mp-document-file{
  color: rgba(255,255,255,.92);
}

.mp-document-state-certified .mp-document-file,
.mp-document-state-valid .mp-document-file{
  color: #11806e;
  font-style: italic;
}

.mp-document-state-rejected .mp-document-file{
  color: #ff8d43;
  font-style: italic;
}

.mp-document-check{
  margin: 2px 0 0;
  color: currentColor;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  line-height: 1;
}

.mp-document-check input,
.mp-document-declaration-check input{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mp-document-check span,
.mp-document-declaration-check span{
  width: 11px;
  height: 11px;
  border-radius: 2px;
  border: 2px solid #11b3cf;
  background: #fff;
  flex: 0 0 auto;
}

.mp-document-state-certified .mp-document-check span,
.mp-document-state-valid .mp-document-check span{
  border-color: #11806e;
}

.mp-document-check input:checked + span,
.mp-document-declaration-check input:checked + span{
  background: #11b3cf;
  box-shadow: inset 0 0 0 2px #fff;
}

.mp-document-state-certified .mp-document-check input:checked + span,
.mp-document-state-valid .mp-document-check input:checked + span{
  background: #11806e;
}

.mp-document-state-rejected .mp-document-check span{
  border-color: #ff8d43;
  border-radius: 999px;
}

.mp-document-state-rejected .mp-document-check input:checked + span{
  background: #ff8d43;
}

/* ===== MODALE DICHIARAZIONE ===== */

.mp-document-declaration-dialog{
  max-width: 430px;
}

.mp-document-declaration-content{
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
}

.mp-document-declaration-body{
  background: #fff;
  padding: 24px 18px 20px;
}

.mp-document-modal-titlebar{
  position: relative;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.mp-document-modal-back{
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.mp-document-modal-title{
  margin: 0;
  color: #3a4a5c;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.mp-document-declaration-text{
  margin: 0 4px 22px;
  color: #3a4a5c;
  font-size: 12px;
  line-height: 1.2;
}

.mp-document-declaration-check{
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0 4px 30px;
  color: #3a4a5c;
  font-size: 11px;
  line-height: 1.1;
}

.mp-document-declaration-check b{
  font-weight: 500;
}

.mp-document-declaration-check span{
  margin-top: 1px;
}

.mp-document-complete{
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: #5bc5d3;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.mp-document-complete:disabled{
  background: #b9b9b9;
}

/* ===== AVVISI ===== */

.mp-document-notice-dialog{
  max-width: 390px;
}

.mp-document-notice-content{
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
}

.mp-document-notice-body{
  background: #fff;
  padding: 24px 20px 18px;
  text-align: center;
}

.mp-document-notice-title{
  margin: 0 0 12px;
  color: #0ea2bb;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.mp-document-notice-text{
  margin: 0 0 20px;
  color: #3a4a5c;
  font-size: 13px;
  line-height: 1.25;
}

.mp-document-notice-btn{
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #5bc5d3;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.mp-document-warning-icon{
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: #fff3e9;
  color: #ff8d43;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* ===== MODALE UPLOAD ===== */

.mp-document-upload-modal{
  border: 0;
  border-radius: 28px;
  overflow: hidden;
}

.mp-document-upload-chooser{
  max-width: 460px;
  margin: 0 auto;
  padding: 28px 18px 10px;
}

.mp-document-camera-step{
  max-width: 460px;
  margin: 0 auto;
  padding: 18px;
}

.mp-document-camera-wrap{
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}

.mp-document-camera-wrap video{
  display: block;
  width: 100%;
  max-height: 60vh;
  object-fit: cover;
}

.mp-document-upload-choice,
.mp-document-upload-cancel{
  width: 100%;
  min-height: 50px;
  border-radius: 18px;
  font-size: 1.15rem;
  font-weight: 300;
  margin-bottom: 14px;
}

.mp-document-upload-choice{
  background: #16b3cd;
  color: #fff;
  border: 2px solid #16b3cd;
}

.mp-document-upload-choice:hover{
  background: #11a7c0;
  color: #fff;
}

.mp-document-upload-choice-outline{
  background: #fff;
  color: #16b3cd;
  border: 2px solid #16b3cd;
}

.mp-document-upload-choice-outline:hover{
  background: #f4fcfd;
  color: #16b3cd;
}

.mp-document-upload-cancel{
  background: #fff;
  color: #ff8c00;
  border: 2px solid #f1d8c0;
}

/* ===== VISUALIZZAZIONE DOCUMENTO ===== */

.mp-document-viewer-content{
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, #0c778b 0%, #16bfd8 100%);
}

.mp-document-viewer-toolbar{
  min-height: 70px;
  background: #fff;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
}

.mp-document-viewer-back{
  color: #11b3cf;
}

.mp-document-viewer-back:hover{
  color: #0ea2bb;
  background: rgba(17,179,207,.08);
}

.mp-document-viewer-date{
  text-align: center;
  color: #11b3cf;
  font-size: 11px;
  font-style: italic;
  line-height: 1.1;
}

.mp-document-viewer-date strong{
  display: block;
  font-style: normal;
  font-weight: 800;
}

.mp-document-viewer-actions{
  display: flex;
  align-items: center;
  gap: 12px;
}

.mp-document-viewer-actions button{
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: #d8f7fb;
  color: #11b3cf;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.mp-document-viewer-stage{
  min-height: calc(100dvh - 70px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 12px;
}

.mp-document-preview{
  width: min(1180px, calc(100vw - 24px));
  height: calc(100dvh - 94px);
  background: #fff;
  border: 4px solid #fff;
  box-shadow: 0 18px 38px rgba(0,0,0,.18);
  position: relative;
  overflow: hidden;
}

.mp-document-preview-frame{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  z-index: 3;
}

.mp-document-preview-image{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  z-index: 3;
}

/* ===== DESKTOP ===== */

@media (min-width: 768px){
  .mp-documents-body{
    padding: 18px 28px 34px;
  }

  .mp-documents-info{
    grid-template-columns: 110px minmax(0, 1fr);
    min-height: 106px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }

  .mp-documents-helper{
    transform: scale(1.18);
    transform-origin: center;
    margin-left: 12px;
  }

  .mp-documents-info p{
    font-size: 15px;
    line-height: 1.08;
  }

  .mp-documents-list{
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
  }

  .mp-document-item{
    min-height: 78px;
    grid-template-columns: 28px minmax(0, 1fr) 44px;
    padding: 13px 16px;
  }

  .mp-document-name{
    font-size: 15px;
  }

  .mp-document-file{
    font-size: 13px;
  }

  .mp-document-upload,
  .mp-document-check{
    font-size: 11px;
  }
}

@media (min-width: 992px){
  .mp-documents-shell{
    max-width: 100%;
  }
}

/* ===== MOBILE ===== */

@media (max-width: 991.98px){
  .mp-user-main{
    padding: 0;
  }

  .mp-documents-page{
    min-height: 100vh;
  }

  .mp-documents-card{
    border-radius: 0;
    box-shadow: none;
  }

  .mp-documents-header{
    padding: 18px 16px 60px;
  }

  .mp-documents-body{
    min-height: calc(100vh - 92px);
    padding: 14px 18px 110px;
  }
}

@media (max-width: 575.98px){
  .mp-document-declaration-dialog{
    max-width: calc(100vw - 28px);
    margin-left: auto;
    margin-right: auto;
  }

  .mp-document-notice-dialog{
    max-width: calc(100vw - 28px);
    margin-left: auto;
    margin-right: auto;
  }

  .mp-document-viewer-toolbar{
    grid-template-columns: 34px minmax(70px, 1fr) auto;
    gap: 8px;
    padding: 8px 12px;
  }

  .mp-document-viewer-actions{
    gap: 8px;
  }

  .mp-document-viewer-actions button{
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  .mp-document-viewer-stage{
    min-height: calc(100dvh - 58px);
    padding: 8px;
  }

  .mp-document-preview{
    width: calc(100vw - 16px);
    height: calc(100dvh - 74px);
    border-width: 0;
  }
}
