/* Emailed-code sign-in page: the footer and every screen-size adjustment (big monitors, short laptops,
   phones). */

/* ---------- footer ---------- */

.card-foot {
  padding: 0.9rem 2rem 1.05rem;
  border-top: 1px solid var(--line);
  background: #f8fafc;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.55;
  color: #56657b;
}

.card-foot p {
  margin: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 30rem) {
  .stage {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .brand {
    padding: 1.5rem 1.25rem 0;
  }

  .brand img {
    width: 12rem;
  }

  .panels {
    padding: 0.4rem 1.25rem 1.25rem;
  }

  .card-foot {
    padding: 0.8rem 1.25rem 0.95rem;
  }

  .title {
    font-size: 1.375rem;
  }

  .digit {
    font-size: 1.5rem;
  }
}

@media (max-height: 45rem) and (min-width: 30rem) {
  .brand {
    padding-top: 1.25rem;
  }

  .brand img {
    width: 12rem;
  }

  .title {
    margin-top: 0.8rem;
  }

  .panels {
    padding-bottom: 1.1rem;
  }

  .field {
    margin-top: 0.7rem;
  }

  .ring {
    width: 4.75rem;
    height: 4.75rem;
    margin-top: 0.5rem;
  }

  .otp {
    margin-top: 0.75rem;
  }

  .card-foot {
    padding-top: 0.7rem;
    padding-bottom: 0.8rem;
  }
}

/* Short screens (small laptops, zoomed windows, phones held sideways): a tighter card that fits without scrolling. */
@media (max-height: 44.5rem) {
  .stage {
    padding-top: max(0.75rem, env(safe-area-inset-top));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .brand {
    padding-top: 1rem;
  }

  .brand img {
    width: 9.5rem;
  }

  .title {
    margin-top: 0.6rem;
    font-size: 1.35rem;
  }

  .lede {
    margin-top: 0.3rem;
    font-size: 0.875rem;
    line-height: 1.4;
  }

  #code-lede {
    min-height: 2.6rem;
  }

  .field {
    margin-top: 0.5rem;
  }

  .lede + .field {
    margin-top: 0.7rem;
  }

  .field label {
    margin-bottom: 0.25rem;
  }

  .field input {
    height: 2.75rem;
  }

  .field-msg {
    min-height: 1rem;
    margin-top: 0.15rem;
  }

  .btn-primary {
    height: 2.75rem;
  }

  .help {
    margin-top: 0.6rem;
  }

  .panels {
    padding-bottom: 1rem;
  }

  .card-foot {
    display: none;
  }

  .ring {
    width: 4rem;
    height: 4rem;
    margin-top: 0.5rem;
  }

  .ring-time {
    font-size: 1.15rem;
  }

  .otp {
    margin-top: 0.6rem;
  }

  .status {
    min-height: 2.1rem;
    margin-top: 0.5rem;
  }

  .code-actions .btn-primary {
    margin-top: 0.5rem;
  }

  #code-form {
    --sink: 26px;
  }
}

/* Phones: the logo already names IMTMA and BIEC, so the footer goes, and the card sits low so the photo shows above it. */
@media (max-width: 30rem) {
  .card-foot {
    display: none;
  }
}

@media (max-width: 30rem) and (orientation: portrait) {
  .stage {
    place-items: end center;
    padding-top: max(1rem, env(safe-area-inset-top));
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  /* A tall, narrow screen would show only a thin slice of the picture, so the photo is shown whole across the top instead
     and melts into the soft blurred copy behind the card. */
  .backdrop-photo {
    inset: 0 0 auto 0;
    width: 100%;
    height: 40vh;
    object-position: 50% 66%;
    -webkit-mask-image: linear-gradient(#000 84%, transparent);
    mask-image: linear-gradient(#000 84%, transparent);
  }
}

/* The small "where the code went" pills (WhatsApp / email), a little tighter on phones so both still share one row. */
@media (max-width: 30rem) {
  .lede-dest {
    gap: 0.25rem 0.3rem;
    margin-top: 0.4rem;
  }

  .dest {
    gap: 0.3rem;
    padding: 0.18rem 0.55rem 0.18rem 0.4rem;
    font-size: 0.78rem;
  }
}
