/**
 * Sign-in, registration and password-reset screens.
 *
 * wp-login.php does not load the theme's style.css, so the tokens are repeated
 * here as literals. Keep them in step with the :root block in style.css.
 */

.login {
    --bg:      #0A0A0C;
    --text:    #F4F1EB;
    --muted:   #8E8B84;
    --gold:    #C8A44D;
    --line:    rgba( 244, 241, 235, .14 );
    --panel:   rgba( 14, 14, 17, .74 );
    --serif:   "Playfair Display", Georgia, "Times New Roman", serif;
    --sans:    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ---------------------------------------------------------------- page ---- */

body.login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-variant-numeric: lining-nums;
}

/* The banner. The image itself is set inline from the Site Settings value. */
body.login::before {
    content: "";
    position: fixed;
    inset: 0;
    background-color: var(--bg);
    background-repeat: no-repeat;
    background-size: cover;
}

/* Vignette, so the panel never has to fight the foil for contrast. */
body.login::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient( 120% 90% at 50% 45%, rgba( 10, 10, 12, .60 ) 0%, rgba( 10, 10, 12, .93 ) 62%, #0A0A0C 100% ),
        linear-gradient( 180deg, rgba( 10, 10, 12, .55 ), rgba( 10, 10, 12, .86 ) );
}

/* --------------------------------------------------------------- panel ---- */

#login {
    position: relative;
    z-index: 2;
    width: 402px;
    max-width: calc( 100% - 40px );
    margin: 0;
    padding: 44px 40px 38px;
    background: var(--panel);
    border: 1px solid var(--line);
    backdrop-filter: blur( 9px );
    -webkit-backdrop-filter: blur( 9px );
}

/* Core's h1 stays for screen readers; our own wordmark is what you see. */
#login h1 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset( 50% );
    white-space: nowrap;
}

.csimm-mark {
    display: block;
    width: 258px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 30px;
}

.csimm-login-title {
    margin: 0 0 10px;
    font: 400 30px/1.18 var(--serif);
    letter-spacing: -.005em;
    color: var(--text);
}

.csimm-login-sub {
    margin: 0 0 28px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--muted);
}

/* Check-your-email and choose-a-password screens read better centred. */
body.login-action-rp .csimm-login-title,
body.login-action-resetpass .csimm-login-title {
    text-align: left;
}

/* ---------------------------------------------------------------- form ---- */

body.login form {
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
}

body.login form p {
    margin: 0 0 18px;
}

body.login form label {
    display: block;
    margin: 0 0 7px;
    font-size: 11px;
    line-height: 1.4;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

body.login form .input,
body.login input[type="text"],
body.login input[type="email"],
body.login input[type="password"] {
    width: 100%;
    margin: 0;
    padding: 13px 15px;
    background: rgba( 255, 255, 255, .045 );
    border: 1px solid var(--line);
    border-radius: 2px;
    box-shadow: none;
    color: var(--text);
    /* 16px keeps iOS from zooming the whole page on focus. */
    font: 400 16px/1.4 var(--sans);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

body.login form .input:focus,
body.login input[type="text"]:focus,
body.login input[type="email"]:focus,
body.login input[type="password"]:focus {
    outline: none;
    background: rgba( 255, 255, 255, .07 );
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba( 200, 164, 77, .14 );
}

/* Chrome's autofill yellow would undo the whole thing. */
body.login input:-webkit-autofill,
body.login input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: inset 0 0 0 1000px #14141A;
    caret-color: var(--text);
}

/* Core's show/hide-password button. */
body.login .wp-pwd {
    position: relative;
}

body.login .wp-hide-pw {
    position: absolute;
    top: 0;
    right: 0;
    width: 46px;
    height: 100%;
    background: none;
    border: 0;
    box-shadow: none;
    color: var(--muted);
}

body.login .wp-hide-pw:hover,
body.login .wp-hide-pw:focus {
    background: none;
    border: 0;
    box-shadow: none;
    color: var(--gold);
}

body.login .wp-hide-pw .dashicons {
    width: 18px;
    font-size: 18px;
}

/* Keep me signed in. */
body.login .forgetmenot {
    float: none;
    margin: 22px 0 24px;
    font-size: 13.5px;
}

body.login .forgetmenot label {
    display: inline;
    margin: 0 0 0 9px;
    font-size: 13.5px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}

body.login .forgetmenot input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--gold);
    border-color: var(--line);
}

/* -------------------------------------------------------------- button ---- */

body.login form .submit {
    margin: 0;
}

body.login #wp-submit {
    float: none;
    width: 100%;
    height: auto;
    padding: 16px;
    background: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 2px;
    box-shadow: none;
    color: #14120E;
    font: 600 13px/1 var(--sans);
    letter-spacing: .12em;
    text-transform: uppercase;
    text-shadow: none;
    cursor: pointer;
    transition: filter .16s ease;
}

body.login #wp-submit:hover,
body.login #wp-submit:focus {
    background: var(--gold);
    border-color: var(--gold);
    color: #14120E;
    filter: brightness( 1.09 );
}

