/* ==========================================================================
   Accreditation login page redesign
   Loaded in addition to (and overriding) resources/style/login.css.
   Only styling — no functional/behavioural rules live here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Typography base
   -------------------------------------------------------------------------- */
body,
body *,
#outer-login-content,
#outer-login-content *,
#login-change-banner,
#login-change-banner *,
#email-login-panel,
#email-login-panel *,
#coref-login-panel,
#coref-login-panel *,
#forgotPasswordLinkContainer,
#forgotPasswordLinkContainer *,
#helpLinkContainer,
#helpLinkContainer * {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: normal;
}

/* --------------------------------------------------------------------------
   Page shell — flatten the legacy bordered card into a wide light-blue panel
   -------------------------------------------------------------------------- */
body {
    background: #dbe4f1;
    color: #12233d;
}

#login-content-holder {
    width: 560px !important;
    max-width: 92% !important;
    height: auto !important;
    position: static !important;
    margin: 40px auto !important;
}

#outer-login-content {
    width: auto !important;
    padding: 28px 24px 20px !important;
    background: #dbe4f1 !important;
    border: none !important;
    border-radius: 14px !important;
    text-align: left !important;
    height: auto !important;
    box-shadow: none !important;
}

#accreditation-logo {
    display: block;
    margin: 0 auto 20px;
    max-width: 260px;
    height: auto;
}

/* Legacy "or" divider is not shown in the redesign */
#login-divider {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Two-column layout — email login on the left, membership number on the right
   -------------------------------------------------------------------------- */
#login-panels {
    box-sizing: border-box;
    /* Break out of the narrow centred login card, leaving gutters on the sides */
    position: relative;
    left: 50%;
    width: min(972px, calc(100vw - 80px));
    margin-left: calc(min(960px, 100vw - 80px) / -2);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 56px;
    align-items: start;
}

#login-panels::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #b9c8de;
}

/* The forgotten-password hint must wrap so it cannot widen the right column */
#login-panels .login-forgot-text {
    white-space: normal;
}

/* --------------------------------------------------------------------------
   Email login panel — outlined "Log in with email address" card
   -------------------------------------------------------------------------- */
#email-login-panel {
    margin-bottom: 20px;
    padding: 22px 24px 26px;
    border: 1px solid #b9c8de;
    border-radius: 10px;
    background-color: #c9d6ea;
}

#email-login-panel .email-panel-title {
    margin: 0 0 20px;
    font-size: 17px;
    font-weight: 700;
    color: #12233d;
    text-transform: uppercase;
    line-height: 1.4;
    text-align: center;
}

#email-login-panel .email-panel-description {
    color: #12233d;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.55;
    text-align: center;
}
#email-login-panel .email-panel-setup-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 14px 0 0;
    color: #12233d;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}
.email-panel-setup-notice{
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px
}
#coref-login-panel .email-panel-setup-notice__link {
    color: #12233d;
    font-weight: 700;
    text-decoration: underline;
}

/* Inline info icon + hover tooltip for the setup notice */
.setup-notice__info-wrap {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}
.setup-notice__info {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #12233d;
    color: #fff;
    font-family: Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    padding: 0;
}
.setup-notice__tooltip {
    position: absolute;
    top: -4px;
    left: calc(100% + 14px);
    min-width: 240px;
    max-width: 300px;
    background: #12233d;
    color: #fff;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 10;
}
.setup-notice__tooltip::after {
    content: "";
    position: absolute;
    top: 10px;
    left: -6px;
    width: 12px;
    height: 12px;
    background: #12233d;
    transform: rotate(45deg);
}
.setup-notice__info-wrap:hover .setup-notice__tooltip,
.setup-notice__info-wrap:focus-within .setup-notice__tooltip {
    opacity: 1;
    visibility: visible;
}
.email-panel-button-row {
    margin-bottom: 20px;
}
#email-login-panel .email-panel-button-row {
    text-align: center;
}

/* Shared box used by both the "Log in with email address" link and the
   "No email account?" accordion header — guarantees identical sizing and a
   centred two-line layout (question text, then bold "Click Here" below). */
