/*
 * Discover Gilbert — branded wp-login.php screen.
 * Loaded only on wp-login.php (see gilbert_login_* functions in functions.php).
 * Selectors are prefixed with body.gb-login-page so they outrank core's login.css.
 */

/*--------------------------------------------------------------
# Tokens + page shell
--------------------------------------------------------------*/
body.login.gb-login-page {
    --gb-bg: #FBF8F4;
    --gb-ink: #1B1B3A;
    --gb-pink: #E2187E;
    --gb-lime: #A8D24A;
    --gb-muted: #5A5872;
    --gb-faint: #8B88A3;
    --gb-line: #E4DFEA;
    --gb-chip: #F2EEF6;
    --gb-display: 'gopher', 'Outfit', sans-serif;
    --gb-ui: 'Outfit', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --gb-body: 'Mulish', 'Helvetica Neue', Helvetica, Arial, sans-serif;

    margin: 0;
    padding: 0;
    min-width: 0;
    min-height: 100vh;
    background: var(--gb-bg);
    font-family: var(--gb-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--gb-ink);
}

body.gb-login-page * {
    box-sizing: border-box;
}

body.gb-login-page .gb-login {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 46%) 1fr;
}

body.gb-login-page .gb-login__panel {
    display: flex;
    flex-direction: column;
    padding: 48px 56px 40px;
    animation: gbFade .5s ease both;
}

@keyframes gbFade {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/*--------------------------------------------------------------
# Brand mark
--------------------------------------------------------------*/
body.gb-login-page .gb-login__brand {
    display: block;
    flex: 0 0 auto;
    width: 236px;
    max-width: 100%;
    outline: 0;
    box-shadow: none;
}

body.gb-login-page .gb-login__brand img {
    display: block;
    width: 100%;
    height: auto;
}

/*--------------------------------------------------------------
# Core #login column
--------------------------------------------------------------*/
body.gb-login-page #login {
    width: 100%;
    max-width: 420px;
    padding: 0;
    margin: auto 0 0;      /* auto top margin — pairs with the legal row below */
    padding-top: 40px;
}

/* Core's logo heading — replaced by .gb-login__brand above. */
body.gb-login-page #login > h1 {
    display: none;
}

body.gb-login-page .gb-login__intro {
    margin: 0 0 30px;
}

body.gb-login-page .gb-login__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gb-lime);
    color: var(--gb-ink);
    font-family: var(--gb-ui);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 9px 18px;
    border-radius: 999px;
}

body.gb-login-page .gb-login__title {
    font-family: var(--gb-display);
    font-weight: 800;
    font-size: 44px;
    line-height: 1.05;
    letter-spacing: -0.015em;
    color: var(--gb-ink);
    margin: 20px 0 10px;
    padding: 0;
    text-align: left;
}

body.gb-login-page .gb-login__sub {
    font-size: 16px;
    line-height: 1.6;
    color: var(--gb-muted);
    margin: 0;
    text-wrap: pretty;
}

/*--------------------------------------------------------------
# Forms
--------------------------------------------------------------*/
body.gb-login-page form {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 0;
    margin: 0;
    padding: 0;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-weight: 400;
}

body.gb-login-page form > * {
    flex: 0 0 100%;
    margin: 0;
    padding: 0;
}

body.gb-login-page form label {
    display: block;
    margin: 0 0 8px;
    font-family: var(--gb-ui);
    font-weight: 700;
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gb-ink);
}

