/* ===========================================================================
   GRAYBRIDGE AUTH PAGES
   Sign in, sign up, forgot password, password recovery and 2FA.
   Dark brand panel on the left, off-white page on the right, the form in a white card (.auth-form).
   Loaded after style.css by layout/login.php, so it overrides the theme's auth rules.
   =========================================================================== */

.gb-auth-body {
    --gba-blue: #0088cc;
    --gba-button: #0077b6;
    --gba-button-hover: #005f91;
    --gba-link: #00689c;
    --gba-link-hover: #004a70;
    --gba-ink: #1c1c1c;
    --gba-text-2: #3d3d3d;
    --gba-muted: #5a5a5a;
    --gba-faint: #707070;          /* placeholders: was #888888 (3.5:1), now 5.0:1 on white */
    --gba-line: #e8e8e8;
    --gba-input: #8a8a8a;          /* field borders: was #bfc5cc (1.7:1); a field's edge needs 3:1 (1.4.11); now 3.5:1 */
    --gba-page: #f1f1f1;
    --gba-white: #ffffff;
    --gba-aside: #1c1c1c;
    --gba-aside-text: #c9c9c9;
    --gba-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
    --gba-sans: "Outfit", "Helvetica Neue", Helvetica, sans-serif;

    margin: 0;
    background: var(--gba-page);
    font-family: var(--gba-sans);
    color: var(--gba-ink);
}

/* ---------------------------------------------------------------------------
   Page split
   --------------------------------------------------------------------------- */

.gb-auth {
    display: grid;
    grid-template-columns: minmax(380px, 46%) 1fr;
    min-height: 100vh;
}

.gb-auth-aside {
    display: flex;
    flex-direction: column;
    padding: 56px 56px 44px;
    background: var(--gba-aside);
    border-top: 6px solid var(--gba-blue);
    color: var(--gba-white);
}

.gb-auth-logo {
    display: inline-block;
    align-self: flex-start;
}

.gb-auth-logo img {
    display: block;
    width: 200px;
    height: auto;
}

.gb-auth-pitch {
    margin: auto 0;
    padding: 48px 0;
    max-width: 440px;
}

.gb-auth-rule {
    display: block;
    width: 56px;
    height: 4px;
    margin-bottom: 26px;
    background: var(--gba-blue);
}

.gb-auth-headline {
    margin: 0 0 22px;
    font-family: var(--gba-serif);
    font-size: 36px;
    line-height: 1.22;
    color: var(--gba-white);
}

.gb-auth-headline span {
    color: #2aa3e0; /* 6:1 on the dark panel; --gba-blue is 4.4:1, too low once the headline shrinks on phones */
}

.gb-auth-aside-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--gba-aside-text);
}

.gb-auth-site {
    font-size: 14px;
    font-weight: 600;
    color: var(--gba-white);
}

.gb-auth-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: var(--gba-page);
}

/* ---------------------------------------------------------------------------
   The white card
   --------------------------------------------------------------------------- */

.gb-auth-body .auth-form {
    width: 100%;
    max-width: 460px;
    padding: 40px 44px 36px;
    background: var(--gba-white);
    border: 1px solid var(--gba-line);
    border-radius: 0;
    box-shadow: none;
}

.gb-auth-body .auth-form-wide {
    max-width: 640px;
}

.gb-auth-title {
    margin: 0 0 6px;
    font-family: var(--gba-serif);
    font-size: 34px;
    font-weight: 400;
    line-height: 1.15;
    color: var(--gba-ink);
}

.gb-auth-lede {
    margin: 0 0 28px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--gba-muted);
}

/* ---------------------------------------------------------------------------
   Fields
   --------------------------------------------------------------------------- */

.gb-auth-body .auth-form .form-group {
    margin-bottom: 20px;
}

.gb-auth-body .auth-form label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gba-ink);
}

.gb-auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.gb-auth-label-row a {
    margin-bottom: 7px;
    font-size: 14px;
}

