body {
  margin: 0;
  background: #808080;
  font-family: Arial, sans-serif;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  min-height: 100vh;
  min-width: 100vw;
  overflow: auto; /* allow overlay to scroll if content is too tall */
}
.close-icon-border {
  margin-bottom: 2rem;
}
.modal-content {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px #0003;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  max-width: 640px;
  width: 92vw;
  min-width: 240px;
  /* --- new additions for better scaling/scrolling --- */
  max-height: 90vh; /* never exceeds 90% of viewport height */
  overflow-y: auto; /* enables vertical scroll if content overflows */
  padding: 0 0 1.5rem 0;
  box-sizing: border-box;
}

/* Put the close button on top of scrolling content */
.close-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.close-icon svg {
  display: block;
  width: 28px;
  height: 28px;
  stroke: #b0b0b0;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.close-icon:focus {
  outline: 2px solid #b0b0b0;
}
.modal-message {
  color: #0b2445;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  text-align: center;
  margin-bottom: 2rem;
  margin-top: 3rem;
  word-break: break-word;
  padding: 0 3rem;
  max-width: 560px;
}
.modal-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  margin-bottom: 1.2rem;
}
.agree-btn {
  background: #0b2445;
  color: #fff;
  border: none;
  border-radius: 2em;
  padding: 0.55em 2em;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  box-shadow: 0 2px 8px #0001;
}
.agree-btn:active,
.agree-btn:focus {
  background: #163d70;
}
.decline-btn {
  background: #fff;
  color: #0b2445;
  border: 2px solid #0b2445;
  border-radius: 2em;
  padding: 0.55em 2em;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.decline-btn:active,
.decline-btn:focus {
  background: #eee;
  color: #163d70;
}
.lang-switch {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  background: #fff;
  font-size: 1.12rem;
  font-family: Arial, sans-serif;
  padding-bottom: 1.5rem;
  margin-top: 0;
  padding: 0 2rem;
  max-width: 560px;
}
.lang-switch a {
  text-decoration: none;
  color: #0055a6;
  font-weight: 400;
  margin: 0 0.7em;
  transition: color 0.2s;
  cursor: pointer;
}
.lang-switch .active {
  font-weight: 700;
  color: #0055a6;
  border-bottom: 2px solid #0055a6;
  text-decoration: none;
  padding-bottom: 2px;
}
.lang-switch .lang-divider {
  color: #b7b7b7;
  font-size: 1em;
  font-weight: normal;
  margin: 0 0.1em;
}
@media (max-width: 650px) {
  .modal-content {
    max-width: 98vw;
    min-width: 0;
    /* Responsive max-height on small screens */
    max-height: 98vh;
  }
  .close-icon {
    top: 1rem;
    right: 1rem;
    width: 28px;
    height: 28px;
  }
  .close-icon svg {
    width: 22px;
    height: 22px;
  }
  .modal-message {
    font-size: 1rem;
    padding: 0 0.7rem;
    max-width: 97vw;
    margin-top: 2.5rem;
  }
  .agree-btn, .decline-btn {
    font-size: 1rem;
    padding: 0.55em 1.4em;
  }
  .lang-switch {
    font-size: 0.97rem;
    padding-bottom: 1rem;
  }
}