.form div {
    margin: auto;
    padding-top: .5em;
    min-width: 200px;
}

.form .container {
    width: 95%;
}

.form {
    font-family: var(--font-im-fell-double-pica-sc);
}

.form input {
    width: 100%;
    border-radius: var(--br-10);
    background-color: #64B0E2;
    padding: .5em 2em;
    box-sizing: border-box;
    color: #3881A6;
    border: 0;
    outline: 0;
    background-color: var(--color-whitesmoke);
    height: 50px;
}

.hidden {
    display: none !important;
}

.invalidInput {
    border: 2px solid red;
}

div.lightbox{
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10002;
    text-align: center;
    background: #333;
    /*background: rgba(204, 204, 204, 0.5);*/
    background: rgba(169,187,192,0.5);
    cursor: url('/images/closeIcon.png') 24 24, auto;
}

div.lightbox:before{
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
    margin-right: -.25em;
}

div.lightbox-content{
    position: relative;
    border-radius: 15px;
    vertical-align: middle;
    display: inline-block;
    padding: 25px 25px 0;
    border: 25px solid transparent;
    margin-left: 5%;
    margin-right: 5%;
    max-height: 90%;
    max-width: 80%;
    overflow: auto;
    background: #fff;
    cursor: default;
    box-shadow: 0px 0px 40px #637D87;
}

img.lightbox-close {
    top: 0px;
    right: 0px;
    position: absolute;
    width: 20px;
}

.requirementunsatisfied {
    border: 1px solid red !important;
}

table .h2header {
    color: #637D87;
}

@media (max-width: 767.98px) {
    div.lightbox{
      position: fixed;
      inset: 0;                 /* shorthand for top/right/bottom/left:0 */
      z-index: 10002;
      display: flex;            /* NEW: flexbox centering */
      align-items: center;      /* vertical center */
      justify-content: center;  /* horizontal center */

      /* keep your backdrop */
      text-align: center;
      background: rgba(169,187,192,0.5);
      cursor: url('/images/closeIcon.png') 24 24, auto;

      /* mobile-safe height: handles iOS dynamic bars */
      min-height: 100dvh;
      padding: max(16px, env(safe-area-inset-top))
               max(16px, env(safe-area-inset-right))
               max(16px, env(safe-area-inset-bottom))
               max(16px, env(safe-area-inset-left));
      overscroll-behavior: contain;  /* prevent background scroll chaining */
    }

    /* Remove the vertical-align hack */
    div.lightbox:before{
      content: none;
    }
    div.lightbox-content{
      position: relative;
      display: block;       /* ensure it sizes naturally in flex center */
      margin: 0;            /* center controlled by flex container */
      max-width: min(700px, 90vw);
      max-height: min(90dvh, 600px);
      width: 100%;
      overflow: auto;
      -webkit-overflow-scrolling: touch;

      /* keep your existing aesthetics */
      border-radius: 15px;
      padding: 15px 15px 0;
      border: 25px solid transparent;
      background: #fff;
      cursor: default;
      box-shadow: 0 0 40px #637D87;
    }
    body.modal-open { overflow: hidden; touch-action: none; }

    table {
        margin: 0 auto;
    }
}