/* The minimalist sign-in page, after the Environment and Biotechnology
   Division's Facebook cover: its pale wash, hexagons, logo lockup, name in
   capitals and contact row, in the portal's own colours. The navy bar is the
   portal's topbar, and the card and fields are its .app-card and forms.css.

   The ebd- classes are this page's. The login- classes are the form's, the
   same names as the old page's so web/js/page-transition.js serves both. */

.login-layout {
    /* From dashboard.css's :root, which this page does not load. */
    --app-primary: #1e3a8a;
    --app-primary-hover: #2f50a9;
    --app-bg: #f8fafc;
    --app-surface: #fff;
    --app-border: #e2e8f0;
    --app-field-border: #dbe3ee;
    --app-text: #0f172a;
    --app-text-muted: #64748b;
    --app-danger: #dc2626;
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--app-text);
    background: var(--app-bg);
    font-family: "Space Grotesk", sans-serif;
}

.ebd-login {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(112deg, #e6effa 0%, #f8fafc 48%, #eff8f3 100%);
}

/* The bar */

.ebd-login__bar {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 64px;
    align-items: center;
    padding: 0 22px;
    background: linear-gradient(105deg, #1e3a8a 0%, #243f91 54%, #2f50a9 100%);
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .1);
}

.ebd-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
}

.ebd-brand:hover {
    color: #fff;
}

.ebd-brand__logo {
    display: block;
    width: 40px;
    height: 40px;
    padding: 4px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
}

.ebd-brand__text strong,
.ebd-brand__text span {
    display: block;
}

.ebd-brand__text strong {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.ebd-brand__text span {
    margin-top: 1px;
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
}

/* The hexagons */

.ebd-login__hexes {
    position: absolute;
    z-index: 0;
    width: clamp(240px, 30vw, 420px);
    height: auto;
    pointer-events: none;
}

.ebd-login__hexes--top {
    top: 64px;
    right: 0;
}

.ebd-login__hexes--bottom {
    bottom: 0;
    left: 0;
}

.ebd-hex {
    fill: rgba(255, 255, 255, .6);
    stroke: rgba(30, 58, 138, .07);
    stroke-width: 1.2;
}

.ebd-hex--teal {
    fill: rgba(15, 118, 110, .07);
    stroke: rgba(15, 118, 110, .16);
}

.ebd-hex--yellow {
    fill: rgba(255, 204, 0, .12);
    stroke: rgba(217, 165, 0, .26);
}

/* The two columns */

.ebd-login__body {
    position: relative;
    z-index: 1;
    display: grid;
    flex: 1;
    grid-template-areas:
        "cover card"
        "contacts card";
    grid-template-columns: minmax(0, 1fr) 400px;
    align-content: center;
    gap: 34px clamp(40px, 6vw, 96px);
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: clamp(20px, 4vh, 48px) clamp(24px, 5vw, 72px);
}

.ebd-cover {
    grid-area: cover;
    align-self: end;
    min-width: 0;
}

.ebd-cover__lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 26px;
}

.ebd-cover__logo {
    display: block;
    width: auto;
    height: 72px;
    object-fit: contain;
}

