/* ============================================================
   MemberPress "unauthorized" screen — Lighthouse styling
   Pairs with: memberpress/shared/unauthorized_message.php
   (markup rendered by lh_access_card() in inc/lh-access-gate.php)

   LAYOUT (Ben, 2026-08-17): split panel copied from login.k12.com —
   the form in a fixed-width left panel, a big photo filling the rest.
   One rounded container, not a 100vw hack, so it stays inside the
   content area and can never cause horizontal scroll. On phones the
   photo hides and the panel stands alone. Inside the protected Avada
   off-canvas (the second render of this view) the photo also hides —
   a split screen makes no sense in a slide-out drawer.

   WHY custom CSS rather than Avada elements: this markup is rendered
   by MemberPress into the_content, so there is no Fusion element to
   style it with. Colours are Avada global vars only — no hard-coded
   hexes. The ONLY thing meant to be hand-edited is the placeholder
   photo just below.
   ============================================================ */

.lh-unauth {
    /* PLACEHOLDER photo — Ben: swap this one URL to change the image. */
    --lh-unauth-photo: url(/wp-content/uploads/2026/06/iStock-1393146294.webp);

    display: flex;
    align-items: stretch;
    min-height: min(760px, 82vh);
    margin: 24px auto 56px;
    max-width: var(--site_width, 1230px);
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--awb-color3);
    box-shadow: 0 18px 50px -22px hsla(var(--awb-custom_color_1-h), var(--awb-custom_color_1-s), var(--awb-custom_color_1-l), 0.35);
    background: var(--awb-color1);
}

/* ---------------- left: the form panel ---------------- */

.lh-unauth__card {
    flex: 0 0 clamp(360px, 38%, 500px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    background: var(--awb-color1);
    padding: 48px clamp(28px, 4vw, 56px);
}

/* the padlock-in-a-dashed-ring mark, reusing the hero art language */
.lh-unauth__mark {
    color: var(--awb-color5);
    width: 56px;
    margin: 0 0 18px;
}

.lh-unauth__mark svg {
    display: block;
    width: 100%;
    height: auto;
}

/* No margin/padding added to the heading itself — spacing comes from the elements around it. */
.lh-unauth__title {
    color: var(--awb-custom_color_1);
}

.lh-unauth__body {
    color: var(--awb-custom_color_12);
    max-width: 42ch;
    margin: 12px 0 0;
}

.lh-unauth__excerpt {
    margin-top: 18px;
    text-align: left;
    color: var(--awb-custom_color_12);
}

/* a deliberately customised per-rule message, when one exists */
.lh-unauth__note {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 10px;
    background: hsla(var(--awb-color5-h), var(--awb-color5-s), var(--awb-color5-l), 0.14);
    color: var(--awb-custom_color_1);
    text-align: left;
}

.lh-unauth__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.lh-unauth__btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    color: var(--awb-custom_color_1);
    background: var(--awb-color2);
    transition: background 0.2s ease, color 0.2s ease;
}

.lh-unauth__btn:hover,
.lh-unauth__btn:focus {
    background: var(--awb-color3);
    color: var(--awb-custom_color_1);
}

.lh-unauth__btn--primary {
    background: var(--awb-custom_color_1);
    color: var(--awb-color1);
}

.lh-unauth__btn--primary:hover,
.lh-unauth__btn--primary:focus {
    background: var(--awb-color5);
    color: var(--awb-custom_color_1);
}

.lh-unauth__btn:focus-visible {
    outline: 3px solid var(--awb-color4);
    outline-offset: 2px;
}

.lh-unauth__help {
    margin: 26px 0 0;
    color: var(--awb-custom_color_12);
}

