/*
    LoanGlass look for uSkinned's member pages: Login, Member Registration, Forgotten Password
    and Reset Password. Same tokens as the dashboards and the Rate Alerts page (Poppins,
    LoanGlass green, white rounded cards, pill buttons).

    Those forms are uSkinned's own views (Views/Partials/uSkinned/Forms/*), and every build copies
    uSkinned's files back over ours, so they're restyled from here instead of edited. It's CSS only:
    the fields, form posting, captcha, validation and return URLs are untouched.

    Everything is scoped to the four member forms (their own classes, or :has() for the page
    around them), so other forms, the header search and other pages are unaffected. Browsers
    without :has() get the styled form without the page card.

    Loaded from Views/Partials/MRMemberFormsHead.cshtml (included from USNMaster).
*/

/* ---------- tokens ---------- */
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form),
#site-content:has(.login-form, .register-form, .password-request-form, .password-reset-form) {
    --lgm-green: #2f9e44; --lgm-green-d: #166534; --lgm-green-l: #ebf8ee; --lgm-green-b: #cfe9d6;
    --lgm-ink: #14181f; --lgm-muted: #5b6472; --lgm-line: #e3e7ec; --lgm-field: #d5dbe2; --lgm-bg: #f5f7f9;
    --lgm-blue: #1a56db; --lgm-red: #b42318; --lgm-red-l: #fef3f2; --lgm-red-b: #fecdca;
}

/* ---------- page: grey backdrop, title banner ---------- */
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) {
    background: var(--lgm-bg);
    padding-top: 8px; padding-bottom: 64px;
}
/* Everything above the form (title banner, the login redirect block) shares the grey */
#site-content > section:has(~ section :is(.login-form, .register-form, .password-request-form, .password-reset-form)),
#site-content > section:has(~ section :is(.login-form, .register-form, .password-request-form, .password-reset-form)) .item {
    background: var(--lgm-bg);
}
#site-content:has(.login-form, .register-form, .password-request-form, .password-reset-form) > .usn_cmp_banner .info {
    padding-top: 40px; padding-bottom: 24px;
}
#site-content:has(.login-form, .register-form, .password-request-form, .password-reset-form) > .usn_cmp_banner .heading {
    font: 600 40px/1.15 Poppins, sans-serif; letter-spacing: -.6px; color: var(--lgm-ink) !important; text-transform: none; margin: 0;
}
/* The banner's small line ("Members") becomes a green pill above the title */
#site-content:has(.login-form, .register-form, .password-request-form, .password-reset-form) > .usn_cmp_banner .info:has(.secondary-heading) {
    display: flex; flex-direction: column-reverse; align-items: center;
}
#site-content:has(.login-form, .register-form, .password-request-form, .password-reset-form) > .usn_cmp_banner .secondary-heading {
    display: inline-flex; margin: 0 0 14px; padding: 6px 14px; border-radius: 999px;
    background: var(--lgm-green-l); color: var(--lgm-green-d) !important;
    font: 600 13px/1.2 Poppins, sans-serif; letter-spacing: 0; text-transform: none;
}

/* ---------- the centre column becomes one white card ---------- */
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) .content-col {
    position: relative; isolation: isolate;
    padding-top: 34px; padding-bottom: 30px;
}
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) .content-col::before {
    content: ""; position: absolute; z-index: -1; top: 0; bottom: 0;
    left: calc(var(--bs-gutter-x, 1.5rem) * .5); right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    background: #fff; border: 1px solid var(--lgm-line); border-radius: 24px;
    box-shadow: 0 1px 3px rgba(20,24,31,.05), 0 12px 32px rgba(20,24,31,.06);
}
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) .content-col > section {
    background: transparent; padding: 0 34px; margin: 0;
}
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) .content-col > section + section {
    margin-top: 22px;
}
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) .content-col > section .component-inner {
    padding: 0; margin: 0;
}

/* Text blocks in the card (the registration terms) */
#site-content > section:has(.register-form) .content-col > .usn_cmp_text .text {
    padding: 18px 20px; border-radius: 16px; background: var(--lgm-bg);
    font-size: 14px; line-height: 1.6; color: var(--lgm-muted);
}
#site-content > section:has(.register-form) .content-col > .usn_cmp_text .text :is(p, ul, li) { font-size: inherit; line-height: inherit; }
#site-content > section:has(.register-form) .content-col > .usn_cmp_text .text :is(strong, b) { color: var(--lgm-ink); font-weight: 600; }
#site-content > section:has(.register-form) .content-col > .usn_cmp_text .text a { color: var(--lgm-green-d); font-weight: 600; }
#site-content > section:has(.register-form) .content-col > .usn_cmp_text .text > :last-child { margin-bottom: 0; }

