/* Open-book login. Drop-in replacement: same markup, same class names.
   Uses variables from portal-alt.css. A hard cover swings open on page load. */

.login-split {
    --paper: #fffefb;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 980px;
    margin: 1.2rem auto 0;
    padding: .7rem; /* the hard cover showing around the pages */
    background: linear-gradient(145deg,var(--navy),var(--blue));
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(13,67,72,.28), 0 2px 0 #0a363a;
    perspective: 1800px;
}

/* ---- Pages ---- */
.split-intro, .split-form {
    position: relative;
    background: var(--paper);
    /* faint stacked page edges at the bottom */
    box-shadow: 0 1px 0 #e6e8e4,0 2px 0 #f1f2ee,0 3px 0 #dcdfda;
}

.split-intro {
    padding: 2.4rem 2.2rem 2rem 2.4rem;
    border-radius: 6px 0 0 6px;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background: linear-gradient(to left,rgba(13,67,72,.16),rgba(13,67,72,0) 70px), /* shadow into the spine */
    var(--paper);
}

.split-form {
    padding: 2.4rem 2.4rem 1.8rem 2.2rem;
    border-radius: 0 6px 6px 0;
    background: linear-gradient(to right,rgba(13,67,72,.16),rgba(13,67,72,0) 70px), var(--paper);
}

    /* gold ribbon bookmark on the right page */
    .split-form::before {
        content: "";
        position: absolute;
        top: -6px;
        right: 2rem;
        width: 22px;
        height: 64px;
        background: var(--saffron);
        clip-path: polygon(0 0,100% 0,100% 100%,50% 82%,0 100%);
        filter: drop-shadow(0 2px 2px rgba(0,0,0,.25));
    }

/* ---- Left page ---- */
.intro-mark {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--saffron);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1.1rem;
    background: transparent;
}

.split-intro h2 {
    color: var(--navy);
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: .7rem;
    padding-bottom: .7rem;
    border-bottom: 2px solid var(--saffron);
    display: inline-block;
    align-self: flex-start
}

.intro-lead {
    font-size: .93rem;
    color: var(--muted);
    margin-bottom: 1.4rem
}

.intro-points {
    list-style: none;
    padding: 0;
    margin: 0 0 auto
}

    .intro-points li {
        display: flex;
        gap: .8rem;
        margin-bottom: 1rem;
        font-size: .9rem;
        line-height: 1.5
    }

    .intro-points i {
        color: var(--blue);
        margin-top: .2rem
    }

.intro-help {
    margin: 1.5rem 0 0;
    padding-top: 1rem;
    border-top: 1px dashed var(--line);
    font-size: .82rem;
    color: var(--muted)
}

/* ---- Right page ---- */
.split-form h1 {
    font-size: 1.65rem;
    margin-bottom: .25rem
}

.form-lead {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 1.5rem
}

.field {
    margin-bottom: 1.1rem
}

    .field label {
        display: block;
        font-size: .85rem;
        font-weight: 600;
        margin-bottom: .35rem
    }

.input-wrap {
    position: relative;
    display: flex;
    align-items: center
}

    .input-wrap .leading {
        position: absolute;
        left: .85rem;
        color: var(--blue);
        opacity: .75;
        font-size: .9rem;
        pointer-events: none
    }

.field input[type=email], .field input[type=password], .field input[type=text] {
    width: 100%;
    height: 46px;
    border: 1.5px solid var(--line);
    border-radius: 4px;
    padding: 0 2.6rem;
    font-size: .95rem;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s,box-shadow .15s
}

.field input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(18,107,114,.18)
}

.field input:-webkit-autofill, .field input:-webkit-autofill:hover, .field input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink);
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
    transition: background-color 9999s ease-in-out 0s
}

.password-toggle {
    position: absolute;
    right: .5rem;
    background: none;
    border: 0;
    color: var(--muted);
    padding: .4rem .5rem;
    cursor: pointer
}

    .password-toggle:hover {
        color: var(--blue)
    }

