/* ==========================================================================
   Auth pages (login / forgot / reset) — responsive layout.

   The Vuexy auth-v2 template is built for a desktop split screen: an
   illustration on the left, the form on the right, and the brand logo
   absolutely positioned over the top-left corner. Below lg the illustration
   is hidden, which leaves the absolute logo floating over the form — so here
   the logo drops back into the flow above the card and the card takes the
   full width.
   ========================================================================== */

/* .auth-inner stays the scroll container — html and body are both height:100%,
   so content overflowing it cannot scroll the page itself. Only the unit
   changes: the template's 100vh is measured against the *collapsed* mobile
   browser chrome, so the bottom of the form ends up under the address bar.
   dvh tracks the visible viewport; the vh line is the fallback. */
.auth-wrapper.auth-v2 {
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-wrapper.auth-v2 .auth-inner {
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-wrapper.auth-v2 .brand-logo img {
    max-width: min(260px, 60vw);
    height: auto;
}

.auth-wrapper.auth-v2 .brand-logo .brand-text {
    font-size: 1.6rem;
    margin: 0;
    color: #7367f0;
}

/* Keep the form readable rather than letting it stretch across a tablet. */
.auth-card-inner {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

/* 16px minimum stops iOS Safari zooming in when a field is focused. */
.auth-login-form .form-control {
    font-size: 1rem;
    min-height: 44px;
}

.auth-login-form .btn-block {
    min-height: 44px;
}

/* The in-card logo that replaces the corner one below lg. */
.auth-mobile-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.auth-mobile-logo img {
    max-width: min(200px, 55vw);
    max-height: 64px;
    width: auto;
    height: auto;
}

@media (max-width: 991.98px) {
    /* The card is the only child left, so stack rather than wrap — a wrapped
       .row would split the leftover height between its lines. */
    .auth-wrapper.auth-v2 .auth-inner {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    /* Top-aligned, not centred. The template centres the card in a full-height
       column, which on a tall phone leaves ~230px of empty white above the
       heading. The markup class align-items-center is !important, hence the
       override here.

       1 0 auto, not 1 1 auto: the column still fills the viewport (so the
       white background reaches the bottom) but is never shrunk below the
       form's own height — that is what lets .auth-inner scroll down to the
       Sign in button instead of clipping it. */
    .auth-wrapper.auth-v2 .auth-login-col {
        flex: 1 0 auto;
        width: 100%;
        max-width: 100%;
        align-items: flex-start !important;
        padding-top: 2rem !important;
        padding-bottom: 1.5rem !important;
    }
}

@media (max-width: 575.98px) {
    .auth-wrapper.auth-v2 .auth-login-col {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }

    .auth-card-inner .card-title {
        font-size: 1.35rem;
    }
}

/* Short viewports (landscape phones, small laptops): centring a form taller
   than the viewport puts its top out of reach. Align to the top, shrink the
   vertical rhythm, and let .auth-inner scroll for whatever is still left. */
@media (max-height: 640px) {
    .auth-wrapper.auth-v2 .auth-login-col {
        align-items: flex-start !important;
        padding-top: 1.25rem !important;
        padding-bottom: 1.5rem !important;
    }

    .auth-mobile-logo {
        margin-bottom: 0.75rem;
    }

    .auth-mobile-logo img {
        max-height: 44px;
    }

    .auth-card-inner .card-title {
        font-size: 1.25rem;
        margin-bottom: 0.25rem !important;
    }

    .auth-card-inner .card-text {
        margin-bottom: 1rem !important;
    }

    .auth-login-form {
        margin-top: 0 !important;
    }

    .auth-login-form .form-group {
        margin-bottom: 0.85rem;
    }
}
