.modal {
  display: none;
  position: fixed;
  z-index: 1050;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.65);
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  padding: 1rem;
}

.modal-content * {
  position: relative;
  z-index: 1;
}

.modal.show {
  display: flex;
}

body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  overflow: auto;
  display: none;
  z-index: 9999;
}

.modal-content {
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content {
  position: relative;
  backdrop-filter: blur(8px);
  background: rgba(20, 20, 20, 0.85);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 600px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 30px rgba(0,0,0,0.8), inset 0 0 10px rgba(255,255,255,0.05);
  color: #f2f2f2;
  animation: fadeInModal 0.4s ease;
  overflow: hidden;
}

.modal-content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
              url('/images/inspektion-small.webp') center/cover no-repeat;
  z-index: 0;
  opacity: 0.35;
  filter: grayscale(20%) blur(1px);
  pointer-events: none;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.modal-content p,
.modal-content li {
  line-height: 1.5;
}

.modal-header,
.modal-body,
.modal-footer {
  position: relative;
  z-index: 1;
}

.modal-header h2 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  color: #fff;
  text-shadow: 1px 1px 6px rgba(0,0,0,0.6);
}

.modal-body h4 {
  font-size: 1.4rem;
  margin: 1rem 0 0.5rem;
  font-weight: 700;
  color: #ffc107;
}

.modal-body p,
.modal-body span,
.modal-body li {
  font-size: 1rem;
  line-height: 1.6;
  color: #f2f2f2;
}
.close-custom {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  background: rgba(255, 255, 255, 0.05); /* subtil bakgrund */
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  padding: 0.6rem;
  cursor: pointer;
  z-index: 999;
  transition: all 0.2s ease;
  backdrop-filter: blur(3px);
}

.close-custom:hover {
  background: rgba(255, 76, 76, 0.2);
  transform: scale(1.1);
  border-color: #ff4c4c;
}

.sequence {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  color: #ccc;
  text-shadow: 0 0 3px rgba(255,255,255,0.15);
  white-space: nowrap; /* ✅ Förhindrar radbrytning */
  display: block;
  text-align: center;
  margin-bottom: 1rem;
  margin-top: 1rem;
}

.modal-content .step-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f2f2f2;
  margin: 1rem 0 0.75rem;
  text-align: left;
  padding-left: 0.25rem;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

/* --- Mobilförbättringar --- */

@media (max-width: 576px) {
  .sequence {
    font-size: 0.65rem !important;
  }

  .adv-modal {
    font-size: 0.95rem !important;
    font-weight: 500; 
  }

  .positions {
    font-size: 1.1rem !important;
  }

  .privacy-note {
    font-size: 0.85rem;
    padding: 0.4rem 0.5rem;
    margin-top: 1.5rem; /* Mer spacing på små skärmar */
  }

  .form-progress {
    flex-wrap: nowrap;
    justify-content: center;
    margin-bottom: 0.5rem;
  }

  .form-progress .circle {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    line-height: 32px;
  }
}

@media (max-width: 768px) {
  .modal-content {
    padding: 1.25rem 1rem;
    font-size: 1.3rem;
    max-width: 92vw;
  }

  .modal-content h1,
  .modal-content h2 {
    font-size: 1.3rem;
    text-align: center;
    line-height: 1.3;
  }

  .modal-content h4,
  .modal-body h4 {
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 1rem;
  }

  .modal-content p,
  .modal-content li {
    font-size: 1.2rem;
    line-height: 1.3;
  }

  .btn-yellow {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0.5rem auto;
    font-size: 1.1rem;
    padding: 1rem;
    text-align: center;
    border-radius: 12px;
  }

  .form-progress {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem auto 0;
  }

  .form-progress .circle {
    height: 34px;
    width: 34px;
    font-size: 1rem;
    line-height: 34px;
  }

  .privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.95rem;
    padding: 0.6rem 0.8rem;
    text-align: center;
    gap: 0.3rem;
  }

  .shield-icon {
    font-size: 1.2rem;
    margin-right: 0.4rem;
  }

  .modal-content {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-dialog {
    margin: 1rem;
  }
}

