/* HumanListening — auth screens (Login, Consent, Grants, etc.)
 * Plain CSS translation of the HumanListening Portal Design System (not the
 * marketing brand kit): Poppins for headings/buttons, Rubik for body copy,
 * bordered inputs with an always-elevated label. Colors are unchanged from
 * the brand kit - both systems share the same steel/mint palette - only
 * typography, control shape, and the input label treatment differ.
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700&family=Rubik:wght@400;500;600&display=swap');

:root {
    --hl-steel-700: #1b5c62;
    --hl-steel-800: #14474c;
    --hl-steel-900: #0e3a3e;
    --hl-steel-50: #eef4f4;
    --hl-mint-500: #44ac80;
    --hl-mint-100: #daf1e6;
    --hl-mint-700: #2f8a62;
    --hl-grey-900: #3b4747;
    --hl-grey-500: #7c8888;
    --hl-grey-300: #c3cbc9;
    --hl-grey-200: #dce0da;
    --hl-grey-100: #eaece6;
    --hl-grey-50: #f4f6f2;
    --hl-border-subtle: var(--hl-grey-200);
    --hl-border-default: var(--hl-grey-300);
    --hl-radius-md: 12px;
    --hl-radius-lg: 18px;
    /* Links match Portal (Material indigo 700, hover indigo 900). */
    --hl-link: #303f9f;
    --hl-link-hover: #1a237e;
}

.hl-shell {
    display: flex;
    flex-wrap: wrap;
    min-height: 100vh;
    font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--hl-grey-900);
}

/* .hl-main is the signed-in shell (_AppShellLayout), which has no .hl-shell wrapper - without
   it there, links fell back to browser defaults (underlined, purple once visited). */
.hl-shell a:not(.hl-btn),
.hl-main a:not(.hl-btn) {
    color: var(--hl-link);
    text-decoration: none;
}
.hl-shell a:not(.hl-btn):hover,
.hl-main a:not(.hl-btn):hover {
    color: var(--hl-link-hover);
    text-decoration: underline;
}

.hl-hero {
    flex: 1 1 600px;
    min-width: 320px;
    min-height: 320px;
    position: relative;
    /* Gradient layered over the photo (not replaced by it) so the logo/copy
       stay legible regardless of what's underneath - same reasoning as the
       Portal mockup's separate overlay div, done here as a second background
       layer instead, since that keeps this a pure CSS change. */
    background-image: linear-gradient(160deg, rgba(14,58,62,0.82) 0%, rgba(27,92,98,0.72) 55%, rgba(47,138,98,0.55) 100%), url('/images/login-hero-qual-portrait.jpg');
    background-size: cover;
    background-position: center;
    background-color: var(--hl-steel-900);
    color: #fff;
    padding: 48px 56px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
/* White lettering with the coloured mark ("HumanListening 1col White"), straight on the hero's
   dark overlay. align-self keeps it left-aligned: in this column flex container an image is
   otherwise stretched to the full width and the SVG draws centred inside it. */
.hl-hero__logo {
    display: block;
    align-self: flex-start;
    height: 56px;
    width: auto;
}
.hl-hero__copy {
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.hl-hero__copy h1 {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 28px;
    line-height: 1.25;
    color: #fff;
}
.hl-hero__copy p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255,255,255,0.88);
}
.hl-hero__footer {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
}

.hl-panel {
    flex: 999 1 560px;
    min-width: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    box-sizing: border-box;
}
.hl-panel__inner {
    width: 100%;
    max-width: 400px;
}
.hl-panel__inner--wide {
    max-width: 440px;
}

.hl-title {
    margin: 0 0 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 22px;
    color: var(--hl-grey-900);
}
.hl-subtitle {
    margin: 0 0 28px;
    font-size: 14px;
    color: var(--hl-grey-500);
}

.hl-field {
    position: relative;
    display: flex;
    flex-direction: column;
    margin-bottom: 18px;
}
.hl-field:last-child { margin-bottom: 0; }
/* In a form, the reserved error line under each field (hl-field-validation.js) plus the form's
   gap already separate fields - the margin on top of both left far too much space. */