.ebd-cover__agency {
    margin: 0 0 0 6px;
    color: var(--app-text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.ebd-cover__title {
    margin: 0;
    color: var(--app-primary);
    font-family: inherit;
    font-size: clamp(30px, 3.1vw, 46px);
    font-weight: 700;
    letter-spacing: -.012em;
    line-height: 1.08;
    text-transform: uppercase;
}

.ebd-cover__title span {
    display: block;
}

.ebd-cover__program {
    margin: 14px 0 0;
    color: var(--app-text-muted);
    font-size: 16px;
}

.ebd-contacts {
    grid-area: contacts;
    display: flex;
    flex-wrap: wrap;
    align-self: start;
    gap: 8px 24px;
    margin: 0;
    padding: 0;
    color: var(--app-text-muted);
    font-size: 13px;
    list-style: none;
}

.ebd-contacts li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ebd-contacts .bi {
    color: var(--app-primary);
    font-size: 14px;
}

.ebd-contacts a {
    color: inherit;
    text-decoration: none;
}

.ebd-contacts a:hover {
    color: var(--app-primary);
    text-decoration: underline;
}

/* The card */

.ebd-card {
    grid-area: card;
    align-self: center;
    padding: 30px 32px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.ebd-card__heading {
    margin-bottom: 22px;
}

.ebd-card__heading h2 {
    margin: 0;
    color: var(--app-primary);
    font-family: inherit;
    font-size: 22px;
    font-weight: 700;
}

.ebd-card__heading p {
    margin: 4px 0 0;
    color: var(--app-text-muted);
    font-size: 14px;
}

.ebd-card__support {
    margin: 18px 0 0;
    color: var(--app-text-muted);
    font-size: 12px;
    text-align: center;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-field {
    margin: 0;
}

.login-field__label {
    display: block;
    margin-bottom: 6px;
    color: var(--app-text);
    font-size: 13px;
    font-weight: 500;
}

.login-input {
    display: block;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    color: var(--app-text);
    background: var(--app-surface);
    border: 1px solid var(--app-field-border);
    border-radius: 10px;
    outline: none;
    font: inherit;
    font-size: 15px;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.login-input::placeholder {
    color: #94a3b8;
}

.login-input:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 .18rem rgba(30, 58, 138, .12);
}

/* Chrome's pale blue on a saved username and password. */
.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--app-text);
    box-shadow: 0 0 0 1000px var(--app-surface) inset;
    caret-color: var(--app-text);
}

.login-input:-webkit-autofill:focus {
    box-shadow: 0 0 0 1000px var(--app-surface) inset, 0 0 0 .18rem rgba(30, 58, 138, .12);
}

.login-input.is-invalid {
    border-color: var(--app-danger);
}

.login-field__error {
    display: block;
    margin-top: 6px;
    color: var(--app-danger);
    font-size: 12px;
}

.login-password {
    position: relative;
}

.login-password .login-input {
    padding-right: 48px;
}

.login-password__toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    color: var(--app-text-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.login-password__toggle:hover {
    color: var(--app-primary);
    background: #f1f5f9;
}

.login-password__toggle svg {
    width: 18px;
    height: 18px;
}

.login-password__slash {
    display: none;
}

.login-password__toggle.is-visible .login-password__slash {
    display: block;
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    margin-top: 4px;
    padding: 0 20px;
    color: #fff;
    background: var(--app-primary);
    border: 1px solid var(--app-primary);
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    transition: background .18s ease, border-color .18s ease;
}

.login-submit:hover {
    background: var(--app-primary-hover);
    border-color: var(--app-primary-hover);
}

.login-submit:disabled,
.login-submit.is-loading {
    cursor: progress;
}

/* page-transition.js sets .hidden on it, which does nothing on an SVG. */
.login-submit.is-loading .login-submit__arrow {
    display: none;
}

.login-password__toggle:focus-visible,
.login-submit:focus-visible,
.ebd-brand:focus-visible,
.ebd-contacts a:focus-visible {
    outline: 3px solid rgba(30, 58, 138, .32);
    outline-offset: 2px;
}

.ebd-brand:focus-visible {
    outline-color: rgba(255, 255, 255, .55);
}

.login-submit__arrow,
.login-submit__spinner {
    width: 17px;
    height: 17px;
}

.login-submit__spinner {
    border: 2px solid rgba(255, 255, 255, .42);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-submit-spin .75s linear infinite;
}

@keyframes login-submit-spin {
    to {
        transform: rotate(360deg);
    }
}

.ebd-login__footer {
    position: relative;
    z-index: 1;
    padding: 0 22px 14px;
    color: var(--app-text-muted);
    font-size: 11px;
    text-align: center;
}

/* One column: the name in brief, the card, then the contact row. */
@media (max-width: 900px) {
    .ebd-login__body {
        grid-template-areas:
            "cover"
            "card"
            "contacts";
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
        gap: 22px;
        max-width: 460px;
        padding: 22px 16px;
    }

    .ebd-cover__lockup {
        gap: 10px;
        margin-bottom: 14px;
    }

    .ebd-cover__logo {
        height: 48px;
    }

    .ebd-cover__agency,
    .ebd-cover__program {
        display: none;
    }

    .ebd-cover__title {
        font-size: clamp(20px, 6vw, 26px);
    }

    .ebd-card {
        padding: 24px 20px;
    }

    .ebd-contacts {
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .ebd-login__bar {
        flex-basis: 60px;
        padding: 0 16px;
    }

    .ebd-login__hexes--top {
        top: 60px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-input,
    .login-submit {
        transition-duration: .01ms !important;
    }

    .login-submit__spinner {
        animation-duration: 1.5s !important;
    }
}
