/*
 * Backoffice login page. Loaded by portal/templates/login.html after
 * portal.css, and scoped to body.login, so no other page is affected.
 * Brand palette: the website's blues (logo #3973B9) and mktwidgets' navy and
 * neutrals.
 */
body.login {
    --wgf-blue: #3973b9;
    --wgf-blue-dark: #2c5c96;
    --wgf-sky: #69b6e6;
    --wgf-navy: #071d3a;
    --wgf-soft: #f4f8ff;
    --wgf-line: #dfe5ef;
    --wgf-muted: #59617d;

    min-height: 100vh;
    margin: 0;
    background: linear-gradient(160deg, #ffffff 0%, var(--wgf-soft) 55%, #eaf1fb 100%);
    font-family: "sofia_pro_lightregular", "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--wgf-navy);
}

/* Backdrop: the buildings photo at ~20%, fading out, and faint brand lines. */
.login-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.login-backdrop::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: url("../images/login-buildings.jpg") center top / cover no-repeat;
    opacity: 0.2;
    /* Keep the photo a pale ghost on the light background. */
    -webkit-filter: saturate(0.7) brightness(1.7);
    filter: saturate(0.7) brightness(1.7);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 85%);
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.6) 45%, transparent 85%);
}
.login-backdrop .login-lines {
    position: absolute;
    top: -6%;
    right: -6%;
    bottom: -6%;
    left: -6%;
    background: url("../images/login-lines.svg") center / cover no-repeat;
    will-change: transform;
}
/* Two layers drifting slowly in opposite directions: barely noticeable. */
.login-backdrop .login-lines-a {
    animation: wgf-login-drift-a 48s ease-in-out infinite alternate;
}
.login-backdrop .login-lines-b {
    opacity: 0.5;
    transform: translate3d(0, 9%, 0) scale(1.15);
    animation: wgf-login-drift-b 64s ease-in-out infinite alternate;
}
@keyframes wgf-login-drift-a {
    from { transform: translate3d(-1.5%, 0.5%, 0); }
    to   { transform: translate3d(1.5%, -1%, 0); }
}
@keyframes wgf-login-drift-b {
    from { transform: translate3d(1.5%, 9%, 0) scale(1.15); }
    to   { transform: translate3d(-1.5%, 8%, 0) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
    .login-backdrop .login-lines-a,
    .login-backdrop .login-lines-b {
        animation: none;
    }
}

/* The logo and the card sit above the backdrop. */
body.login #clogo,
body.login .login_portal {
    position: relative;
    z-index: 1;
}
body.login #clogo {
    width: 280px;
    margin: 0 auto;
    padding-top: 12vh;
}
body.login div#clogo a.logo {
    display: block;
    width: 280px;
    height: 63px;
    background-position: center;
}

body.login .login_portal {
    width: 360px;
    max-width: calc(100% - 32px);
    max-height: none;
    min-height: 0;
    margin: 28px auto 40px;
    padding: 28px 32px 32px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid var(--wgf-line);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(7, 29, 58, 0.10), 0 2px 6px rgba(7, 29, 58, 0.05);
}
body.login .login_portal form {
    width: auto;
}
body.login .login_portal .legend {
    background: none;
    padding: 0;
    margin: 0 0 18px;
    line-height: 1.2;
    text-transform: none;
}
body.login .login_portal .legend legend {
    margin: 0;
    color: var(--wgf-navy);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.2px;
}
body.login .login_portal label {
    display: block;
    width: auto;
    margin: 14px 0 6px;
    font-family: inherit;
    font-size: 13px;
    color: var(--wgf-muted);
}
body.login .login_portal input[type="text"],
body.login .login_portal input[type="password"] {
    display: block;
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0 12px;
    box-sizing: border-box;
    border: 1px solid var(--wgf-line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--wgf-navy);
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
body.login .login_portal input[type="text"]:focus,
body.login .login_portal input[type="password"]:focus {
    outline: none;
    border-color: var(--wgf-blue);
    box-shadow: 0 0 0 3px rgba(57, 115, 185, 0.18);
}
body.login .login_portal input[type="submit"] {
    display: block;
    width: 100%;
    height: 44px;
    margin: 24px 0 0;
    border: 0;
    border-radius: 8px;
    background: var(--wgf-blue);
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(57, 115, 185, 0.28);
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
body.login .login_portal input[type="submit"]:hover,
body.login .login_portal input[type="submit"]:focus {
    background: var(--wgf-blue-dark);
    box-shadow: 0 8px 20px rgba(57, 115, 185, 0.34);
    outline: none;
}
body.login .login_portal p {
    width: auto;
    margin: 12px 0 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: #fdf1ee;
    color: #b42318;
    font-size: 13px;
}
