/* =========================================================================
   Sign-in page layout — brand neutral
   Shared by every site on this installation. Colours come from the CSS
   variables below, which a brand theme may override; the defaults here are
   deliberately neutral so an unbranded site still looks finished.
   ========================================================================= */

:root {
    --login-ink:        #1c1e2b;
    --login-muted:      #6b7280;
    --login-bg:         #f6f7fb;
    --login-surface:    #ffffff;
    --login-border:     #dfe3ec;
    --login-placeholder:#9aa1ae;
    --login-primary:    #2a2f45;   /* overridden per brand */
    --login-primary-dk: #1b1f30;
    --login-accent:     #4caf50;
    --login-panel-a:    #2b3147;   /* brand panel gradient */
    --login-panel-b:    #1d2233;
}

/* =========================================================================
   Sign-in page — full-bleed split screen
   Left: brand panel on navy. Right: sign-in card.
   Scoped under .aap-login so nothing here leaks into the admin UI.
   ========================================================================= */

body.white-bg-login { background: #ffffff !important; margin: 0; }

.aap-login {
    display: flex;
    min-height: 100vh;
    width: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- left: brand ---------- */

.aap-login__brand {
    flex: 0 0 45%;
    max-width: 45%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
    background:
        linear-gradient(160deg, var(--login-panel-a) 0%, var(--login-panel-b) 100%);
    background-color: var(--login-panel-b);
    overflow: hidden;
}

/* faint constellation texture, drawn rather than loaded as an image */
.aap-login__brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(120,150,255,0.28) 1px, transparent 1.4px),
        radial-gradient(circle, rgba(120,150,255,0.16) 1px, transparent 1.4px);
    background-size: 46px 46px, 88px 88px;
    background-position: 0 0, 23px 31px;
    opacity: 0.55;
    pointer-events: none;
}

.aap-login__brand-inner { position: relative; z-index: 1; max-width: 560px; width: 100%; }

.aap-login__logo {
    display: block;
    width: 300px;
    max-width: 70%;
    height: auto;
    margin: 0 0 26px 0;
}

.aap-login__sitename {
    margin: 0;
    color: #ffffff;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1.25;
}

.aap-login__rule {
    display: block;
    width: 46px;
    height: 3px;
    border-radius: 2px;
    background: #4caf50;
    margin: 30px 0 26px 0;
}

.aap-login__headline {
    margin: 0 0 14px 0;
    color: #ffffff;
    font-size: 30px;
    line-height: 1.32;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.aap-login__subline {
    margin: 0 0 46px 0;
    color: rgba(255,255,255,0.62);
    font-size: 15px;
}

.aap-login__features { display: flex; gap: 0; }

.aap-login__feature {
    flex: 1;
    padding: 0 18px;
    text-align: center;
    border-left: 1px solid rgba(255,255,255,0.14);
}
.aap-login__feature:first-child { border-left: none; padding-left: 0; }
.aap-login__feature:last-child { padding-right: 0; }

.aap-login__feature i {
    display: block;
    font-size: 30px;
    color: #7ec98a;
    margin-bottom: 14px;
}
.aap-login__feature strong {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 7px;
}
.aap-login__feature span {
    display: block;
    color: rgba(255,255,255,0.55);
    font-size: 12.5px;
    line-height: 1.45;
}

/* ---------- right: form ---------- */

.aap-login__panel {
    flex: 1 1 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: #f6f7fb;
}

.aap-login__card {
    width: 100%;
    max-width: 430px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(15, 20, 40, 0.10), 0 2px 8px rgba(15, 20, 40, 0.05);
    padding: 46px 42px 38px 42px;
}

.aap-login__title {
    margin: 0 0 10px 0;
    text-align: center;
    color: var(--login-primary);
    font-size: 31px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.aap-login__subtitle {
    margin: 0 0 32px 0;
    text-align: center;
    color: #6b7280;
    font-size: 14.5px;
}

.aap-field { position: relative; margin-bottom: 16px; }

.aap-field__icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa1ae;
    font-size: 15px;
    pointer-events: none;
}

.aap-field__input {
    width: 100%;
    height: 52px;
    padding: 0 44px 0 44px;
    border: 1px solid #dfe3ec;
    border-radius: 7px;
    background: #ffffff;
    color: var(--login-ink);
    font-size: 15px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.aap-field__input::placeholder { color: #9aa1ae; }
.aap-field__input:focus {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.aap-field__reveal {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: none;
    background: transparent;
    color: #9aa1ae;
    cursor: pointer;
    border-radius: 6px;
}
.aap-field__reveal:hover { color: var(--login-primary); background: #f2f4f9; }

.aap-login__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 26px 0;
}

.aap-login__remember {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-weight: 400;
    font-size: 14px;
    color: #4b5563;
    cursor: pointer;
}
.aap-login__remember input { width: 16px; height: 16px; margin: 0; cursor: pointer; }

.aap-login__forgot { font-size: 14px; color: var(--login-primary); text-decoration: none; }
.aap-login__forgot:hover { text-decoration: underline; }

.aap-login__submit {
    display: block;
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 7px;
    background: var(--login-primary);
    color: #ffffff;
    font-size: 15.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: background .15s ease, transform .05s ease;
}
.aap-login__submit:hover { background: var(--login-primary-dk); }
.aap-login__submit:active { transform: translateY(1px); }

.aap-login__divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 30px 0 18px 0;
    color: #4caf50;
}
.aap-login__divider::before,
.aap-login__divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e6e9f0;
}

.aap-login__trust {
    margin: 0;
    text-align: center;
    color: #6b7280;
    font-size: 13.5px;
}
.aap-login__trust span { color: #c3c8d4; margin: 0 7px; }

.aap-login__captcha { margin-bottom: 18px; }
.aap-login .alert { border-radius: 7px; font-size: 14px; }

/* ---------- responsive ---------- */

@media (max-width: 991px) {
    /* Form first: a candidate on a phone wants to sign in, not scroll past
       the brand panel to find the fields. */
    .aap-login { flex-direction: column; }
    .aap-login__panel { order: 1; }
    .aap-login__brand { order: 2; }
    .aap-login__brand,
    .aap-login__panel { flex: 0 0 auto; max-width: 100%; width: 100%; }
    .aap-login__brand { padding: 44px 28px; }
    .aap-login__headline { font-size: 25px; }
    .aap-login__logo { width: 240px; }
    .aap-login__panel { padding: 40px 20px 44px 20px; min-height: 100vh; }
    .aap-login__brand { padding: 40px 28px 48px 28px; }
}

@media (max-width: 575px) {
    .aap-login__card { padding: 34px 24px 30px 24px; }
    .aap-login__title { font-size: 26px; }
    .aap-login__features { flex-direction: column; gap: 22px; }
    .aap-login__feature { border-left: none; padding: 0; text-align: left; display: flex; gap: 14px; align-items: flex-start; }
    .aap-login__feature i { margin-bottom: 0; font-size: 22px; line-height: 1.2; }
}

/* A site using its own square logo rather than a wide wordmark: cap the size
   and give it a light plate so a dark logo stays visible on the dark panel. */
.aap-login__logo:not([src*="wordmark"]) {
    width: auto !important;
    max-width: 150px !important;
    max-height: 110px;
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
}