body.gb-login-page form .input,
body.gb-login-page form input[type="text"],
body.gb-login-page form input[type="email"],
body.gb-login-page form input[type="password"] {
    display: block;
    width: 100%;
    height: 56px;
    margin: 0;
    padding: 0 20px;
    font-family: var(--gb-body);
    font-size: 16px;
    font-weight: 400;
    line-height: normal;
    color: var(--gb-ink);
    background: #FFFFFF;
    border: 1.5px solid var(--gb-line);
    border-radius: 16px;
    box-shadow: none;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

body.gb-login-page form .input:focus,
body.gb-login-page form input[type="text"]:focus,
body.gb-login-page form input[type="email"]:focus,
body.gb-login-page form input[type="password"]:focus {
    border-color: var(--gb-ink);
    box-shadow: 0 0 0 4px rgba(226, 24, 126, 0.14);
}

body.gb-login-page form input::placeholder {
    color: var(--gb-faint);
    opacity: 1;
}

/* Password field + show/hide pill */
body.gb-login-page .user-pass-wrap,
body.gb-login-page .user-pass1-wrap,
body.gb-login-page .user-pass2-wrap {
    flex: 0 0 100%;
}

body.gb-login-page .wp-pwd {
    position: relative;
    display: flex;
    align-items: center;
}

/* Room for the Show/Hide pill. Beats `.js.login input.password-input`,
   which core sets to 2.5rem. */
body.gb-login-page .wp-pwd input.password-input,
body.gb-login-page .wp-pwd input[type="password"],
body.gb-login-page .wp-pwd input[type="text"] {
    padding-right: 92px;
}

body.gb-login-page .wp-pwd .button,
body.gb-login-page .wp-pwd .button.wp-hide-pw {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    height: 40px;
    min-height: 0;
    padding: 0 16px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    background: var(--gb-chip);
    color: var(--gb-ink);
    font-family: var(--gb-ui);
    font-weight: 700;
    font-size: 11px;
    line-height: 1;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
}

body.gb-login-page .wp-pwd .button:hover,
body.gb-login-page .wp-pwd .button.wp-hide-pw:hover {
    background: var(--gb-line);
    color: var(--gb-pink);
}

body.gb-login-page .wp-pwd .button.wp-hide-pw:focus {
    border: 0;
    background: var(--gb-line);
    box-shadow: 0 0 0 3px rgba(226, 24, 126, 0.28);
}

/* Swap the dashicon for a "Show" / "Hide" word to match the design.
   Core toggles the icon class, so the label follows the field state.
   The long selector is deliberate: core sizes this icon from two places,
   `.wp-core-ui .button.wp-hide-pw > .dashicons` (forms.css) and
   `.login .button.wp-hide-pw .dashicons` (login.css), both at 0-4-0. */
body.gb-login-page .wp-pwd .button.wp-hide-pw .dashicons {
    width: auto;
    height: auto;
    font-family: var(--gb-ui);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .1em;
    text-transform: uppercase;
    vertical-align: baseline;
}

body.gb-login-page .wp-pwd .button.wp-hide-pw .dashicons::before {
    content: "Show";
}

body.gb-login-page .wp-pwd .button.wp-hide-pw .dashicons-hidden::before {
    content: "Hide";
}

/* Preferred source of truth where supported: the input's own type. */
body.gb-login-page .wp-pwd:has(input[type="password"]) .button.wp-hide-pw .dashicons::before {
    content: "Show";
}

body.gb-login-page .wp-pwd:has(input[type="text"]) .button.wp-hide-pw .dashicons::before {
    content: "Hide";
}

/* "Generate password" on the reset screen sits in the normal flow. */
body.gb-login-page .wp-pwd .wp-generate-pw,
body.gb-login-page .wp-generate-pw {
    position: static;
    transform: none;
    height: 48px;
    padding: 0 22px;
    background: transparent;
    border: 1.5px solid var(--gb-line);
    color: var(--gb-ink);
    font-size: 12px;
}

body.gb-login-page #pass-strength-result {
    width: 100%;
    margin: 12px 0 0;
    padding: 12px 16px;
    background: #FFFFFF;
    border: 1.5px solid var(--gb-line);
    border-radius: 12px;
    font-family: var(--gb-ui);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--gb-ink);
}

body.gb-login-page #pass-strength-result.short,
body.gb-login-page #pass-strength-result.bad {
    border-color: var(--gb-pink);
}

body.gb-login-page #pass-strength-result.good,
body.gb-login-page #pass-strength-result.strong {
    border-color: var(--gb-lime);
}

body.gb-login-page .pw-weak {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--gb-muted);
}

body.gb-login-page .pw-weak label {
    margin: 0;
    font-family: var(--gb-body);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    color: var(--gb-muted);
}

