/* =============================================================================
   customloginpage.css — Login page styles
   ============================================================================= */

/* Use the same typeface as the MFA Provider Selection page so labels,
   inputs, and buttons share one font system across the auth screens. */
/* @import url('https://cdn.jsdelivr.net/npm/@fontsource/plus-jakarta-sans@5/index.css'); */

:root {
    --body-bg: #f7f7f8;
    --card-bg: #ffffff;
    --text: #2b2f33;
    --muted: #6a737d;
    --signup-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    /* Brand orange — darkened to meet WCAG AA 4.5:1 on white text.
       Base #B85410 = 4.89:1, hover #9E460D = 6.45:1. */
    --primary: #B85410;
    --primary-hover: #9E460D;
    --primary-light:       #fff3eb;
    --teal: #B85410;
    --teal-hover: #9E460D;
    --input-border: #d7dbe0;
    --input-focus: #B85410;
    --input-focus-shadow:  rgba(184, 84, 16, 0.25);
    --divider: #e6e8eb;
    /* Cancel / block button colours — overridden per brand in brand-*.css */
    --secondary-bg:        #646464;
    --secondary-bg-hover:  #4e4e4e;
    --secondary-text:      #ffffff;
    --secondary-border:    #646464;
    --radius: 8px;
    --shadow: 0 6px 20px rgba(0, 0, 0, .06);
}

html, body {
    height: 100%;
}

body {
    font-family: var(--signup-font);
    font-size: var(--bs-body-font-size);
    font-weight: var(--bs-body-font-weight);
    line-height: var(--bs-body-line-height);
    color: var(--bs-body-color);
    text-align: var(--bs-body-text-align);
    background-color: var(--bs-body-bg);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

/* ── Centering ── */
.mdc-top-app-bar--fixed-adjust {
    padding-top: 0 !important;
}

.fade-in.mdc-drawer-app-content.mdc-top-app-bar--fixed-adjust.bgimage {
    place-items: center;
    padding: 0;
}

#main-content.container-lg {
    width: 100%;
    display: block;
    box-sizing: border-box;
}

/* Override Bootstrap's container-lg max-width cap for body#cas pages
   (register / user profile) so the card fills the full 1000px wrapper.
   Switch from grid to block so Bootstrap's m-auto on the card doesn't
   fight justify-items and shrink the content. */
body#cas #main-content.container-lg {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: block !important;
}

body#cas #main-content > #content,
body#cas #main-content #content {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

#content {
    justify-content: center;
}

/* Outer wrapper (.mdc-card.p-4.m-auto.w-lg-100) — flattened so only the
   inner .login-card renders as the visible box. Strip background, shadow,
   border, radius, and the Bootstrap p-4 padding so there is no second
   outline around the login form. */
.mdc-card.p-4.m-auto,
.mdc-card.p-4.m-auto.w-lg-100 {
    width: 600px !important;
    max-width: 95vw !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* ── Login card ── */
.login-card,
#content .login-card {
    width: 100% !important;
    max-width: 100% !important;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: none;
    padding: 28px;
}

.login-card h2 {
    margin: 0 0 12px;
    font-weight: 600;
}

/* ── Fields ── */
.field {
    margin-top: 14px;
}

.field label {
    display: block;
    color: var(--muted);
    margin: 0 0 6px;
    font-family: var(--signup-font);
    font-weight: 400;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
    width: 300px;
    max-width: 100%;
    background: #fff;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    height: 52px;
    padding: 0 12px;
    font-family: var(--signup-font);
    transition: border-color .15s ease, box-shadow .15s ease;
}

body.password-reset-page .field input[type="password"] {
    width: 100%;
    box-sizing: border-box;
}

body.password-reset-page .mainlogincontent {
    max-width: 100%;
    padding: 0;
}