.hl-form .hl-field { margin-bottom: 0; }
/* Label always sits elevated, notched into the border - never inside the
   field as a placeholder-like state, even when empty. The input keeps its
   own placeholder attribute, shown normally inside the field. The label's
   background must match whatever surface sits behind the field (white on
   every current .hl-field usage) so it visually interrupts the border. */
.hl-field label {
    position: absolute;
    top: -8px;
    left: 13px;
    z-index: 1;
    padding: 0 5px;
    background: #fff;
    font-family: 'Rubik', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: var(--hl-grey-500);
    pointer-events: none;
}
.hl-field input,
.hl-field select {
    width: 100%;
    box-sizing: border-box;
    font-family: 'Rubik', sans-serif;
    font-size: 15px;
    color: var(--hl-grey-900);
    background: #fff;
    border: 1.5px solid var(--hl-border-default);
    border-radius: 8px;
    padding: 13px 14px;
    outline: none;
    transition: border-color .14s, box-shadow .14s;
}
.hl-field input::placeholder { color: var(--hl-grey-300); }
/* On the grey signed-in pages, the notched label straddles grey (above the border) and the
   white input (below it) - split its background to match both halves. */
.hl-main .hl-field label { background: linear-gradient(to bottom, var(--hl-grey-50) 50%, #fff 50%); }
.hl-field input:focus,
.hl-field select:focus {
    border-color: var(--hl-steel-700);
    box-shadow: 0 0 0 3px rgba(27,92,98,0.15);
}
.hl-field .hl-hint {
    font-size: 12px;
    color: var(--hl-grey-500);
}
/* Always present (hl-field-validation.js adds an empty one to every field) with one line's
   height reserved, so a message appearing or clearing never shifts the page. */
.hl-field .hl-error {
    margin-top: 4px;
    min-height: 16px;
    font-size: 12px;
    font-weight: 500;
    line-height: 16px;
    color: #f44336;
}
.hl-field input.input-validation-error,
.hl-field select.input-validation-error {
    border-color: #f44336;
}

.hl-form { display: flex; flex-direction: column; gap: 18px; }

.hl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border: 1.5px solid transparent;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .14s, color .14s, border-color .14s;
    text-decoration: none;
}
.hl-btn--full { width: 100%; }
/* "Last used" tag sitting on the top edge of the sign-in option the user picked last time
   (LastSignInMethod) - outside the label, so the button's centred content doesn't shift. */
.hl-btn--lastused { position: relative; }
.hl-lastused {
    position: absolute;
    top: -9px;
    right: 12px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--hl-steel-700);
    color: #fff;
    font-family: 'Rubik', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    pointer-events: none;
}
/* Full width is the default for every button in the public auth flow
   (.hl-panel__inner - Login, Register, LoggedOut, etc.), matching the
   referenced design; .hl-btn--full stays defined above for any explicit
   use elsewhere. Scoped to .hl-panel__inner rather than every .hl-btn so
   the authenticated-page inline buttons (Manage/Grants' .hl-scope-row
   actions, under .hl-main__inner) keep their natural, content-sized width -
   those were never full width and making them so would break that layout. */
