/* ============================================================
   Mobile responsive overrides for the E-Visa site
   Breakpoints: 1024px (tablet) / 768px (mobile) / 480px (small)
   ============================================================ */

/* Remove the original site's desktop-only 980px minimum width */
html,
body {
  min-width: 0 !important;
}

@media (max-width: 1024px) {
  .container {
    padding: 0 20px;
  }
  .vizard ul li {
    padding: 0 30px 0 18px;
  }
  .mfa-info .mfa-info__inner {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .cf-wrapper {
    padding-bottom: 40px;
  }

  /* ---------- header ---------- */
  /* overflow:hidden gives .header a BFC so the floated logo/headertext
     cannot escape it; otherwise, at <=768px they overflow below the header
     and md-content (a BFC box) shrink-wraps to the float-free space,
     collapsing to ~114px on a 390px phone. */
  .header {
    height: auto;
    padding: 10px 0;
    overflow: hidden;
  }
  .header .logo,
  .headertext {
    height: 60px;
    margin-left: 10px;
  }
  .header .logo {
    width: 64px;
  }
  .header .headertext {
    background-size: auto 100%;
    padding-left: 12px;
  }
  .header .evisatext {
    font-size: 2rem;
  }
  .header .evisaarmtext {
    font-size: 1.7rem;
  }

  /* ---------- general ---------- */
  .container {
    padding: 0 12px;
  }
  form,
  fieldset {
    min-width: 0;
    width: 100%;
  }
  fieldset {
    padding: 0;
    border: 0;
  }
  .message {
    padding: 12px 14px 12px 40px;
    font-size: 1.3rem;
  }
  h1 {
    font-size: 2.4rem;
  }

  /* ---------- wizard steps (horizontal scroll) ---------- */
  .vizard {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .vizard ul {
    width: max-content;
    min-width: 100%;
    display: block;
    white-space: nowrap;
  }
  .vizard ul li {
    display: inline-block;
    float: none;
    padding: 0 30px 0 18px;
    line-height: 42px;
    font-size: 1.2rem;
  }
  .vizard ul li a {
    white-space: nowrap;
  }

  /* ---------- fixed-width wrappers ---------- */
  .page-eligibility {
    width: 100%;
  }
  .purp-data-cont {
    width: 100%;
    padding: 0 12px;
    box-sizing: border-box;
    margin: 20px auto 30px;
  }
  .terms-checkbox {
    width: 100%;
  }
  .photovalidation-examples {
    width: 100%;
  }
  .photoexample {
    width: 45%;
    margin: 0 2% 15px 0;
  }

  /* ---------- forms: one column ---------- */
  .elementitem {
    width: 100%;
    float: none;
    margin: 14px 0 12px;
  }
  .elementitem:nth-of-type(2n) {
    padding: 0;
  }
  .radiobuttons-h {
    padding: 0 !important;
  }
  .blockhelps {
    float: none;
    width: 100%;
    margin: 0 0 20px;
  }
  .halfblock {
    width: 100%;
    float: none;
  }
  .attachments .halfblock:nth-of-type(1) {
    padding: 0;
    border-right: none;
  }
  .attachments .halfblock:nth-of-type(2) {
    padding: 0;
  }
  .attachedfiles .formitem {
    margin: 0;
  }
  .attachedfiles .float-l:nth-of-type(1) {
    width: 100px;
    height: 133px;
    margin: 0 10px 10px 0;
  }

  /* ---------- data confirmation ---------- */
  .width50 {
    width: 100% !important;
    min-height: 0;
    float: none;
  }
  .checkinfoblock.width50:nth-of-type(1),
  .checkinfoblock.width50:nth-of-type(2) {
    padding: 0;
  }
  .mi-item {
    width: 100%;
  }

  /* ---------- landing page ---------- */
  .gerb {
    width: 110px;
    height: 110px;
    margin: 25px auto;
    background-size: contain;
  }
  .welcometext {
    margin: 0 0 25px;
  }
  .evisatext {
    font-size: 2.6rem;
  }
  .evisaarmtext {
    font-size: 2rem;
  }
  .center {
    font-size: 1.4rem;
    line-height: 1.7;
  }

  /* ---------- buttons: full width, stacked ---------- */
  .button {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    margin: 8px 0;
    padding: 0 12px;
    font-size: 1.5rem;
    white-space: normal;
  }
  .navigation {
    margin: 20px 0;
  }

  /* ---------- check status result ---------- */
  .visastatus,
  .checkvisastatus {
    font-size: 2rem;
    padding: 0 10px;
  }

  /* ---------- misc fixed-width bits ---------- */
  .emailconfirm {
    padding: 110px 0 0;
    background-size: 90px auto;
  }
  .eligibility-result {
    padding: 110px 0 0;
    background-size: 90px auto;
  }
  .recaptcha img {
    max-width: 100%;
    height: auto;
  }
  .md-datepicker-input {
    min-width: 0;
    width: 100%;
  }
  .md-select-menu-container {
    max-width: calc(100vw - 16px);
  }
  .md-datepicker-calendar-pane {
    max-width: 100vw;
  }
  .doc-photo {
    float: none;
    margin: 0 0 10px;
  }

  /* ---------- footer ---------- */
  .mfa-info {
    position: static;
    padding: 20px 12px;
  }
  .mfa-info .mfa-info__inner {
    width: 100%;
  }
  .mfa-info .mfa-info__inner > div {
    display: block;
    width: 100%;
    margin: 0 0 12px;
  }
  .fa-footer-address {
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .header .headertext {
    margin-left: 8px;
  }
  .header .evisatext {
    font-size: 1.7rem;
  }
  .header .evisaarmtext {
    font-size: 1.5rem;
  }
  .photoexample {
    width: 100%;
    margin: 0 0 15px;
  }
  .photovalidation-examples .photoexample:nth-of-type(3n) {
    margin: 0 0 15px;
  }
  .vizard ul li {
    padding: 0 22px 0 14px;
  }
  .mi-item .value {
    font-size: 1.3rem;
    word-break: break-word;
  }
}