.field input[type="text"]::placeholder,
.field input[type="email"]::placeholder,
.field input[type="password"]::placeholder,
.field input[type="text"]::-webkit-input-placeholder,
.field input[type="email"]::-webkit-input-placeholder,
.field input[type="password"]::-webkit-input-placeholder,
.field input[type="text"]::-moz-placeholder,
.field input[type="email"]::-moz-placeholder,
.field input[type="password"]::-moz-placeholder,
.field input[type="text"]:-ms-input-placeholder,
.field input[type="email"]:-ms-input-placeholder,
.field input[type="password"]:-ms-input-placeholder,
.field input[type="text"]::-ms-input-placeholder,
.field input[type="email"]::-ms-input-placeholder,
.field input[type="password"]::-ms-input-placeholder {
    font-family: var(--signup-font) !important;
}

.field input:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px var(--input-focus-shadow);
}

/* ── Password show/hide toggle ── */
.password-container {
    position: relative;
}

/* Reserve space on the right ONLY when the eye toggle is actually rendered.
   When the LaunchDarkly flag `ep-100-show-and-hide-password` is OFF the
   button is not in the DOM, so the input keeps its full width and other
   right-side affordances (browser password manager, GlobalProtect, Keeper,
   1Password, etc.) can occupy that space without overlapping the value. */
.password-container:has(.password-toggle) input[type="password"],
.password-container:has(.password-toggle) input[type="text"] {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    border-radius: 6px;
}

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

.password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--input-focus-shadow);
    color: var(--primary);
}

.password-toggle svg {
    fill: currentColor;
    pointer-events: none;
}

/* ── Actions ── */
.actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    align-items: center;
}

.actions a {
    text-decoration: underline;
    text-underline-offset: 2px;
    color: var(--primary);
    font-family: var(--signup-font);
}

.actions a:hover,
.actions a:focus {
    color: var(--primary-hover);
    text-decoration: none;
}

.actions.reset-actions {
    width: 100%;
}

.actions.reset-actions .btn,
.actions.reset-actions .btn-link {
    flex: 1;
    min-width: 0;
    margin-top: 0;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    width: 100%;
    border: none;
    border-radius: 6px;
    height: 44px;
    font-family: var(--signup-font);
    font-weight: 400;
    font-size: 20px;
    letter-spacing: .2px;
    cursor: pointer;
    transition: background-color .15s ease, filter .15s ease;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    margin-top: 14px;
}
.btn-primary:hover { background: var(--primary-hover); }

/* ── Cancel / block button — colour driven by brand CSS variables ── */
.btn-cancel {
    background:       var(--secondary-bg);
    color:            var(--secondary-text);
    border:           1px solid var(--secondary-border);
    text-decoration:  none;
}
.btn-cancel:hover,
.btn-cancel:focus {
    background:   var(--secondary-bg-hover);
    color:        var(--secondary-text);
    border-color: var(--secondary-border);
    text-decoration: none;
}

.btn-link {
    background: #fff;
    border: 1px solid var(--divider);
    color: var(--text);
    font-family: var(--signup-font);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 16px;
    height: 44px;
    border-radius: 6px;
    margin-top: 14px;
    letter-spacing: .2px;
    transition: border-color .15s ease, background-color .15s ease;
}
.btn-link:hover {
    border-color: var(--input-focus);
    background-color: #fafafa;
    text-decoration: none;
}

.actions .btn,
.actions .btn-link {
    width: auto;
    min-width: 120px;
}

.btn-teal {
    text-decoration: none !important;
    font-family: var(--signup-font);
    background: var(--teal);
    color: #fff !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}
.btn-teal:hover {
    background: var(--teal-hover);
    color: #fff;
 }


/* ── Divider ── */
.divider {
    margin: 18px 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
    color: #80858b;
    font-family: var(--signup-font);
    font-size: 1.5rem;
}
.divider::before,
.divider::after {
    content: "";
    height: 2px;
    background: #d3d3d3;
    display: block;
}
.divider span {
    font-family: var(--signup-font);
    font-weight: 600;
    color: #7a7f86;
    font-size: 28px;
}
#login-form-controls {
    text-align: center;
    width: 80%;
    margin: 0 auto;
}