/* Google sign-in / register button under the form, with an "or" rule above it */
#site-content > section:has(.login-form, .register-form) .content-col > :is(.usn_cmp_mrgooglesignin, .usn_cmp_mrgoogleregister) .component-inner {
    display: flex; flex-direction: column; align-items: center;
}
#site-content > section:has(.login-form, .register-form) .content-col > :is(.usn_cmp_mrgooglesignin, .usn_cmp_mrgoogleregister) .component-inner::before {
    content: "or"; align-self: stretch; display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
    font-size: 13px; font-weight: 500; color: var(--lgm-muted);
    background: linear-gradient(var(--lgm-line), var(--lgm-line)) left center / calc(50% - 22px) 1px no-repeat,
                linear-gradient(var(--lgm-line), var(--lgm-line)) right center / calc(50% - 22px) 1px no-repeat;
    justify-content: center;
}
#site-content > section:has(.login-form, .register-form) .content-col > :is(.usn_cmp_mrgooglesignin, .usn_cmp_mrgoogleregister) br { display: none; }
#site-content > section:has(.login-form, .register-form) .content-col > :is(.usn_cmp_mrgooglesignin, .usn_cmp_mrgoogleregister) a {
    display: inline-block; max-width: 100%; border-radius: 999px; transition: transform .15s, box-shadow .15s;
}
#site-content > section:has(.login-form, .register-form) .content-col > :is(.usn_cmp_mrgooglesignin, .usn_cmp_mrgoogleregister) a img {
    /* the block's own markup has an inline width:300px; margin-left:30px */
    display: block; max-width: 100%; height: auto; margin-left: 0 !important;
}
#site-content > section:has(.login-form, .register-form) .content-col > :is(.usn_cmp_mrgooglesignin, .usn_cmp_mrgoogleregister) a:hover { transform: translateY(-1px); }

/* ---------- side panel ("Create an account" / "Your account") ---------- */
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp {
    border: 0; padding-top: 0;
}
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp-item {
    border: 0; margin-bottom: 16px;
}
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp-item > .inner {
    padding: 22px 22px 20px; border-radius: 20px; border: 1px solid var(--lgm-green-b);
    background: linear-gradient(160deg, #f1faf3 0%, #e3f4e8 100%);
    transition: box-shadow .15s, transform .15s;
}
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp-item > .inner:hover {
    box-shadow: 0 10px 24px rgba(22,101,52,.12); transform: translateY(-1px);
}
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp-item a { text-decoration: none; }
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp-item .heading {
    font: 600 19px/1.3 Poppins, sans-serif; letter-spacing: -.2px; color: var(--lgm-ink) !important; text-transform: none; margin: 0 0 2px;
}
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp-item .secondary-heading {
    font: 500 14px/1.4 Poppins, sans-serif; letter-spacing: 0; color: var(--lgm-muted) !important; text-transform: none; margin: 0 0 14px;
}
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp-item .link { margin: 0; }
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp-item .btn {
    display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border: 0; border-radius: 999px;
    background: var(--lgm-green); color: #fff; font: 600 14px/1 Poppins, sans-serif; text-transform: none; letter-spacing: 0;
    transition: background-color .15s;
}
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp-item .btn::after { content: "→"; margin-left: 8px; }
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp-item .btn > span { display: none; }
#site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp-item > .inner:hover .btn { background: var(--lgm-green-d); }

/* ---------- the form itself (works without :has) ---------- */
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) {
    font-family: Poppins, sans-serif; color: var(--lgm-ink);
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) > .inner {
    background: transparent; padding: 0; border: 0; box-shadow: none;
}

