/* ===============================================
   MODAL ENCAPSULADO
=============================================== */

.modal-scope {
  --light: hsl(0, 0%, 100%);
  --background: linear-gradient(
    to right bottom,
    hsl(236, 50%, 50%),
    hsl(195, 50%, 50%)
  );
}

/* container */
.modal-scope .modal-container {
  position: fixed;
  inset: 0;
  z-index: 99999;

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

  background: rgba(0, 0, 0, 0.6);

  /* estado fechado */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.3s ease;
}

.modal-scope .modal-container.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* modal box */
.modal-scope .modal {
  display: flex;               /* flex para organizar colunas */
  flex-direction: column;      /* header + conteúdo + footer */
  width: 50rem;
  max-width: 90%;
  height: 80vh;                /* altura do modal */
  padding: 2rem;
  border-radius: 0.8rem;
  color: var(--light);
  background: var(--background);
  box-shadow: 0.4rem 0.4rem 2.4rem 0.2rem rgba(0,0,0,.3);
  position: relative;
  overflow: hidden;            /* esconder excesso fora do modal */

  /* 🔥 Começa fora da tela */
  opacity: 0;
  transform: translateY(500px); 

  /* Transição suave */
  transition: transform 1.5s cubic-bezier(0.23, 1, 0.32, 1), 
              opacity 0.5s ease;
  will-change: transform, opacity;
}

/* Quando abrir */
.modal-scope .modal-container.is-visible .modal {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s; 
}

/* ===============================================
   HEADER
=============================================== */

.modal-scope .modal__details {
  text-align: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.modal-scope .modal__title {
  font-size: 3.2rem;
}

.modal-scope .modal__description {
  font-size: 1.6rem;
  font-style: italic;
}

/* ===============================================
   CONTENT (rolagem vertical se necessário)
=============================================== */

.modal-scope .modal__text {
  flex: 1 1 auto;           /* ocupa todo espaço disponível */
  overflow-y: auto;          /* rolagem vertical apenas se necessário */
  overflow-x: hidden;        /* sem rolagem horizontal */
  line-height: 2;
}

/* círculos decorativos opcionais */
.modal-scope .modal__text::before {
  content: '';
  position: absolute;
  top: -6rem;
  right: -6rem;
  width: 18rem;
  height: 18rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100rem;
}

/* ===============================================
   FOOTER (fixo acima do botão)
=============================================== */
.modal-scope .modal__footer {
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-top: 1px solid rgba(255,255,255,0.2);
}

/* ===============================================
   BOTÃO (fixo na parte inferior)
=============================================== */
/* BOTÃO FECHAR FIXO - Desktop */
.modal-scope .modal__btn {
  display: block;
  padding: 1rem 1.6rem;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 100rem;
  background: transparent;
  color: inherit;
  letter-spacing: 0.2rem;
  cursor: pointer;
  transition: 0.2s;
}

.modal-scope .modal__btn:hover {
  transform: translateY(-0.2rem);
  border-color: rgba(255, 255, 255, 0.6);
}

/* BOTÃO X - Mobile */
.modal-scope .modal__close {
  display: none; /* padrão não aparece */
}


@media (max-width: 768px) {
  /* mostra o X e esconde o botão inferior */
  .modal-scope .modal__close {
    display: block;
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--light);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    text-align: center;
    line-height: 2.3rem;
    z-index: 10;
    transition: background 0.2s;
  }

  .modal-scope .modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  /* esconde botão inferior */
  .modal-scope .modal__btn {
    display: none;
  }
}

.body-no-scroll {
  overflow: hidden;
  height: 100%;
}