/* =========================================================
   EVAL MODAL
   Desktop dialog + mobile full-height bottom sheet
========================================================= */

/* =========================================================
   HOTFIX INTERACTIONS
   La modale fermée ne doit jamais bloquer la page
========================================================= */
#roEvalModal{
  pointer-events: none;
}

#roEvalModal[aria-hidden="true"]{
  display: none !important;
  pointer-events: none !important;
}

#roEvalModal[aria-hidden="false"]{
  display: block !important;
  pointer-events: auto !important;
}

#roEvalModal .ro-modal__backdrop,
#roEvalModal .ro-modal__dialog{
  pointer-events: auto;
}

/* =========================
   VISIBILITÉ / GARDE-FOUS
========================= */
#roEvalModal[aria-hidden="true"]{
  display: none;
}

#roEvalModal[aria-hidden="false"]{
  display: block;
}

#roEvalModal [hidden]{
  display: none !important;
}

/* =========================
   SHELL
========================= */
#roEvalModal{
  position: fixed;
  inset: 0;
  z-index: 9997;
}

#roEvalModal .ro-modal__backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  z-index: 9998;
}

#roEvalModal .ro-modal__dialog{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100vw - 64px));
  max-height: min(82vh, 720px);

  display: flex;
  flex-direction: column;
  overflow: hidden;

  background: var(--ro-bg-0);
  border: 1px solid var(--ro-dolphing-300);
  border-radius: var(--ro-radius-24);

  z-index: 9999;
}

/* tablette + sidebar */
@media (min-width: 681px) and (max-width: 1100px){
  #roEvalModal .ro-modal__dialog{
    left: calc(50% + (var(--ro-sidebar-current-w) / 2));
    width: min(640px, calc(100vw - var(--ro-sidebar-current-w) - 48px));
    max-height: 80vh;
    padding: var(--ro-space-12);
  }
}

/* =========================
   HEADER
========================= */
#roEvalModal .ro-eval-modal__header{
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--ro-space-10);
  padding: var(--ro-space-14) var(--ro-space-18) var(--ro-space-10);
  background: var(--ro-bg-0);
}

#roEvalModal .ro-eval-modal__handle{
  display: none;
  width: var(--ro-size-56);
  height: var(--ro-size-6);
  border-radius: 999px;
  background: var(--ro-neutral-200);
  margin: 0 auto;
}

#roEvalModal .ro-eval-modal__topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ro-space-12);
}

#roEvalModal .ro-eval-modal__heading{
  margin: 0;
  padding: 0;
  font-family: var(--ro-font-body);
  font-size: var(--ro-size-24);
  font-weight: var(--ro-font-weight-Xbold);
  line-height: var(--ro-line-height-sm);
  color: var(--ro-neutral-900);
}

#roEvalModal .ro-eval-modal__close,
#roEvalModal .ro-iconbtn{
  flex: 0 0 auto;
  width: var(--ro-size-36);
  height: var(--ro-size-36);
  border-radius: var(--ro-radius-8);
  background: transparent;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ro-dolphing-800);
}

#roEvalModal .ro-eval-modal__close i{
  font-size: var(--ro-size-24);
  line-height: 1;
}

/* =========================
   STEPPER
========================= */
#roEvalModal .ro-eval-steps{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ro-space-8);
}

#roEvalModal .ro-eval-step{
  flex: 1 1 0;
  min-width: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ro-space-6);

  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ro-dolphing-800);
  cursor: default;
}

#roEvalModal .ro-eval-step__bullet{
  width: var(--ro-size-32);
  height: var(--ro-size-32);
  border-radius: 999px;
  background: var(--ro-dolphing-100);

  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: var(--ro-dolphing-700);
  font-size: var(--ro-font-size-s);
  font-weight: var(--ro-font-weight-bold);
  line-height: 1;
}

#roEvalModal .ro-eval-step__index{
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#roEvalModal .ro-eval-step__done{
  display: none;
  align-items: center;
  justify-content: center;
  font-size: var(--ro-size-18);
  line-height: 1;
}