/* All login status/error/success messages stretch the full width of
   #login-form-controls (not just the error panel). Overrides the per-message
   max-width caps + auto side-margins so success and error banners align. */
#login-form-controls .logout-success,
#login-form-controls .login-success,
#login-form-controls .mfa-warning,
#login-form-controls .mfa-error-callout,
#login-form-controls .service-error-banner,
#login-form-controls .alert {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}
.mainlogincontent, #pmlinks {
    max-width: 330px;
    padding: 15px;
    margin: 0 auto;
}
#fm1 {
    padding-bottom: 0px;
}
#pmlinks {
    padding-top: 0px;
}
/* ── Validation ── */
.field-error {
    color: #c0392b;
    font-size: 0.78rem;
    margin-top: 4px;
    display: none;
}
.field.invalid input {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.15);
}
.field.invalid label {
    color: #c0392b;
}

.logout-success {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    background-color: #d9efe0;   /* light green background */
    border: 1px solid #9ed2b3;
    border-radius: 10px;

    color: #0f5132;              /* dark green text */
    font-size: 16px;
    font-weight: 400;

    padding: 15px 20px;
    margin: 20px auto;
    max-width: 600px;
}

.logout-success::before {
    content: "✔\FE0E";   /* unicode tick, FE0E forces plain-text (non-emoji) rendering */

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 26px;
    height: 26px;

    background-color: #198754; /* green circle */
    color: white;

    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
}

/* login-success: left-aligned text with wrapping, applied only to loginSuccess banner */
.login-success {
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-break: break-word;
}

.login-success::before {
    flex-shrink: 0;
    min-width: 26px;
    margin-top: 1px;
}

.login-success span {
    flex: 1;
    min-width: 0;
    display: block;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
}

.mfa-warning {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    background-color: #f8d7da;   /* light red background */
    border: 1px solid #f5c2c7;
    border-radius: 10px;

    color: #842029;              /* dark red text */
    font-size: 16px;
    font-weight: 400;

    padding: 15px 20px;
    margin: 20px auto;
    max-width: 600px;
}

.mfa-warning::before {
    content: "✕";

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 26px;
    height: 26px;

    background-color: #dc3545; /* red circle */
    color: white;

    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
}

/* ── Service-error banner (unauthorized / invalid service URL) ── */
.service-error-banner {
    margin: 1em 30px;
    padding: 12px 16px;
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
    color: #842029;
    font-size: 16px;
    font-weight: 400;
}

.service-error-icon::before {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1em;
    height: 1.1em;
    background-color: #343a40;
    color: #fff;
    border-radius: 50%;
    font-size: 0.72em;
    font-weight: 900;
    line-height: 1.1em;
    margin-right: 6px;
    vertical-align: middle;
}

/* ── MFA unavailable error callout (matches Figma "Select MFA method/error" design) ── */
.mfa-error-callout {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    background-color: #fff2f0;
    border: 1px solid #ffd6d1;
    border-radius: 8px;
    padding: 16px 24px;
    color: #233132;
    font-size: 16px;
    font-weight: 400;
    line-height: 22px;
    margin-bottom: 16px;
    text-align: left;
}

.mfa-error-callout::before {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background-color: #c0392b;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    margin-top: 1px;
}

.mfa-error-callout p {
    margin: 0;
    line-height: 22px;
}

.mfa-error-callout p + p {
    margin-top: 4px;
}

/* loginErrorsPanel uses inline icon + text so wrapped lines start flush left.
   Override flex layout and suppress the CSS ::before icon (icon is in HTML instead). */
#loginErrorsPanel {
    display: block;
}
#loginErrorsPanel::before {
    display: none;
}
#loginErrorsPanel .bi {
    margin-right: 6px;
    vertical-align: middle;
    color: #c0392b;
}