.hl-panel__inner .hl-btn { width: 100%; white-space: normal; }
/* Primary matches Portal: mint with black, all-caps label (black on mint-500 is ~7.6:1). */
.hl-btn--primary {
    background: var(--hl-mint-500);
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.hl-btn--primary:hover { background: var(--hl-mint-700); color: #000; }
.hl-btn--secondary { background: var(--hl-steel-50); color: var(--hl-steel-700); border-color: var(--hl-grey-100); }
.hl-btn--secondary:hover { background: var(--hl-grey-100); }
.hl-btn--outline { background: #fff; color: var(--hl-grey-900); border-color: var(--hl-border-default); }
.hl-btn--outline:hover { background: var(--hl-grey-50); }
.hl-btn--ghost { background: transparent; color: var(--hl-steel-700); border-color: transparent; }
.hl-btn--ghost:hover { background: var(--hl-steel-50); }
.hl-btn[disabled] { opacity: .45; cursor: not-allowed; }
.hl-btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }

.hl-field--locked { opacity: .55; pointer-events: none; }

.hl-btn--busy { cursor: wait; pointer-events: none; }
.hl-btn--busy::before {
    content: "";
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    animation: hl-spin .7s linear infinite;
}
@keyframes hl-spin { to { transform: rotate(360deg); } }

.hl-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0;
}
.hl-divider__line { flex: 1; height: 1px; background: var(--hl-border-default); }
.hl-divider__label { font-size: 12px; color: var(--hl-grey-500); }

.hl-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--hl-mint-100);
    color: var(--hl-mint-700);
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.hl-card {
    background: #fff;
    border: 1px solid var(--hl-border-subtle);
    border-radius: var(--hl-radius-lg);
    box-shadow: 0 2px 8px rgba(27,92,98,0.08);
    overflow: hidden;
}

.hl-scope-row {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hl-border-subtle);
}
.hl-scope-row:last-child { border-bottom: none; }
.hl-scope-row input[type="checkbox"] {
    margin-top: 3px;
    width: 17px;
    height: 17px;
    accent-color: var(--hl-steel-700);
    flex-shrink: 0;
}
.hl-scope-row__name { font-weight: 700; font-size: 14px; color: var(--hl-grey-900); }
.hl-scope-row__desc { font-size: 13px; color: var(--hl-grey-500); margin-top: 2px; }

.hl-eyebrow {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hl-steel-700);
    margin-bottom: 10px;
}

.hl-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--hl-grey-900);
    cursor: pointer;
}
.hl-checkbox-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--hl-steel-700);
}

.hl-footnote {
    margin: 0;
    padding-top: 20px;
    border-top: 1px solid var(--hl-border-subtle);
    font-size: 13px;
    line-height: 1.6;
    color: var(--hl-grey-500);
    text-align: center;
}

.hl-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.hl-icon-circle--success { background: var(--hl-mint-100); color: var(--hl-mint-700); }
.hl-icon-circle--warning { background: #fff1b5; color: #e0a83c; }
.hl-icon-circle--danger { background: #fbe3dc; color: #d2603c; }
.hl-icon-circle--neutral { background: var(--hl-steel-50); color: var(--hl-steel-700); }

/* ── App-shell header (authenticated pages: Manage*, Grants, ShowClaims) ── */
.hl-appheader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    border-bottom: 1px solid var(--hl-border-subtle);
    background: #fff;
    box-sizing: border-box;
}
.hl-appheader__logo { height: 36px; width: auto; }
.hl-appheader__home { display: flex; align-items: center; }
.hl-appheader__right { display: flex; align-items: center; gap: 16px; }
.hl-appheader__email { font-size: 14px; color: var(--hl-grey-900); }

.hl-usermenu { position: relative; }
.hl-usermenu__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: none;
    border: 1.5px solid transparent;
    border-radius: var(--hl-radius-md);
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    color: var(--hl-grey-900);
    cursor: pointer;
}
.hl-usermenu__trigger:hover,
.hl-usermenu.is-open .hl-usermenu__trigger { background: var(--hl-grey-50); border-color: var(--hl-border-subtle); }
.hl-usermenu__caret { transition: transform .14s; }
.hl-usermenu.is-open .hl-usermenu__caret { transform: rotate(180deg); }

.hl-usermenu__panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--hl-border-subtle);
    border-radius: var(--hl-radius-md);
    box-shadow: 0 8px 24px rgba(14, 58, 62, .12);
    padding: 6px;
    z-index: 20;
}
.hl-usermenu.is-open .hl-usermenu__panel { display: block; }