#roEvalModal .ro-eval-step__done--success{
  color: var(--ro-succ-700);
}

#roEvalModal .ro-eval-step__done--warning{
  color: var(--ro-papaw-700);
}

#roEvalModal .ro-eval-step__done--danger{
  color: var(--ro-err-700);
}

#roEvalModal .ro-eval-step__label{
  font-size: var(--ro-font-size-xs);
  font-weight: var(--ro-font-weight-bold);
  line-height: var(--ro-line-height-sm);
  color: var(--ro-neutral-800);
  text-align: center;
  white-space: nowrap;
}

/* états */
#roEvalModal .ro-eval-step.is-future .ro-eval-step__bullet{
  background: var(--ro-neutral-50);
  color: var(--ro-dolphing-300);
}

#roEvalModal .ro-eval-step.is-future .ro-eval-step__label{
  color: var(--ro-neutral-700);
}

#roEvalModal .ro-eval-step.is-active .ro-eval-step__bullet{
  background: var(--ro-dolphing-200);
  color: var(--ro-dolphing-900);
}

#roEvalModal .ro-eval-step.is-active .ro-eval-step__label{
  color: var(--ro-neutral-900);
}

#roEvalModal .ro-eval-step.is-done .ro-eval-step__bullet{
  background: var(--ro-dolphing-100);
  color: var(--ro-dolphing-800);
}

#roEvalModal .ro-eval-step.is-done .ro-eval-step__index{
  display: none;
}

#roEvalModal .ro-eval-step.is-done.is-tone-success .ro-eval-step__done--success{
  display: inline-flex;
}

#roEvalModal .ro-eval-step.is-done.is-tone-warning .ro-eval-step__done--warning{
  display: inline-flex;
}

#roEvalModal .ro-eval-step.is-done.is-tone-danger .ro-eval-step__done--danger{
  display: inline-flex;
}

/* étape 6 confirmée = check neutre */
#roEvalModal .ro-eval-step.is-done:not(.is-tone-success):not(.is-tone-warning):not(.is-tone-danger) .ro-eval-step__done--success{
  display: inline-flex;
  color: var(--ro-dolphing-800);
}

#roEvalModal .ro-eval-step.is-active .ro-eval-step__done{
  display: none;
}

#roEvalModal .ro-eval-step.is-active .ro-eval-step__index{
  display: inline-flex;
}

/* couleurs sémantiques */
#roEvalModal .ro-eval-step.is-done.is-tone-success .ro-eval-step__bullet{
  background: var(--ro-succ-100);
  color: var(--ro-succ-700);
}

#roEvalModal .ro-eval-step.is-done.is-tone-warning .ro-eval-step__bullet{
  background: var(--ro-papaw-100);
  color: var(--ro-papaw-700);
}

#roEvalModal .ro-eval-step.is-done.is-tone-danger .ro-eval-step__bullet{
  background: var(--ro-err-100);
  color: var(--ro-err-700);
}

#roEvalModal .ro-eval-progress{
  position: relative;
  height: 6px;
  background: var(--ro-dolphing-100);
  border-radius: 999px;
  overflow: hidden;
}

#roEvalModal .ro-eval-progress__bar{
  display: block;
  height: 100%;
  width: 0;
  background: var(--ro-dolphing-200);
  transition: width .2s ease;
}

/* =========================
   BODY
========================= */
#roEvalModal .ro-eval-modal__body{
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--ro-space-12) var(--ro-space-18) var(--ro-space-10);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

#roEvalModal .ro-step-eval{
  display: none;
}

#roEvalModal .ro-step-eval.is-active{
  display: block;
  padding: 0 var(--ro-space-6);
}

#roEvalModal .ro-step__title{
  margin: 0 0 var(--ro-space-4);
  padding: 0;
  font-size: var(--ro-size-20);
  font-weight: var(--ro-font-weight-bold);
  line-height: var(--ro-line-height-sm);
  color: var(--ro-neutral-900);
}

#roEvalModal .ro-step__desc{
  margin: 0 0 var(--ro-space-12);
  font-size: var(--ro-font-size-m);
  line-height: var(--ro-line-height-base);
  color: var(--ro-neutral-800);
}