.remember {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    color: var(--muted);
    margin: .2rem 0 1.3rem;
    cursor: pointer
}

    .remember input {
        width: 15px;
        height: 15px;
        accent-color: var(--blue)
    }

.login-submit {
    width: 100%;
    height: 48px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center
}

.secure-note {
    text-align: center;
    margin: 1rem 0 0;
    font-size: .78rem;
    color: var(--muted)
}

.form-foot {
    margin: 1.4rem 0 0;
    padding-top: 1rem;
    border-top: 1px dashed var(--line);
    font-size: .88rem;
    text-align: center
}

.login-error {
    background: #fdecec;
    border: 1px solid #f0b4b4;
    color: #9b1c1c;
    border-radius: 3px;
    padding: .6rem .8rem;
    font-size: .85rem;
    margin-bottom: 1rem
}

    .login-error:empty, .login-error.validation-summary-valid {
        display: none
    }

    .login-error ul {
        margin: 0;
        padding-left: 1.1rem
    }

/* ---- Hard cover: closed book, opens only when clicked ---- */
.book-cover {
    position: absolute;
    inset: 0;
    z-index: 5;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    text-align: center;
    padding: 2rem;
    cursor: pointer;
    border: 0;
    font-family: 'Source Serif 4',Georgia,serif;
    color: #f3d38a;
    background: linear-gradient(145deg,#0a363a,var(--blue));
    border-radius: 10px;
    box-shadow: inset 0 0 0 10px #0a363a, inset 0 0 0 12px var(--saffron), 6px 0 24px rgba(0,0,0,.35);
    transform-origin: left center;
    backface-visibility: hidden;
    transition: transform 1.4s cubic-bezier(.6,.05,.25,1),opacity .5s ease .9s,visibility 0s linear 1.4s;
}

    .book-cover:hover {
        transform: rotateY(-7deg)
    }
    /* a small peek on hover */
    .book-cover:focus-visible {
        outline: 3px solid #fff;
        outline-offset: -20px
    }

.cover-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2
}

.cover-sub {
    font-size: 1rem;
    font-weight: 600;
    color: #e8c777;
    max-width: 26ch
}

.cover-hint {
    margin-top: 1.2rem;
    font: 600 .85rem 'Public Sans',sans-serif;
    color: #fff;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 20px;
    padding: .35rem 1rem;
    animation: hintPulse 2.2s ease-in-out infinite
}

@keyframes hintPulse {
    0%,100% {
        opacity: .65
    }

    50% {
        opacity: 1
    }
}

/* opened */
.login-split.is-open .book-cover {
    transform: rotateY(-172deg);
    opacity: 0;
    visibility: hidden;
    pointer-events: none
}

.login-split.no-anim .book-cover {
    transition: none
}

/* ---- Modes ---- */
body.high-contrast .login-split {
    background: #000;
    border: 2px solid #fff
}

body.high-contrast .split-intro, body.high-contrast .split-form, body.high-contrast .field input {
    background: #000;
    color: #fff;
    border-color: #fff
}

    body.high-contrast .split-intro h2, body.high-contrast .split-form h1 {
        color: #ffd400
    }

body.high-contrast .book-cover {
    display: none
}

@media(prefers-reduced-motion:reduce) {
    .book-cover, .book-cover:hover {
        transition: none
    }

        .book-cover:hover {
            transform: none
        }

    .cover-hint {
        animation: none
    }
}

@media(max-width:767.98px) {
    .login-split {
        grid-template-columns: 1fr;
        padding: .5rem;
        perspective: none
    }

    .book-cover {
        transform: none !important;
        transition: opacity .6s ease,visibility 0s linear .6s
    }

    .login-split.is-open .book-cover {
        transform: none
    }

    .split-intro {
        border-radius: 6px 6px 0 0;
        padding: 1.5rem;
        background: var(--paper)
    }

    .split-form {
        border-radius: 0 0 6px 6px;
        padding: 1.5rem 1.25rem;
        background: var(--paper)
    }

        .split-form::before {
            right: 1.25rem
        }

    .intro-points, .intro-help {
        display: none
    }
}