.hl-usermenu__item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: none;
    background: none;
    border-radius: var(--hl-radius-md);
    font-family: 'Rubik', sans-serif;
    font-size: 14px;
    text-align: left;
    color: var(--hl-grey-900);
    cursor: pointer;
    text-decoration: none;
}
.hl-usermenu__item:hover { background: var(--hl-grey-50); }
.hl-usermenu__divider { height: 1px; background: var(--hl-border-subtle); margin: 6px 4px; }

.hl-main {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 48px 24px;
    box-sizing: border-box;
    background: var(--hl-grey-50);
    /* header height: 36px logo + 2 x 16px padding + 1px border */
    min-height: calc(100vh - 69px);
}
.hl-main__inner { width: 100%; max-width: 640px; }
.hl-main__inner--narrow { max-width: 400px; }

/* ── Authenticator app setup + recovery codes ── */
.hl-steps { list-style: none; counter-reset: hl-step; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 24px; }
.hl-steps > li { counter-increment: hl-step; position: relative; padding-left: 40px; }
.hl-steps > li::before {
    content: counter(hl-step);
    position: absolute; left: 0; top: 0;
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--hl-steel-50); color: var(--hl-steel-700);
    font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 13px;
}
.hl-steps__title { font-weight: 600; color: var(--hl-grey-900); margin-bottom: 4px; line-height: 26px; }
.hl-steps__desc { font-size: 14px; color: var(--hl-grey-500); }
.hl-qr { display: inline-block; margin-top: 14px; padding: 10px; background: #fff; border: 1px solid var(--hl-border-subtle); border-radius: 8px; line-height: 0; }
.hl-qr svg { width: 184px; height: 184px; display: block; }
.hl-key { font-family: ui-monospace, monospace; font-size: 14px; color: var(--hl-grey-900); background: #fff; border: 1px solid var(--hl-border-subtle); border-radius: 6px; padding: 3px 8px; word-break: break-all; }
.hl-recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; font-family: ui-monospace, monospace; font-size: 15px; color: var(--hl-grey-900); }
@media (max-width: 420px) { .hl-recovery-codes { grid-template-columns: 1fr; } }
.hl-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.hl-actions form { margin: 0; }

/* Settings rows (Manage/Index): description left, actions pinned right; the actions drop
   below the text on narrow screens but stay right-aligned. */
.hl-setting-row { align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; }
.hl-setting-row__text { flex: 1 1 240px; min-width: 0; }
.hl-setting-row .hl-actions { margin-left: auto; }
.hl-setting-row__note { font-size: 13px; color: var(--hl-grey-500); }
.hl-setting-row__error { font-size: 13px; font-weight: 600; color: #f44336; }

/* Newer / Page N / Older pager (Sign-in history). */
.hl-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.hl-pager__page { font-size: 13px; color: var(--hl-grey-500); }

/* Inline "Rename" for a passkey - a native <details>, so it needs no script. */
.hl-rename { margin-top: 6px; }
.hl-rename summary {
    display: inline;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--hl-steel-800);
    list-style: none;
}
.hl-rename summary::-webkit-details-marker { display: none; }
.hl-rename summary:hover { text-decoration: underline; }
.hl-rename__form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hl-rename__form input[type="text"] {
    flex: 1 1 180px;
    min-width: 0;
    padding: 9px 12px;
    border: 1.5px solid var(--hl-border-default);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
}
.hl-rename__form .hl-btn { padding: 8px 16px; font-size: 14px; }

/* ── password-validator.js support ──
 * That script swaps these classes and the ✓/✕ character on the requirement-checklist
 * icons (#changePasswordInstructionN). Plain characters - no icon font needed. */
.hl-rule-icon {
    display: inline-block;
    width: 1.1em;
    margin-right: 6px;
    font-weight: 700;
    text-align: center;
}
.hl-rule-icon--unmet { color: #d2603c; }
.hl-rule-icon--met { color: var(--hl-mint-700); }
.hl-password-rules { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--hl-grey-500); background: var(--hl-grey-50); border-radius: var(--hl-radius-md); padding: 14px 16px; }
.hl-password-rules__title { font-size: 12px; font-weight: 700; color: var(--hl-grey-900); margin-bottom: 2px; }