#roEvalModal .ro-step__desc--improve{
  font-size: var(--ro-font-size-m);
  margin-bottom: var(--ro-space-12);
  max-width: 48ch;
}

/* =========================
   OPTIONS
========================= */
#roEvalModal .ro-eval-options{
  display: flex;
  flex-direction: column;
  gap: var(--ro-space-10);
}

#roEvalModal .ro-eval-option{
  width: 100%;
  min-height: var(--ro-size-44);
  padding: var(--ro-space-10) var(--ro-space-12);
  border: 1px solid var(--ro-neutral-300);
  border-radius: var(--ro-radius-12);
  background: var(--ro-bg-0);

  display: flex;
  align-items: center;
  gap: var(--ro-space-10);

  text-align: left;
  color: var(--ro-neutral-900);

  transition:
    border-color .18s ease,
    background-color .18s ease,
    box-shadow .18s ease;
}

#roEvalModal .ro-eval-option:hover{
  border-color: var(--ro-dolphing-400);
  background: var(--ro-dolphing-50);
}

#roEvalModal .ro-eval-option.is-selected{
  border-color: var(--ro-dolphing-500);
  background: var(--ro-dolphing-50);
  box-shadow: 0 0 0 1px var(--ro-dolphing-200);
}

#roEvalModal .ro-eval-option__radio{
  width: var(--ro-size-16);
  height: var(--ro-size-16);
  border-radius: 999px;
  border: 2px solid var(--ro-neutral-600);
  flex: 0 0 auto;
}

#roEvalModal .ro-eval-option.is-selected .ro-eval-option__radio{
  border-color: var(--ro-dolphing-700);
}

#roEvalModal .ro-eval-option__icon{
  flex: 0 0 auto;
  font-size: var(--ro-size-20);
  line-height: 1;
}

#roEvalModal .ro-eval-option__icon--success{
  color: var(--ro-succ-600);
}

#roEvalModal .ro-eval-option__icon--warning{
  color: var(--ro-papaw-600);
}

#roEvalModal .ro-eval-option__icon--danger{
  color: var(--ro-err-500);
}

#roEvalModal .ro-eval-option__label{
  font-size: var(--ro-font-size-s);
  font-weight: var(--ro-font-weight-medium);
  line-height: var(--ro-line-height-base);
  color: var(--ro-neutral-900);
}

#roEvalModal .ro-eval-option--simple .ro-eval-option__label{
  font-weight: var(--ro-font-weight-regular);
}

/* =========================
   IMPROVE FIELD
========================= */
#roEvalModal .ro-eval__improve{
  margin-top: var(--ro-space-12);
}

#roEvalModal .ro-field__input{
  width: 100%;
  min-height: var(--ro-size-44);
  padding: 0 var(--ro-space-14);
  border: 1px solid var(--ro-dolphing-300);
  border-radius: var(--ro-radius-8);
  background: var(--ro-bg-0);
  color: var(--ro-neutral-900);
}

#roEvalModal .ro-field__textarea{
  min-height: var(--ro-size-72);
  max-height: 22vh;
  padding-top: var(--ro-space-10);
  padding-bottom: var(--ro-space-10);
  resize: vertical;
  line-height: var(--ro-line-height-base);
  white-space: pre-wrap;
}

#roEvalModal .ro-field__input::placeholder{
  color: var(--ro-dolphing-400);
  opacity: 1;
}

#roEvalModal .ro-field__input:hover:not(:focus){
  border-color: var(--ro-dolphing-500);
  background: var(--ro-dolphing-50);
}

#roEvalModal .ro-field__input:focus{
  border-color: var(--ro-dolphing-600);
  box-shadow: var(--ro-focus-ring);
  outline: none;
}

#roEvalModal .ro-eval__msg{
  margin-top: var(--ro-space-10);
  font-size: var(--ro-font-size-xs);
  line-height: var(--ro-line-height-base);
  color: var(--ro-neutral-700);
}