/* The "confirmation will be emailed to you" line under the signup button. */
body.login #reg_passmail,
body.login .description.indicator-hint {
    margin: 14px 0 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--muted);
    text-align: center;
}

/* Email above display name, which is the order people expect. */
#registerform {
    display: flex;
    flex-direction: column;
}

#registerform p:has( #user_email ) {
    order: -1;
}

/* ------------------------------------------------------------- notices ---- */

body.login #login_error,
body.login .message,
body.login .success,
body.login .notice {
    margin: 0 0 22px;
    padding: 11px 14px;
    background: rgba( 200, 164, 77, .08 );
    border: 0;
    border-left: 2px solid var(--gold);
    border-radius: 0;
    box-shadow: none;
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.55;
}

body.login #login_error a,
body.login .message a {
    color: var(--gold);
}

/* --------------------------------------------------------------- links ---- */

/* Register / Lost your password. */
body.login #nav {
    margin: 26px 0 0;
    padding: 22px 0 0;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
}

body.login #nav a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--gold);
    padding-bottom: 1px;
}

body.login #nav a:hover,
body.login #nav a:focus {
    color: var(--gold);
    box-shadow: none;
}

/* Back to the site, lifted out of the panel entirely. */
body.login #backtoblog {
    position: static;
    margin: 0 0 26px;
    padding: 0;
    font-size: 12.5px;
    letter-spacing: .08em;
}

body.login #backtoblog a {
    color: var(--muted);
    text-decoration: none;
}

body.login #backtoblog a:hover,
body.login #backtoblog a:focus {
    color: var(--text);
    box-shadow: none;
}

/* Noise we do not need on a two-field form. */
body.login .language-switcher,
body.login .privacy-policy-page-link {
    display: none;
}

/* -------------------------------------------------------------- mobile ---- */

@media ( max-width: 520px ) {

    #login {
        padding: 36px 26px 30px;
    }

    .csimm-login-title {
        font-size: 27px;
    }


}

/*
 * Spacing rhythm.
 *
 * Core wraps the username field in a <p> but the password field in a <div>,
 * so the paragraph margin that separates everything else skips it — which is
 * why the Password label sat closer to the email box than to its own.
 */
body.login .user-pass-wrap {
    margin: 26px 0 0;
}

body.login .forgetmenot {
    display: flex;
    align-items: center;
    margin: 28px 0 26px;
}

body.login .forgetmenot input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin: 0;
    padding: 0;
    background: rgba( 255, 255, 255, .05 );
    border: 1px solid var(--line);
    border-radius: 2px;
    accent-color: var(--gold);
}

body.login .forgetmenot label {
    margin: 0 0 0 10px;
    line-height: 1;
}

/* The mobile override moved with it. */
@media ( max-width: 520px ) {

    body.login #backtoblog {
        margin-bottom: 20px;
    }
}

/* ---------------------------------------------------- spacing, tuned ---- */

/*
 * Explicit margins on both sides rather than relying on one of them: adjacent
 * margins collapse, so a gap set only below the checkbox can disappear
 * depending on what follows it.
 */
body.login .forgetmenot {
    margin: 30px 0 0;
}

/* The sign-in button needs air above it. */
body.login form .submit {
    margin: 26px 0 0;
}

/* Now that the back link sits under the nav links, it needs separating. */
body.login #backtoblog {
    margin: 22px 0 0;
}

/* Registration: the "we'll email you a link" note, and its button. */
body.login #reg_passmail {
    margin: 16px 0 0;
}

body.login #registerform .submit {
    margin: 24px 0 0;
}

/* ------------------------------------------------------------------------
 * No ambiguity about this one.
 *
 * Margins on both sides rather than relying on collapse, and clear:both in
 * case core's float on either element is what keeps pulling them together.
 * ---------------------------------------------------------------------- */

body.login form .forgetmenot {
    float: none;
    clear: both;
    display: flex;
    align-items: center;
    margin: 30px 0 30px;
}

body.login form p.submit,
body.login form .submit {
    float: none;
    clear: both;
    margin: 30px 0 0;
    padding: 0;
}

/* ------------------------------------------------------------------------
 * Space around the remember-me row.
 *
 * Margins declared on both sides rather than relying on collapse, and
 * clear:both in case core floats either element.
 * ---------------------------------------------------------------------- */

body.login form .forgetmenot {
    float: none;
    clear: both;
    display: flex;
    align-items: center;
    margin: 30px 0 30px;
}

body.login form p.submit {
    float: none;
    clear: both;
    margin: 30px 0 0;
    padding: 0;
}

/*
 * Deliberate !important.
 *
 * Something in core's login stylesheet is zeroing these and winning on load
 * order. Not worth another round of specificity archaeology for two margins
 * on one screen — if it ever needs changing, it changes here.
 */
body.login form p.forgetmenot {
    margin-top: 30px !important;
    margin-bottom: 30px !important;
}

body.login form p.submit {
    margin-top: 30px !important;
}