.login-cta-box {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    min-height: 76px;
    margin: 0 auto;
    padding: 14px 28px;
    background: #fff;
    color: #12233d;
    border: 1.5px solid #12233d;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(18, 35, 61, 0.08);
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.45;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.login-cta-box strong {
    font-weight: 700;
}

#continue-with-email:hover,
#continue-with-email:focus {
    background-color: #f2f5fb;
    color: #12233d;
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   Company-reference panel — collapsible accordion + inner card
   -------------------------------------------------------------------------- */
#coref-login-panel {
    position: relative;
    margin-bottom: 20px;
    padding: 22px 24px 26px;
    border: 1px solid #b9c8de;
    border-radius: 10px;
    background-color: #c9d6ea;
}

.coref-accordion-header .coref-chevron {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #12233d;
    border-bottom: 2px solid #12233d;
    transform: rotate(45deg);
    margin-left: 4px;
    transition: transform 0.2s ease;
}


#coref-login-panel.is-open .coref-accordion-header .coref-chevron {
    transform: rotate(-135deg);
    margin-top: 4px;
}

#coref-login-panel:not(.is-open) .coref-card {
    display: none;
}

/* Inner body — sits inside the panel card, so no card chrome of its own */
.coref-card {
    position: relative;
    margin-top: 0;
    padding: 0;
}

.coref-card__title {
    margin: 0 44px 20px 0;
    font-size: 17px;
    font-weight: 700;
    color: #12233d;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.45;
    text-align: center;
}

/* Info (i) badge with hover tooltip */
.coref-card__info {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #12233d;
    color: #fff;
    font-family: Georgia, serif;
    font-style: italic;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}

.coref-card__info-wrap {
    position: absolute;
    top: 20px;
    right: 20px;
}

.coref-card__tooltip {
    position: absolute;
    top: -4px;
    left: calc(100% + 14px);
    min-width: 260px;
    max-width: 300px;
    background: #12233d;
    color: #fff;
    padding: 14px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    z-index: 10;
}

.coref-card__tooltip::before {
    content: "";
    position: absolute;
    top: 10px;
    left: -6px;
    width: 12px;
    height: 12px;
    background: #12233d;
    transform: rotate(45deg);
}

.coref-card__info-wrap:hover .coref-card__tooltip,
.coref-card__info-wrap:focus-within .coref-card__tooltip {
    opacity: 1;
    visibility: visible;
}

/* Numbered step markers */
.coref-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 16px 0 22px;
    color: #12233d;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.55;
    text-align: left;
}

.coref-step strong {
    font-weight: 700;
}

.coref-step__number {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid #12233d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #12233d;
    background: transparent;
}

/* Form fields */
.coref-field {
    margin: 14px 0 18px;
    text-align: left;
}

.coref-field label {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #12233d;
    margin-bottom: 8px;
    letter-spacing: 0.005em;
}

#coref-login-panel .coref-field input {
    width: 100% !important;
    box-sizing: border-box;
    padding: 13px 16px !important;
    border: 1px solid #cfd8e3 !important;
    border-radius: 10px !important;
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    sans-serif !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    color: #12233d !important;
    margin: 0 !important;
}

.coref-field input::placeholder {
    color: #9aa6b8;
    font-weight: 400;
}

.coref-field input:focus {
    outline: none;
    border-color: #12233d;
    box-shadow: 0 0 0 2px rgba(18, 35, 61, 0.15);
}

/* Keep inputs white even when autofilled by the browser */
#coref-login-panel .coref-field input:-webkit-autofill,
#coref-login-panel .coref-field input:-webkit-autofill:hover,
#coref-login-panel .coref-field input:-webkit-autofill:focus,
#coref-login-panel .coref-field input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: #12233d !important;
    caret-color: #12233d !important;
    background-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Primary submit button */
#coref-login-panel input.coref-submit,
input#Submit.coref-submit {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
    padding: 16px 20px !important;
    margin: 22px 0 6px !important;
    background: #12233d !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    sans-serif !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    text-align: center !important;
    cursor: pointer !important;
    transition: background-color 0.15s ease !important;
}

#coref-login-panel input.coref-submit:hover,
input#Submit.coref-submit:hover,
#coref-login-panel input.coref-submit:focus,
input#Submit.coref-submit:focus {
    background: #1d3762 !important;
    color: #fff !important;
}

.coref-card #login-content {
    margin-top: 0;
}

.coref-card .error,
#coref-login-panel > .error {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #fdecee;
    color: #a51a2b;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
}

/* Failed-login alert box (shown above the membership-number fields) */
.login-error-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #fde7ea;
    text-align: left;
}

.login-error-box__icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border: 1.5px solid #a51a2b;
    border-radius: 50%;
    color: #a51a2b;
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.login-error-box__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.login-error-box__title {
    margin: 0;
    color: #a51a2b;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.login-error-box__text {
    margin: 0;
    color: #9b4049;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
}