/* Strip underline from cancel buttons (grey button, not a text link) */
body.forgot-password-page .actions a.btn,
body.password-reset-page .actions a.btn {
    text-decoration: none !important;
}

/* Forgot password instruction paragraph is outside .mainlogincontent so it
   spans the full login-card width and stays on one line */
body.forgot-password-page .fp-instructions {
    max-width: 100%;
    width: 100%;
}

/* Forgot password: input box size 300 × 52 */
body.forgot-password-page .field input[type="text"],
body.forgot-password-page .field input[type="email"],
body.forgot-password-page .field input[type="password"] {
    width: 300px !important;
    max-width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
}

/* ── Forgot password: system-ui font stack (matches login / registration), 15.2px/400 body, Bootstrap heading sizes ── */
body.forgot-password-page,
body.forgot-password-page .login-card,
body.forgot-password-page .field label,
body.forgot-password-page .field input,
body.forgot-password-page .btn,
body.forgot-password-page p,
body.forgot-password-page a,
body.forgot-password-page span,
body.forgot-password-page div {
    font-family: var(--signup-font) !important;
    font-size: 16px !important;
    font-weight: 400 !important;
}

/* Headings: weight 500, Bootstrap standard sizes */
body.forgot-password-page h1 { font-family: var(--signup-font) !important; font-size: 36px !important; font-weight: 500 !important; }
body.forgot-password-page h2 { font-family: var(--signup-font) !important; font-size: 24px !important; font-weight: 500 !important; color: #53565A !important; }
body.forgot-password-page h3 { font-family: var(--signup-font) !important; font-size: 24px !important; font-weight: 500 !important; }
body.forgot-password-page h4 { font-family: var(--signup-font) !important; font-size: 18px !important; font-weight: 500 !important; }
body.forgot-password-page h5 { font-family: var(--signup-font) !important; font-size: 14px !important; font-weight: 500 !important; }
body.forgot-password-page h6 { font-family: var(--signup-font) !important; font-size: 12px !important; font-weight: 500 !important; }

/* Password-reset / set-password pages (Reset Password, Set Password headings)
   were missing heading colour — forgot-password-page h2 above has it, this didn't.
   Font-size/weight intentionally left alone: these pages use their own
   .reset-password-page-heading sizing (28px/300), unlike forgot-password's h2. */
body.password-reset-page h2 { color: #53565A !important; }

/* Paragraphs on the forgot-password page: bold */
body.forgot-password-page p { font-weight: 500 !important; color: #53565A !important;}

/* Cancel button: grey matching register page (#cancel style) */
body.forgot-password-page .btn-link,
body.forgot-password-page a.btn.btn-link,
body.password-reset-page .btn-link,
body.password-reset-page a.btn.btn-link,
body.validate-identity-page .btn-link,
body.validate-identity-page a.btn.btn-link {
    background: var(--secondary-bg) !important;
    border-color: var(--secondary-border) !important;
    color: var(--secondary-text) !important;
    box-shadow: none !important;
    text-decoration: none !important;
}
body.forgot-password-page .btn-link:hover,
body.forgot-password-page .btn-link:focus,
body.forgot-password-page a.btn.btn-link:hover,
body.forgot-password-page a.btn.btn-link:focus,
body.password-reset-page .btn-link:hover,
body.password-reset-page .btn-link:focus,
body.password-reset-page a.btn.btn-link:hover,
body.password-reset-page a.btn.btn-link:focus,
body.validate-identity-page .btn-link:hover,
body.validate-identity-page .btn-link:focus,
body.validate-identity-page a.btn.btn-link:hover,
body.validate-identity-page a.btn.btn-link:focus {
    background: var(--secondary-bg-hover) !important;
    border-color: var(--secondary-border) !important;
    color: var(--secondary-text) !important;
    text-decoration: none !important;
}