.lh-unauth__help a {
    color: var(--awb-custom_color_1);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lh-unauth__help a:hover,
.lh-unauth__help a:focus {
    color: var(--awb-color5);
}

/* Password-reset screen: same panel, different photo (Ben 2026-08-17).
   PLACEHOLDER — swap this one URL. */
.lh-unauth--reset {
    --lh-unauth-photo: url(/wp-content/uploads/2026/06/iStock-1477580860.jpg);
}

/* The reset form has no border above it — there is nothing before it to divide from. */
.lh-unauth--reset .lh-unauth__login {
    margin-top: 20px;
    padding-top: 0;
    border-top: 0;
}

/* The /login/ page uses the same panel as the gated screen, so it inherits the
   default --lh-unauth-photo. Declared explicitly so the photo is obvious to
   change per-screen. PLACEHOLDER — swap the URL. */
.lh-unauth--login {
    --lh-unauth-photo: url(/wp-content/uploads/2026/06/iStock-1393146294.webp);
}

/* Ben 2026-08-17: no page-title bar on the auth screens — the panel carries its
   own heading, and a "Login" title bar above a "Login" panel just repeats.
   Page 9 is BOTH /login/ and /login/?action=forgot_password (same post, the
   action is a query param), so one id covers both. */
.page-id-9 section.fusion-page-title-bar.fusion-tb-page-title-bar {
    display: none;
}

/* ---------------- right: the photo ---------------- */

.lh-unauth__photo {
    flex: 1 1 auto;
    min-height: 320px;
    background-image: var(--lh-unauth-photo);
    background-size: cover;
    background-position: center;
}

/* ---------------- the login form ---------------- */

.lh-unauth__login {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--awb-color3);
    text-align: left;
}

/* MemberPress's own login form — its markup, brought in line with the brand.
   Classes taken from the rendered output, not guessed: .mp-form-row / .mp-form-label /
   input#wp-submit.button-primary / .mepr-login-actions */
.lh-unauth__login .mp-form-row {
    margin-bottom: 16px;
}

.lh-unauth__login .mp-form-label label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    color: var(--awb-custom_color_1);
}

.lh-unauth__login input[type="text"],
.lh-unauth__login input[type="password"] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--awb-color3);
    border-radius: 10px;
    background: var(--awb-color1);
    color: var(--awb-custom_color_1);
}

.lh-unauth__login input[type="text"]:focus,
.lh-unauth__login input[type="password"]:focus {
    outline: none;
    border-color: var(--awb-color5);
    box-shadow: 0 0 0 3px hsla(var(--awb-color5-h), var(--awb-color5-s), var(--awb-color5-l), 0.28);
}

/* MemberPress's show/hide-password control. Note the class is on BOTH the wrapper div and the
   button, so these are tag-qualified. Without this the button drops below the field as a grey
   block, because the full-width input above pushes it onto its own line. */
div.mp-hide-pw {
    position: relative;
}

.lh-unauth__login div.mp-hide-pw input[type="password"],
.lh-unauth__login div.mp-hide-pw input[type="text"] {
    padding-right: 46px;
}

.lh-unauth__login button.mp-hide-pw {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--awb-custom_color_12);
    cursor: pointer;
    line-height: 1;
}

.lh-unauth__login button.mp-hide-pw:hover,
.lh-unauth__login button.mp-hide-pw:focus {
    background: transparent;
    color: var(--awb-custom_color_1);
}

.lh-unauth__login input#wp-submit {
    display: inline-block;
    width: 100%;
    padding: 12px 24px;
    border: 0;
    border-radius: 999px;
    background: var(--awb-custom_color_1);
    color: var(--awb-color1);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.lh-unauth__login input#wp-submit:hover,
.lh-unauth__login input#wp-submit:focus {
    background: var(--awb-color5);
    color: var(--awb-custom_color_1);
}

.lh-unauth__login .mepr-login-actions a {
    color: var(--awb-custom_color_12);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lh-unauth__login .mepr-login-actions a:hover,
.lh-unauth__login .mepr-login-actions a:focus {
    color: var(--awb-custom_color_1);
}

/* ---------------- contexts where the split makes no sense ---------------- */

/* This same view renders a second time inside a protected Avada off-canvas
   drawer; a split screen in a slide-out panel would just squash. */
.awb-off-canvas .lh-unauth {
    min-height: 0;
    border: 0;
    box-shadow: none;
}

.awb-off-canvas .lh-unauth__photo {
    display: none;
}

.awb-off-canvas .lh-unauth__card {
    flex: 1 1 auto;
}

@media (max-width: 900px) {
    .lh-unauth {
        min-height: 0;
        margin: 16px auto 40px;
    }

    /* phone = the K12 mobile treatment: just the form, no photo */
    .lh-unauth__photo {
        display: none;
    }

    .lh-unauth__card {
        flex: 1 1 auto;
        padding: 36px 22px 32px;
    }

    .lh-unauth__actions {
        flex-direction: column;
    }

    .lh-unauth__btn {
        width: 100%;
        text-align: center;
    }
}