body.gb-login-page .indicator-hint,
body.gb-login-page .description {
    font-size: 13px;
    line-height: 1.5;
    color: var(--gb-muted);
    margin: 8px 0 0;
    padding: 0;
}

/* "Keep me signed in" + "Forgot password?" share one row. */
body.gb-login-page form > .forgetmenot {
    flex: 1 1 auto;
    order: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 0;
    font-size: 14px;
    color: var(--gb-muted);
}

body.gb-login-page form > .forgetmenot label {
    display: inline;
    margin: 0;
    font-family: var(--gb-body);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: normal;
    text-transform: none;
    color: var(--gb-muted);
    cursor: pointer;
}

body.gb-login-page form > .forgetmenot input[type="checkbox"] {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--gb-ink);
    border-radius: 6px;
}

body.gb-login-page form > .gb-login__forgot {
    flex: 0 0 auto;
    order: 2;
    align-self: center;
    margin: 2px 0 0 auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--gb-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.gb-login-page form > .gb-login__forgot:hover,
body.gb-login-page form > .gb-login__forgot:focus {
    color: var(--gb-pink);
}

/* Submit */
body.gb-login-page form > .submit {
    order: 3;
    margin: 8px 0 0;
}

body.gb-login-page #wp-submit,
body.gb-login-page .button-primary {
    display: block;
    float: none;
    width: 100%;
    height: 60px;
    min-height: 60px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--gb-pink);
    color: #FFFFFF;
    font-family: var(--gb-ui);
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    letter-spacing: .1em;
    text-transform: uppercase;
    text-shadow: none;
    box-shadow: none;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

body.gb-login-page #wp-submit:hover,
body.gb-login-page .button-primary:hover {
    background: var(--gb-ink);
    color: #FFFFFF;
    transform: translateY(-2px);
}

body.gb-login-page #wp-submit:focus-visible,
body.gb-login-page .button-primary:focus-visible {
    outline: 3px solid var(--gb-ink);
    outline-offset: 3px;
}

/*--------------------------------------------------------------
# Errors + messages
--------------------------------------------------------------*/
/* Scoped to #login so these beat core's own `#login .notice` rules — an ID
   selector, which a class-only override can never outrank. */
body.gb-login-page #login_error,
body.gb-login-page #login .message,
body.gb-login-page #login .success,
body.gb-login-page #login .notice {
    width: 100%;
    margin: 0 0 20px;
    padding: 16px 18px;
    background: #FFFFFF;
    border: 1.5px solid var(--gb-line);
    border-left: 4px solid var(--gb-lime);
    border-radius: 14px;
    box-shadow: none;
    font-family: var(--gb-body);
    font-size: 14px;
    line-height: 1.55;
    color: var(--gb-ink);
}

/* Failures get the pink accent; everything else stays lime. */
body.gb-login-page #login_error,
body.gb-login-page #login .notice-error {
    border-left-color: var(--gb-pink);
}

body.gb-login-page #login_error p,
body.gb-login-page #login .message p,
body.gb-login-page #login .notice p {
    margin: 0 0 8px;
    padding: 0;
    font-size: 14px;
    line-height: 1.55;
}

body.gb-login-page #login_error p:last-child,
body.gb-login-page #login .message p:last-child,
body.gb-login-page #login .notice p:last-child {
    margin-bottom: 0;
}

body.gb-login-page #login_error a,
body.gb-login-page #login .message a,
body.gb-login-page #login .notice a {
    color: var(--gb-pink);
    font-weight: 600;
}

/*--------------------------------------------------------------
# Below the form: divider, back button, legal
--------------------------------------------------------------*/
body.gb-login-page .gb-login__divider {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: 420px;
    margin: 28px 0 0;
}

body.gb-login-page .gb-login__divider::before,
body.gb-login-page .gb-login__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--gb-line);
}

body.gb-login-page .gb-login__divider span {
    font-family: var(--gb-ui);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gb-faint);
}

body.gb-login-page .gb-login__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 420px;
    height: 56px;
    margin: 20px 0 0;
    background: transparent;
    border: 1.5px solid var(--gb-line);
    border-radius: 999px;
    color: var(--gb-ink);
    font-family: var(--gb-ui);
    font-weight: 700;
    font-size: 13px;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-decoration: none;
    transition: border-color .15s ease, background .15s ease;
}