.login-error-box__text a {
    color: #9b4049;
    font-weight: 600;
    text-decoration: underline;
}

/* Red input borders while the login error is shown */
#coref-login-panel.has-login-error .coref-field input {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 1px rgba(192, 57, 43, 0.25);
}

/* --------------------------------------------------------------------------
   Footer — help guide + forgotten password links
   -------------------------------------------------------------------------- */
#forgotPasswordLinkContainer,
#helpLinkContainer {
    margin-top: 18px !important;
    text-align: center !important;
}

#forgotPasswordLinkContainer .login-footer-row,
#helpLinkContainer .login-footer-row {
    margin: 8px 0;
    font-size: 16px;
    font-weight: 400;
    color: #536178;
    line-height: 1.5;
}

.login-forgot-text{
    font-size: 13.5px;
    color: #536178;
    line-height: 1.5;
    margin-top: 4px;
    white-space: nowrap;
}

.login-password-text{
    margin-top: 4px;
    margin-bottom: 18px;
    font-size: 15px;
    color: #536178;
    line-height: 1.5;
}

#forgotPasswordLinkContainer a,
#forgotPasswordLinkContainer a.button,
#helpLinkContainer a,
#helpLinkContainer a.button {
    display: inline;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: #12233d !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    font-size: 16px !important;
    width: auto !important;
}

/* --------------------------------------------------------------------------
   Login change notice banner — dark navy overview shown above the card
   -------------------------------------------------------------------------- */
#login-change-banner {
    box-sizing: border-box;
    /* Break out of the centred login card but leave gutters on the sides */
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: calc(-50vw + 40px);
    margin-right: calc(-50vw + 40px);
    width: calc(100vw - 80px);
    /* Sit near the top of the page with a small offset from the edge */
    margin-top: -45px;
    margin-bottom: 24px;
    padding: 22px 40px 24px;
    background: #113262;
    color: #ffffff;
    border-radius: 10px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    sans-serif;
    box-shadow: 0 4px 16px rgba(18, 35, 61, 0.18);
}

#login-change-banner .login-change-banner__title {
    max-width: 1080px;
    margin: 0 auto 14px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    color: #ffffff;
    text-align: center;
}

#login-change-banner .login-change-banner__steps {
    list-style: none;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0;
}

#login-change-banner .login-change-banner__steps li {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    margin: 10px 0;
    font-size: 16px;
    line-height: 1.5;
    color: #e6ecf5;
}

#login-change-banner .login-change-banner__step-number {
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-top: 1px;
    border-radius: 50%;
    background: #4f6b91;
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

#login-change-banner .login-change-banner__step-text {
    flex: 1 1 auto;
}

#login-change-banner .login-change-banner__step-text strong {
    color: #ffffff;
    font-weight: 700;
}

/* Jump link inside the coref "No email account yet" panel step 2 */
.coref-step .coref-jump-link {
    color: #12233d;
    text-decoration: none;
    cursor: pointer;
}

.coref-step .coref-jump-link:hover,
.coref-step .coref-jump-link:focus {
    color: #1d3762;
    outline: none;
    text-decoration: none;
}

.coref-step .coref-jump-link strong {
    color: inherit;
}

/* Brief pulse to draw the eye when the user is scrolled to the email panel */
#email-login-panel.is-highlighted {
    animation: emailPanelPulse 1.4s ease;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.55);
}

@keyframes emailPanelPulse {
    0%   { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0.0); }
    30%  { box-shadow: 0 0 0 6px rgba(245, 166, 35, 0.55); }
    100% { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0.0); }
}

@media (max-width: 800px) {
    #login-panels {
        left: 0;
        width: auto;
        margin-left: 0;
        grid-template-columns: 1fr;
    }

    #login-panels::before {
        display: none;
    }
}

@media (max-width: 600px) {
    #continue-with-email,
    .coref-accordion-header {
        max-width: 100%;
        white-space: normal;
    }

    #login-change-banner {
        margin-left: calc(-50vw + 16px);
        margin-right: calc(-50vw + 16px);
        width: calc(100vw - 32px);
        padding: 18px 18px 20px;
    }

    #login-change-banner .login-change-banner__title {
        font-size: 15px;
    }

    #login-change-banner .login-change-banner__steps li {
        font-size: 13px;
    }
}
