/* --------- POPUP WINDOW FOCUS --------- */

body.modal-open {
  overflow: hidden;
  pointer-events: none;
}

body.modal-open #popup {
  pointer-events: auto;
}

/* --------- POPUP --------- */

.popup {
    display: none; 
    position: fixed; 
    top: 50%;
    left: 50%; 
    transform:translate(-50%, -50%);
    background:white; 
    padding:20px; 
    padding-bottom: 40px;
    border:1px solid #ccc; 
    border-radius: 5px;
    box-shadow:0 0 10px rgba(0,0,0,0.2);
    width: 300px;
    font-family: "Noto Sans",sans-serif;
    font-size: 1em;
    font-weight: normal;
    z-index: 50;
}

.popupTitle {
    font-weight: bold;
    margin-bottom: 8px;
    margin-top: 20px;
}

.popupTextarea {
    width: 95%;
    max-width: 95%;
    min-height: 100px;
    max-height: 500px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: "Noto Sans",sans-serif;
    font-size: 1em;
    font-weight: normal;
    padding: 5px;
}

form#theForm2 input.popupText {
    width: 95%;
}

/* --------- TEXT --------- */

.popupText {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: "Noto Sans",sans-serif;
    font-size: 1em;
    font-weight: normal;
    width: 95%;
    max-width: 95%;
}

.gdprText {
    text-decoration: underline;
}

.gdprText:hover {
    background-color: #EBEEEF;
}

.gdprContent {
    margin-top: 20px;
}

/* --------- BUTTONS --------- */

.popupButton {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #3FD695;
  color: white;
  text-align: center;
  font-size: 22px;
  line-height: 60px;
  z-index: 2000;
  cursor: pointer;
  border: none;
  outline: none;
  display: inline-flex;
  align-items: center;   /* vertical center */
  justify-content: center;
  z-index: 1;            /* move element behind settings/query elements */
}

/* accessibility */
.popupButton:focus-visible {
  outline: auto;
  outline-offset: 3px;
}

.popupButton .popupIcon * {
  stroke-width: 1.5;
}

/* remove button when help view shown */
body.help-open .popupButton {
    display: none;
}

.popupButtons {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;  
}

.sendButton,
.closeButton {
    color: black;
    font: inherit;
    padding: 0.1em .5em 0.2em 0.5em;
    margin: 0.2em .8em 0.1em 1em;
    border: none;
    border-radius: 0.3em;
    cursor: pointer;
}

.sendButton { 
    background-color: #D7E9EC;
}


.closeButton {
    background-color: lightgray;
}

/* --------- HP --------- */

.phoneNumber {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --------- PHONE --------- */

@media screen and (max-width: 375px) {
    .popup {
        width: 70%;
    }
}

@media screen and (max-width: 620px) {
    
}

/* landscape orientation */
@media (max-height: 476px) {
  .popup {
    top: 16px;
    transform: translateX(-50%);
    max-height: calc(100vh - 92px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: min(300px, calc(100vw - 32px));
  }
}

/* --------- NO HOVER BUTTON COLOR ON PHONE (ELSE BUGGY) --------- */

@media (hover: hover) and (pointer: fine) {
    .sendButton:hover {
        background-color: #3FD695;
    }

    .closeButton:hover {
        background-color: gray;
    }
}

/* --------- HIGH CONTRAST MODE --------- */

@media (prefers-contrast: more) {
    .popupButton {
        background: ButtonFace;       /* system color */
        border: 2px solid ButtonText; /* visible outline */
        forced-color-adjust: none;    /* keep our choices */
    }
}

/* switch feedback icon colors to dynamic */
@media (forced-colors: active) {
    .popupButton .popupIcon {
        content: url("../svg/feedback-icon-high-contrast.svg");
    }
}

/* --------- DARK MODE --------- */

@media (prefers-color-scheme: dark) { 
    .popup {
        border: 2px solid #52666b;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    }

    /* background + text */
    .popup,
    .popupTextarea,
    .popupText {
        background-color: #111b20;
        color: white;
    }

    /* links */
    .gdprText {
        color: #3FD695 !important;
    }
    .gdprText {
        text-decoration-color: #3FD695 !important;
    }
    .gdprText:hover {
        background-color: #324b5a;
    }
}