body.gb-login-page .gb-login__back:hover,
body.gb-login-page .gb-login__back:focus {
    border-color: var(--gb-ink);
    background: #FFFFFF;
    color: var(--gb-ink);
}

body.gb-login-page .gb-login__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    width: 100%;
    max-width: 420px;
    margin: auto 0 0;      /* second auto margin — centres the block above it */
    padding-top: 40px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--gb-faint);
}

body.gb-login-page .gb-login__legal a {
    color: var(--gb-faint);
    text-decoration: none;
}

body.gb-login-page .gb-login__legal a:hover,
body.gb-login-page .gb-login__legal a:focus {
    color: var(--gb-pink);
    text-decoration: underline;
}

/*--------------------------------------------------------------
# Secondary nav (lost password / register screens)
--------------------------------------------------------------*/
body.gb-login-page #nav {
    width: 100%;
    max-width: 420px;
    margin: 20px 0 0;
    padding: 0;
    font-size: 14px;
    color: var(--gb-muted);
    text-align: left;
}

body.gb-login-page #nav a {
    color: var(--gb-ink);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

body.gb-login-page #nav a:hover,
body.gb-login-page #nav a:focus {
    color: var(--gb-pink);
}

/* On the sign-in screen the lost-password link lives inside the form instead. */
body.gb-login-page.login-action-login #nav {
    display: none;
}

body.gb-login-page .language-switcher {
    width: 100%;
    max-width: 420px;
    margin: 24px 0 0;
    font-size: 14px;
}

/* Replaced by .gb-login__back / .gb-login__legal. */
body.gb-login-page #backtoblog,
body.gb-login-page .privacy-policy-page-link,
body.gb-login-page .clear {
    display: none;
}

/*--------------------------------------------------------------
# Artwork panel
--------------------------------------------------------------*/
body.gb-login-page .gb-login__art {
    position: relative;
    padding: 20px 20px 20px 0;
}

body.gb-login-page .gb-login__art-frame {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--gb-ink);
    border-radius: 40px;
    overflow: hidden;
}

body.gb-login-page .gb-login__art-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*--------------------------------------------------------------
# Links
--------------------------------------------------------------*/
body.gb-login-page a {
    color: var(--gb-ink);
    text-decoration: none;
}

body.gb-login-page a:hover,
body.gb-login-page a:focus {
    color: var(--gb-pink);
}

body.gb-login-page a:focus-visible,
body.gb-login-page input:focus-visible {
    outline: 3px solid rgba(226, 24, 126, 0.35);
    outline-offset: 2px;
}

/*--------------------------------------------------------------
# Responsive
--------------------------------------------------------------*/
@media screen and (max-width: 1024px) {
    body.gb-login-page .gb-login {
        grid-template-columns: 1fr;
    }

    body.gb-login-page .gb-login__art {
        display: none;
    }

    /* Keep the logo, form and footer on one left edge in the centred column. */
    body.gb-login-page .gb-login__panel {
        width: 100%;
        max-width: 484px;      /* 420 content + 32px padding either side */
        margin: 0 auto;
        padding: 40px 32px 32px;
    }
}

@media screen and (max-width: 640px) {
    body.gb-login-page .gb-login__panel {
        max-width: 460px;      /* 420 content + 20px padding either side */
        padding: 32px 20px 28px;
    }

    body.gb-login-page .gb-login__brand {
        width: 200px;
    }

    body.gb-login-page .gb-login__title {
        font-size: 34px;
    }

    body.gb-login-page #login {
        padding-top: 32px;
    }

    body.gb-login-page .gb-login__legal {
        padding-top: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.gb-login-page .gb-login__panel {
        animation: none;
    }

    body.gb-login-page #wp-submit,
    body.gb-login-page .button-primary,
    body.gb-login-page .gb-login__back,
    body.gb-login-page form .input {
        transition: none;
    }

    body.gb-login-page #wp-submit:hover,
    body.gb-login-page .button-primary:hover {
        transform: none;
    }
}