/* =========================
   FOOTER
========================= */
#roEvalModal .ro-eval-modal__footer{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ro-space-10);
  padding: var(--ro-space-10) var(--ro-space-18) var(--ro-space-12);
  border-top: 1px solid var(--ro-neutral-150);
  background: var(--ro-bg-0);
}

#roEvalModal .ro-eval-modal__footer-left,
#roEvalModal .ro-eval-modal__footer-right{
  display: flex;
  align-items: center;
  gap: var(--ro-space-8);
}

#roEvalModal .ro-eval-modal__footer-right{
  margin-left: auto;
}

/* =========================
   MOBILE = TRUE FULL-HEIGHT SHEET
========================= */
@media (max-width: 680px){
  #roEvalModal .ro-modal__dialog{
    left: 0;
    right: 0;
    top: var(--ro-topbar-h);
    bottom: 0;
    transform: none;
    width: 100vw;
    max-width: 100vw;
    height: auto;
    max-height: none;

    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;

    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    border-radius: var(--ro-radius-24) var(--ro-radius-24) 0 0;
  }

  #roEvalModal .ro-eval-modal__header{
    padding: var(--ro-space-12) var(--ro-space-16) var(--ro-space-10);
    gap: var(--ro-space-12);
  }

  #roEvalModal .ro-eval-modal__handle{
    display: block;
  }

  #roEvalModal .ro-eval-modal__topbar{
    align-items: center;
  }

  #roEvalModal .ro-eval-modal__heading{
    font-size: var(--ro-size-24);
  }

  #roEvalModal .ro-eval-steps{
    gap: var(--ro-space-6);
  }

  #roEvalModal .ro-eval-step{
    gap: var(--ro-space-6);
  }

  #roEvalModal .ro-eval-step__bullet{
    width: var(--ro-size-32);
    height: var(--ro-size-32);
    font-size: var(--ro-font-size-s);
  }

  #roEvalModal .ro-eval-step__done{
    font-size: var(--ro-size-18);
  }

  #roEvalModal .ro-eval-step__label{
    font-size: var(--ro-font-size-xs);
    white-space: normal;
  }

  #roEvalModal .ro-eval-modal__body{
    flex: 0 0 auto;
    min-height: auto;
    padding: 0;
    overflow: visible;
  }

  #roEvalModal .ro-step-eval.is-active{
    padding: 0 var(--ro-space-16);
  }

  #roEvalModal .ro-step__title{
    font-size: var(--ro-size-20);
  }

  #roEvalModal .ro-step__desc{
    font-size: var(--ro-font-size-m);
    margin-bottom: var(--ro-space-16);
  }

  #roEvalModal .ro-step__desc--improve{
    font-size: var(--ro-font-size-s);
  }

  #roEvalModal .ro-eval-option{
    min-height: var(--ro-size-44);
    padding: var(--ro-space-10) var(--ro-space-12);
    border-radius: var(--ro-radius-12);
    gap: var(--ro-space-10);
  }

  #roEvalModal .ro-eval-option__radio{
    width: var(--ro-size-16);
    height: var(--ro-size-16);
  }

  #roEvalModal .ro-eval-option__icon{
    font-size: var(--ro-size-20);
  }

  #roEvalModal .ro-eval-option__label{
    font-size: var(--ro-font-size-m);
  }

  #roEvalModal .ro-field__textarea{
    min-height: var(--ro-size-100);
    max-height: none;
  }

  #roEvalModal .ro-eval-modal__footer{
    flex-direction: row;
    align-items: center;
    gap: var(--ro-space-10);
    margin-top: auto;
    padding: var(--ro-space-12) var(--ro-space-16) calc(var(--ro-space-12) + env(safe-area-inset-bottom));
  }

  #roEvalModal .ro-eval-modal__footer-left,
  #roEvalModal .ro-eval-modal__footer-right{
    gap: var(--ro-space-8);
    flex-wrap: wrap;
  }

  #roEvalModal .ro-eval-modal__footer-left{
    margin-right: auto;
  }

  #roEvalModal .ro-eval-modal__footer-right{
    justify-content: flex-end;
  }
}