/* Heading and intro inside the form (Forgotten / Reset Password) */
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .info .heading {
    font: 600 26px/1.25 Poppins, sans-serif; letter-spacing: -.4px; color: var(--lgm-ink) !important; text-transform: none; text-align: left; margin: 0 0 6px;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .info .secondary-heading {
    font: 500 15px/1.4 Poppins, sans-serif; color: var(--lgm-muted) !important; text-transform: none; letter-spacing: 0;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .info .text {
    font-size: 15px; line-height: 1.6; color: var(--lgm-muted);
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .info { margin-bottom: 22px; }

/* Fields */
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .form-group {
    position: relative; margin-bottom: 18px;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .form-group:not(.checkbox) > .control-label {
    display: block; margin: 0 0 8px; font-size: 14px; font-weight: 600; line-height: 20px; color: var(--lgm-ink);
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) label em.req {
    font-style: normal; color: var(--lgm-green); margin-left: 2px;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .form-control:not([type="checkbox"]):not([type="radio"]) {
    height: 50px; min-height: 50px; padding: 0 16px;
    border: 1px solid var(--lgm-field); border-radius: 12px; background: #fbfcfd;
    font: 500 15px Poppins, sans-serif; color: var(--lgm-ink); box-shadow: none;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .form-control::placeholder { color: #98a1ad; opacity: 1; }
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .form-control:not([type="checkbox"]):hover {
    border-color: #aeb7c2; background: #fff;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .form-control:not([type="checkbox"]):focus {
    outline: none; border-color: var(--lgm-green); background: #fff; box-shadow: 0 0 0 4px rgba(47,158,68,.15) !important;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .form-control:not([type="checkbox"]):focus-visible {
    outline: none !important;
}
/* Room for the eye button in password fields */
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .form-group:has(.show-password) .form-control { padding-right: 52px; }

/* Validation */
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .form-control.input-validation-error:not([type="checkbox"]) {
    border-color: var(--lgm-red); background: #fff;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .form-control.input-validation-error:not([type="checkbox"]):focus {
    box-shadow: 0 0 0 4px rgba(180,35,24,.12) !important;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .field-validation-error {
    display: block; margin-top: 6px; padding: 0; background: none; font-size: 13px; font-weight: 500; color: var(--lgm-red);
}

/* Show / hide password (uSkinned positions it from the top of the field group) */
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .show-password {
    top: 29px; right: 1px; color: var(--lgm-muted);
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .show-password label span {
    width: 48px; height: 48px; border-radius: 0 11px 11px 0;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .show-password label i {
    top: 0; font-size: 20px; line-height: 48px;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .show-password label:hover { color: var(--lgm-green-d); }

/* "Keep me logged in" */
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .form-group.checkbox label {
    display: inline-flex; align-items: center; gap: 10px; padding-left: 0; margin: 0;
    font-size: 14px; font-weight: 500; color: var(--lgm-ink); cursor: pointer;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .form-group.checkbox input[type="checkbox"] {
    position: static; flex: none; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0;
    accent-color: var(--lgm-green); cursor: pointer;
}

/* Captcha widgets keep their own size; just give them room */
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .recaptcha { margin: 4px 0 18px; }

/* Submit button: full-width green pill */
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .buttons { margin-top: 6px; }
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .buttons .btn {
    display: flex; align-items: center; justify-content: center; width: 100%; height: 50px; padding: 0 22px;
    border: 0; border-radius: 999px; background: var(--lgm-green); color: #fff;
    font: 600 16px/1 Poppins, sans-serif; letter-spacing: 0; text-transform: none;
    box-shadow: 0 6px 16px rgba(47,158,68,.25); transition: background-color .15s, box-shadow .15s, transform .15s;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .buttons .btn > span { display: none; }
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .buttons .btn:hover {
    background: var(--lgm-green-d); color: #fff; box-shadow: 0 8px 20px rgba(22,101,52,.28); transform: translateY(-1px);
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .buttons .btn:focus-visible {
    outline: 3px solid var(--lgm-blue) !important; outline-offset: 2px !important;
}

/* "Forgot your password?" / "Return to login" */
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .return-link {
    margin: 16px 0 0; text-align: center; font-size: 14px;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .return-link a {
    color: var(--lgm-green-d); font-weight: 600; text-decoration: none;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .return-link a:hover { text-decoration: underline; }
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .note-recaptcha p {
    margin: 14px 0 0; font-size: 12px; line-height: 1.5; color: var(--lgm-muted); text-align: center;
}

/* Error / success messages */
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .alert {
    padding: 14px 16px; border-radius: 14px; font-size: 14px; line-height: 1.5;
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .alert :is(p, .info) { margin: 0; font-size: inherit; color: inherit; }
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .alert-danger {
    background: var(--lgm-red-l); border: 1px solid var(--lgm-red-b); color: var(--lgm-red);
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .alert-success {
    background: var(--lgm-green-l); border: 1px solid var(--lgm-green-b); color: var(--lgm-green-d);
}
.form:is(.login-form, .register-form, .password-request-form, .password-reset-form) .ajax-loading .message {
    font-size: 14px; color: var(--lgm-muted);
}

/* ---------- phones ---------- */
@media (max-width: 767.98px) {
    #site-content:has(.login-form, .register-form, .password-request-form, .password-reset-form) > .usn_cmp_banner .info {
        padding-top: 28px; padding-bottom: 16px;
    }
    #site-content:has(.login-form, .register-form, .password-request-form, .password-reset-form) > .usn_cmp_banner .heading { font-size: 30px; }
    #site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) .content-col {
        padding-top: 24px; padding-bottom: 24px;
    }
    #site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) .content-col::before { border-radius: 20px; }
    #site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) .content-col > section { padding: 0 20px; }
    #site-content > section:has(.login-form, .register-form, .password-request-form, .password-reset-form) :is(.left-col, .right-col) .swp { margin-top: 18px; }
}