.gb-auth-body .auth-form a:not(.btn) {
    color: var(--gba-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gb-auth-body .auth-form a:not(.btn):hover,
.gb-auth-body .auth-form a:not(.btn):focus {
    color: var(--gba-link-hover);
}

.gb-auth-body .auth-form .form-control {
    height: 48px;
    padding: 10px 14px;
    font-size: 15px;
    color: var(--gba-ink);
    background: var(--gba-white);
    border: 1px solid var(--gba-input);
    border-radius: 0;
    box-shadow: none;
}

.gb-auth-body .auth-form .form-control::placeholder {
    color: var(--gba-faint);
}

.gb-auth-body .auth-form .form-control:focus {
    border-color: var(--gba-blue);
    /* Solid ring: the old 18% tint was too faint to find the focused field (2.4.7) */
    box-shadow: 0 0 0 2px var(--gba-button);
    outline: 0;
}

/* Keyboard focus on links and buttons */
.gb-auth-body a:focus-visible,
.gb-auth-body button:focus-visible,
.gb-auth-body .btn:focus-visible {
    outline: 2px solid var(--gba-button);
    outline-offset: 2px;
    box-shadow: none;
}

.gb-auth-body .gb-auth-aside a:focus-visible {
    outline-color: var(--gba-white);
}

/* Skip link, when the auth layout has one */
.gb-auth-body .gb-skip-link {
    position: absolute;
    left: 8px;
    top: -200px;
    z-index: 10000;
    padding: 10px 16px;
    background: var(--gba-ink);
    color: var(--gba-white);
    font-weight: 600;
    text-decoration: none;
}

.gb-auth-body .gb-skip-link:focus {
    top: 8px;
}

/* The skip link's target: focusable, but no ring on the whole column */
.gb-auth-body .gb-auth-main:focus {
    outline: none;
}

/* Show/hide password: a quiet button joined to the field */
.gb-auth-body .auth-form .input-group-append .btn {
    height: 48px;
    padding: 0 14px;
    color: var(--gba-muted);
    background: var(--gba-white);
    border: 1px solid var(--gba-input);
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
}

.gb-auth-body .auth-form .input-group-append .btn:hover,
.gb-auth-body .auth-form .input-group-append .btn:focus {
    color: var(--gba-ink);
    background: var(--gba-page);
}

.gb-auth-body .auth-form .input-group .form-control:focus + .input-group-append .btn {
    border-color: var(--gba-blue);
}

/* Checkbox */
.gb-auth-body .auth-form .gb-check,
.gb-check {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 4px 0 24px;
    font-weight: 400 !important;
    cursor: pointer;
}

.gb-check input {
    -webkit-appearance: none;
    appearance: none;
    position: static;
    width: 20px;
    height: 20px;
    margin: 0;
    flex: 0 0 20px;
    background: var(--gba-white) center / 14px 14px no-repeat;
    border: 1px solid var(--gba-input);
    border-radius: 2px;
    box-shadow: none;
    cursor: pointer;
}

/* The theme draws its own box with :after; switch it off here */
.gb-check input:after,
.gb-check input:checked:after {
    content: none;
    display: none;
}

.gb-check input:checked {
    background-color: var(--gba-button);
    border-color: var(--gba-button);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.2 3L13 4.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.gb-check input:focus-visible {
    outline: 2px solid var(--gba-blue);
    outline-offset: 2px;
}

.gb-check span {
    font-size: 14px;
    color: var(--gba-text-2);
}

/* Primary button */
.gb-auth-body .auth-form .btn-access {
    height: 52px;
    font-size: 15px;
    font-weight: 700;
    color: var(--gba-white);
    background: var(--gba-button);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.gb-auth-body .auth-form .btn-access:hover,
.gb-auth-body .auth-form .btn-access:focus {
    color: var(--gba-white);
    background: var(--gba-button-hover);
}

/* A link styled as the primary button ("Go to sign in"): same look, no link underline */
.gb-auth-body .auth-form a.btn-access {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.gb-auth-body .auth-form .btn-access:focus-visible {
    outline: 2px solid var(--gba-ink);
    outline-offset: 2px;
}

/* Error text under a field (theme and CodeIgniter validation) */
.gb-auth-body .invalid-feedback,
.gb-auth-body .text-danger {
    color: #b3261e !important;   /* 6.5:1 on white */
}

@media (prefers-reduced-motion: reduce) {
    .gb-auth-body *,
    .gb-auth-body *::before,
    .gb-auth-body *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.gb-auth-captcha {
    margin: 0 0 20px;
}

.gb-auth-wait {
    margin: 12px 0 0;
    font-size: 14px;
    color: var(--gba-link);
}

/* Social sign-in buttons, when any are switched on */
.gb-auth-oauth {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.gb-auth-oauth .btn {
    border-radius: 0;
}

/* Footer under the form: "New to Graybridge?", "Back to sign in" */
.gb-auth-footer {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--gba-line);
}

.gb-auth-footer-title {
    margin-bottom: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gba-ink);
}

.gb-auth-footer p {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--gba-text-2);
}

/* ---------------------------------------------------------------------------
   Sign up: two columns of fields
   --------------------------------------------------------------------------- */

.gb-auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
}

.gb-auth-grid-full {
    grid-column: 1 / -1;
}

.gb-auth-body .iti {
    display: block;
    width: 100%;
}

.gb-auth-terms {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 4px 0 24px;
}

.gb-auth-body .auth-form .gb-auth-terms .gb-check,
.gb-auth-terms .gb-check {
    margin: 0;
}

.gb-auth-terms a {
    font-size: 14px;
}

/* ---------------------------------------------------------------------------
   2FA: six single-digit boxes
   --------------------------------------------------------------------------- */

.gb-otp {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.gb-auth-body .auth-form .gb-otp .form-control {
    height: 56px;
    padding: 0;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
}

/* ---------------------------------------------------------------------------
   Narrow screens: the brand panel becomes a short band above the form
   --------------------------------------------------------------------------- */

@media (max-width: 991px) {
    .gb-auth {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .gb-auth-aside {
        padding: 24px 24px 22px;
    }

    .gb-auth-logo img {
        width: 150px;
    }

    .gb-auth-pitch {
        padding: 20px 0 0;
        margin: 0;
    }

    .gb-auth-rule,
    .gb-auth-aside-text,
    .gb-auth-site {
        display: none;
    }

    .gb-auth-headline {
        margin: 0;
        font-size: 22px;
    }

    .gb-auth-main {
        min-height: calc(100vh - 160px);
        align-items: flex-start;
        padding: 32px 16px 48px;
    }
}

@media (max-width: 575px) {
    .gb-auth-body .auth-form {
        padding: 28px 20px 24px;
    }

    .gb-auth-title {
        font-size: 28px;
    }

    .gb-auth-grid {
        grid-template-columns: 1fr;
    }

    .gb-otp {
        gap: 6px;
    }
}

/* ---------------------------------------------------------------------------
   Free-read claim (sign up from the investor mailer)
   --------------------------------------------------------------------------- */

.gb-auth-hint {
    margin: -6px 0 18px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--gba-muted);
}

.gb-auth-steps {
    margin: 0 0 28px;
    padding-left: 20px;
    list-style: decimal;
    font-size: 15px;
    line-height: 1.55;
    color: var(--gba-text-2);
}

.gb-auth-steps li {
    display: list-item;
    margin-bottom: 8px;
    list-style: decimal outside;   /* style.css sets li { list-style: none } */
}

/* Legal links under the form (Privacy, Terms, How We Handle Your Data, Accessibility) */
.gb-auth-main { flex-direction: column; }
.gb-auth-legal { margin-top: 24px; max-width: 440px; text-align: center; font-size: 13px; line-height: 1.8; color: var(--gba-muted); }   /* 6.1:1 on #f1f1f1 */
.gb-auth-legal a { color: var(--gba-link); text-decoration: underline; }                                                              /* 5.3:1 on #f1f1f1 */
.gb-auth-legal a:hover { color: var(--gba-link-hover); }

/* Pop-up messages (toastr): larger and readable, they stay 30 seconds (toastAlert) */
#toast-container[class] > div { width: 380px; max-width: calc(100vw - 24px); font-size: 1rem; line-height: 1.45; opacity: 1; }
#toast-container[class] > div .toast-title { font-size: 1.1rem; }
#toast-container[class] > div .toast-message { font-size: 1rem; }
#toast-container[class] > div .toast-close-button { font-size: 1.5rem; width: 32px; height: 32px; opacity: 1; }
/* White text at 4.5:1 or better (WCAG 1.4.3); the theme's bright colors fall short */
#toast-container > .toast-error { background-color: #b3261e; }
#toast-container > .toast-success { background-color: #2e7d32; }
#toast-container > .toast-info { background-color: #1f5f8b; }
#toast-container > .toast-warning { background-color: #8a5300; }

/* Sign-in notice (email not confirmed yet): what to do, and a button for a new link */
.gb-auth-notice { border: 1px solid var(--gba-input); border-left: 4px solid var(--gba-button); background: var(--gba-white); color: var(--gba-ink); padding: 14px 16px; margin: 0 0 20px; border-radius: 4px; }
.gb-auth-notice p { margin: 0 0 10px; color: var(--gba-ink); }
