/**
 * Member portal login - split-screen layout.
 *
 * Structure and proportions follow the "Login Page Perfect UI" reference:
 * full-bleed wallpaper on the left, fixed-width form panel on the right,
 * labelled inputs on a soft grey fill, a toggle + forgot-password row, then
 * a primary action above a divided dark secondary action.
 *
 * Colours are P&I's, not the reference's: navy #2a2f75 and gold #f9cd1b come
 * straight out of pnim_logo.svg, and the primary action stays #005bc8 so this
 * page matches the /activate and /recover wizards it links to.
 *
 * Loaded after the theme style.min.css, so these rules win by cascade order -
 * several of them exist purely to undo the old centred-card treatment still
 * present under `body.customers_login` in style.css.
 */

:root {
    --login-navy: #2a2f75;
    --login-gold: #f9cd1b;
    --login-primary: #005bc8;
    --login-primary-dark: #0049a3;
    --login-ink: #1a1a1a;
    --login-label: #404040;
    --login-muted: #6b7280;
    --login-placeholder: #808080;
    --login-field: #f2f2f2;
    --login-dark: #333333;
    --login-radius: 8px;
}

/* Undo the dark radial card backdrop from style.css */
body.customers_login {
    background: #ffffff;
    color: var(--login-ink);
}

/* ============================================================
   Split shell
   ============================================================ */

/**
 * Pinned to the viewport rather than flowed inside #wrapper > #content > .container
 * > .row. The theme chain contributes stray vertical space on this page (white
 * bands above and below the shell), and the login screen is meant to own the whole
 * viewport anyway - taking it out of flow makes it immune to whatever chrome or
 * padding the theme wraps around it.
 *
 * .login-panel scrolls internally so a tall form (language selector + reCAPTCHA on
 * a short laptop screen) can never be clipped by the fixed height.
 */
.login-split {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 480px;
    width: 100%;
    overflow: hidden;
}

/* Belt and braces: kill any theme chrome that still occupies space here */
body.customers_login .header,
body.customers_login nav.navbar,
body.customers_login footer,
body.customers_login .footer {
    display: none !important;
}

body.customers_login #wrapper,
body.customers_login #content,
body.customers_login #content > .container,
body.customers_login #content > .container > .row {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
    min-height: 0 !important;
}

/* ── Wallpaper panel ───────────────────────────────────────── */

.login-visual {
    position: relative;
    background-color: var(--login-navy);
    /* ?v= is a manual cache-bust handle - bump it if the artwork is edited,
       since Cloudflare edge-caches this asset and CSS cannot call get_app_version() */
    background-image: url('../../../../images/login/marine-sunset.svg?v=1');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    padding: 56px;
    overflow: hidden;
}

.login-visual-copy {
    position: relative;
    max-width: 30ch;
    color: #ffffff;
}

.login-visual-eyebrow {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--login-gold);
}

.login-visual-headline {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
    text-shadow: 0 2px 18px rgba(10, 15, 42, .45);
}

.login-visual-sub {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .82);
    text-shadow: 0 1px 12px rgba(10, 15, 42, .45);
}

/* ── Form panel ────────────────────────────────────────────── */

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 48px 40px;
    overflow-y: auto;
}

.login-panel-inner {
    width: 100%;
    max-width: 384px;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

/* get_dark_company_logo() emits <center><a><img class="img-responsive"> */
.login-brand-mark,
.login-brand-mark center,
.login-brand-mark a {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.login-brand-mark img {
    height: 40px;
    width: auto;
    max-width: none;
}

.login-brand-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--login-ink);
}

.login-title {
    margin: 0 0 8px;
    font-size: 26px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--login-ink);
    text-transform: none;
}

.login-subtitle {
    margin: 0 0 28px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--login-muted);
}

/* Inline field errors. There is deliberately no validation_errors() summary on
   this form - see the note in login.php - so these are the only messages. */
.login-field-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: #c0392b;
}

body.customers_login .form-group.has-error .form-control {
    background: #fdf4f3;
    border-color: #e8b4ae;
}

body.customers_login .form-group.has-error .form-control:focus {
    background: #ffffff;
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, .14);
}

body.customers_login .form-group.has-error .login-label {
    color: #c0392b;
}

/* ============================================================
   Fields
   ============================================================ */

