/**
 * RollUp.pt – Legal Protection Modal Stylesheet
 * Scoped BEM CSS with isolated namespace, high z-index (99999),
 * smooth fade-in/scale animation, touch-friendly close button, and scrollable body.
 */

/* ==========================================================================
   1. ROOT MODAL OVERLAY & ANIMATION
   ========================================================================== */

.rollup-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  margin: 0;
}

/* Open State */
.rollup-modal.rollup-modal--open,
.rollup-modal[aria-hidden="false"] {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   2. BACKDROP OVERLAY
   ========================================================================== */

.rollup-modal__backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: pointer;
  z-index: 1;
}

/* ==========================================================================
   3. DIALOG CONTAINER & SCALING ANIMATION
   ========================================================================== */

.rollup-modal__dialog {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  color: #1e293b;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  box-sizing: border-box;
  outline: none;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}

.rollup-modal.rollup-modal--open .rollup-modal__dialog,
.rollup-modal[aria-hidden="false"] .rollup-modal__dialog {
  transform: scale(1) translateY(0);
}

/* ==========================================================================
   4. MODAL HEADER & TITLE
   ========================================================================== */

.rollup-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e2e8f0;
  background-color: #f8fafc;
  gap: 16px;
  box-sizing: border-box;
}

.rollup-modal__header-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rollup-modal__badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2563eb;
  background-color: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.4;
}

.rollup-modal__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Touch-friendly Close Button */
.rollup-modal__close {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #64748b;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin: -6px -8px 0 0;
  transition: background-color 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

.rollup-modal__close:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.rollup-modal__close:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ==========================================================================
   5. MODAL BODY (SCROLLABLE CONTENT)
   ========================================================================== */

.rollup-modal__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 22px 24px;
  -webkit-overflow-scrolling: touch;
  font-size: 14px;
  line-height: 1.6;
  color: #334155;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.rollup-modal__body::-webkit-scrollbar {
  width: 6px;
}

.rollup-modal__body::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.rollup-modal__body::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 3px;
}

.rollup-modal__body::-webkit-scrollbar-thumb:hover {
  background-color: #94a3b8;
}

.rollup-modal__sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rollup-modal__section {
  margin: 0;
}

.rollup-modal__section-title {
  font-size: 14.5px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
  line-height: 1.4;
}

.rollup-modal__section p {
  margin: 0 0 10px;
  color: #475569;
}

.rollup-modal__section p:last-child {
  margin-bottom: 0;
}

.rollup-modal__section ul {
  margin: 0 0 10px;
  padding-left: 20px;
  list-style-type: disc;
}

.rollup-modal__section li {
  margin-bottom: 6px;
  color: #475569;
}

.rollup-modal__section li:last-child {
  margin-bottom: 0;
}

/* ==========================================================================
   6. MODAL FOOTER & ACTION BUTTONS
   ========================================================================== */

.rollup-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  background-color: #f8fafc;
  gap: 12px;
  box-sizing: border-box;
}

.rollup-modal__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  min-height: 40px;
  text-decoration: none;
  font-family: inherit;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  box-sizing: border-box;
}

.rollup-modal__btn--primary {
  background-color: #2563eb;
  color: #ffffff;
}

.rollup-modal__btn--primary:hover {
  background-color: #1d4ed8;
}

.rollup-modal__btn--primary:active {
  transform: translateY(1px);
}

.rollup-modal__btn--primary:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* ==========================================================================
   7. BODY SCROLL LOCKING
   ========================================================================== */

body.rollup-modal-open {
  overflow: hidden !important;
  touch-action: none;
}

/* ==========================================================================
   8. RESPONSIVE MOBILE BEHAVIOR
   ========================================================================== */

@media (max-width: 640px) {
  .rollup-modal {
    padding: 12px;
  }

  .rollup-modal__dialog {
    max-height: 90vh;
    border-radius: 10px;
  }

  .rollup-modal__header {
    padding: 16px 18px 12px;
  }

  .rollup-modal__title {
    font-size: 16px;
  }

  .rollup-modal__body {
    padding: 16px 18px;
    font-size: 13.5px;
  }

  .rollup-modal__footer {
    padding: 12px 18px;
  }

  .rollup-modal__btn {
    width: 100%;
  }
}