body.customers_login .form-group {
    text-align: left;
    margin-bottom: 16px;
}

/* style.css visually hides the login labels - the reference shows them */
.login-label {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0 0 6px;
    overflow: visible;
    clip: auto;
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--login-label);
}

body.customers_login .form-control {
    background: var(--login-field);
    border: 1px solid transparent;
    border-radius: var(--login-radius);
    padding: 12px 14px;
    height: auto;
    font-size: 15px;
    color: var(--login-ink);
    box-shadow: none;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

body.customers_login .form-control::placeholder {
    color: var(--login-placeholder);
}

body.customers_login .form-control:focus {
    background: #ffffff;
    border-color: var(--login-primary);
    box-shadow: 0 0 0 3px rgba(0, 91, 200, .16);
}

/* Language dropdown (bootstrap-select) matched to the inputs */
body.customers_login .bootstrap-select > .dropdown-toggle {
    background: var(--login-field);
    border: 1px solid transparent;
    border-radius: var(--login-radius);
    height: auto;
    padding: 12px 14px;
    font-size: 15px;
    color: var(--login-ink);
    box-shadow: none;
}

body.customers_login .bootstrap-select > .dropdown-toggle:focus {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 3px rgba(0, 91, 200, .16) !important;
    outline: none !important;
}

/* Password show/hide toggle */
.login-pwd-wrap {
    position: relative;
}

.login-pwd-wrap .form-control {
    padding-right: 44px;
}

.login-pwd-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 6px;
}

.login-pwd-toggle:hover {
    color: var(--login-primary);
}

.login-recaptcha {
    margin-bottom: 16px;
}

/* ============================================================
   Remember toggle + forgot link
   ============================================================ */

.login-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 22px;
}

.login-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}

.login-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.login-switch-track {
    position: relative;
    flex: 0 0 auto;
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #d8dade;
    transition: background-color .18s ease;
}

.login-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .28);
    transition: transform .18s ease;
}

.login-switch input:checked + .login-switch-track {
    background: var(--login-primary);
}

.login-switch input:checked + .login-switch-track::after {
    transform: translateX(16px);
}

.login-switch input:focus-visible + .login-switch-track {
    box-shadow: 0 0 0 3px rgba(0, 91, 200, .22);
}

.login-switch-text {
    font-size: 13px;
    color: var(--login-ink);
}

.login-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--login-primary);
}

.login-link:hover,
.login-link:focus {
    color: var(--login-primary-dark);
    text-decoration: underline;
}

/* ============================================================
   Actions
   ============================================================ */

body.customers_login .login-submit.btn-primary {
    display: block;
    width: 100%;
    padding: 13px 16px;
    border: 0;
    border-radius: var(--login-radius);
    background: var(--login-primary);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    transition: background-color .18s ease, box-shadow .18s ease;
}

body.customers_login .login-submit.btn-primary:hover,
body.customers_login .login-submit.btn-primary:focus {
    background: var(--login-primary-dark);
    box-shadow: 0 8px 18px rgba(0, 73, 163, .24);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: #9ca3af;
    font-size: 12px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.login-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--login-radius);
    background: var(--login-dark);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    transition: background-color .18s ease;
}

.login-secondary:hover,
.login-secondary:focus {
    background: #1f1f1f;
    color: #ffffff;
    text-decoration: none;
}

.login-secondary i {
    font-size: 13px;
    color: var(--login-gold);
}

.login-signup {
    margin: 18px 0 0;
    text-align: center;
    font-size: 13px;
    color: var(--login-muted);
}

.login-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 40px;
    font-size: 12px;
    line-height: 1.5;
    color: #9ca3af;
}

/* ============================================================
   Responsive - the reference drops the wallpaper on small screens
   ============================================================ */

@media (max-width: 1023px) {
    .login-split {
        grid-template-columns: 1fr;
    }

    .login-visual {
        display: none;
    }

    .login-panel {
        padding: 40px 24px;
    }

    .login-panel-inner {
        max-width: 400px;
    }

    .login-brand {
        margin-bottom: 32px;
    }
}

@media (max-width: 480px) {
    .login-panel {
        padding: 32px 20px;
    }

    .login-title {
        font-size: 23px;
    }

    .login-footer {
        margin-top: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.customers_login *,
    body.customers_login *::after {
        transition: none !important;
        animation: none !important;
    }
}
