/* QGabarito | Navegação Global Hierárquica V1 | 2026-09-13 */
:root {
    --qgs-topbar-height: 80px;
    --qgs-logo-width: 205px;
    --qgs-navy: #002f73;
    --qgs-blue: #1478ff;
    --qgs-page: #ffffff;
    --qgs-surface: #ffffff;
    --qgs-surface-soft: #f5f8fc;
    --qgs-footer: #fbfcfe;
    --qgs-text-strong: #12213b;
    --qgs-text: #5f6f86;
    --qgs-nav: #35465d;
    --qgs-line: #e5ebf3;
    --qgs-line-strong: #dfe7f0;
    --qgs-logo-primary: #073b7a;
    --qgs-logo-muted: #b8c7da;
    --qgs-primary: #002f73;
    --qgs-primary-hover: #002963;
    --qgs-primary-soft: #f5f8fd;
    --qgs-primary-soft-hover: #eef4fc;
    --qgs-primary-soft-border: #ccdaf0;
    --qgs-shadow: 0 18px 46px rgba(15, 35, 65, .14);
}

html[data-theme="dark"] {
    --qgs-page: #0b1120;
    --qgs-surface: #1e293b;
    --qgs-surface-soft: #111827;
    --qgs-footer: #0f172a;
    --qgs-text-strong: #f1f5f9;
    --qgs-text: #cbd5e1;
    --qgs-nav: #dbeafe;
    --qgs-line: #334155;
    --qgs-line-strong: #475569;
    --qgs-logo-primary: #dbeafe;
    --qgs-logo-muted: #64748b;
    --qgs-primary: #2563eb;
    --qgs-primary-hover: #3b82f6;
    --qgs-primary-soft: #172033;
    --qgs-primary-soft-hover: #1e293b;
    --qgs-primary-soft-border: #475569;
    --qgs-shadow: 0 18px 48px rgba(0, 0, 0, .34);
}

[data-qg-primary-modules],
[data-qg-secondary-modules] {
    display: none !important;
}

.qg-global-shell,
.qg-global-footer {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--qgs-text-strong);
    box-sizing: border-box;
}

.qg-global-shell *,
.qg-global-footer * {
    box-sizing: border-box;
}

.qg-global-shell {
    position: sticky;
    top: 0;
    z-index: 100000;
    width: 100%;
    height: var(--qgs-topbar-height);
    background: color-mix(in srgb, var(--qgs-surface) 96%, transparent);
    border-bottom: 1px solid var(--qgs-line);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.qg-global-shell__inner {
    width: min(1500px, calc(100% - 48px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 28px;
}

.qg-shell-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none !important;
    color: var(--qgs-logo-primary) !important;
}

.qg-shell-brand-logo {
    display: block;
    width: var(--qgs-logo-width);
    height: auto;
    overflow: visible;
}

.qg-shell-logo-primary,
.qg-shell-logo-wordmark {
    color: var(--qgs-logo-primary);
    fill: currentColor;
}

.qg-shell-logo-muted {
    color: var(--qgs-logo-muted);
}

.qg-shell-public-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.qg-shell-public-nav a {
    color: var(--qgs-nav) !important;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
}

.qg-shell-public-nav a:hover,
.qg-shell-public-nav a:focus-visible {
    color: var(--qgs-primary) !important;
}

.qg-shell-public-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.qg-shell-btn {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 22px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none !important;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.qg-shell-btn:hover { transform: translateY(-1px); }
.qg-shell-btn--soft,
.qg-shell-public-actions .qg-shell-btn--soft { color: #fff !important; border-color: var(--qgs-primary) !important; background: var(--qgs-primary) !important; }
.qg-shell-btn--soft:hover,
.qg-shell-public-actions .qg-shell-btn--soft:hover { background: var(--qgs-primary-hover) !important; border-color: var(--qgs-primary-hover) !important; }
.qg-shell-btn--primary,
.qg-shell-public-actions .qg-shell-btn--primary { color: #fff !important; border-color: var(--qgs-primary) !important; background: var(--qgs-primary) !important; }
.qg-shell-btn--primary:hover,
.qg-shell-public-actions .qg-shell-btn--primary:hover { background: var(--qgs-primary-hover) !important; border-color: var(--qgs-primary-hover) !important; }

.qg-shell-modules {
    position: relative;
    flex: 0 0 auto;
}

.qg-shell-modules-button,
.qg-shell-account-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid var(--qgs-primary-soft-border);
    border-radius: 10px;
    background: var(--qgs-surface);
    color: var(--qgs-text-strong);
    cursor: pointer;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    box-shadow: none;
}

.qg-shell-modules-button { padding: 0 14px; }
.qg-shell-modules-button:hover,
.qg-shell-modules-button:focus-visible,
.qg-shell-account-button:hover,
.qg-shell-account-button:focus-visible {
    border-color: color-mix(in srgb, var(--qgs-primary) 55%, var(--qgs-primary-soft-border));
    background: var(--qgs-primary-soft);
    outline: none;
}

.qg-shell-button-icon,
.qg-shell-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--qgs-primary);
}

.qg-shell-button-icon { width: 18px; height: 18px; }
.qg-shell-chevron { width: 14px; height: 14px; color: var(--qgs-text); }
.qg-shell-button-icon svg,
.qg-shell-chevron svg,
.qg-shell-runtime-action svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.qg-shell-menu-panel,
.qg-shell-account-panel {
    position: absolute;
    top: calc(100% + 12px);
    z-index: 100050;
    border: 1px solid var(--qgs-line);
    border-radius: 16px;
    background: var(--qgs-surface);
    color: var(--qgs-text-strong);
    box-shadow: var(--qgs-shadow);
}

.qg-shell-menu-panel {
    left: 0;
    width: min(680px, calc(100vw - 36px));
    padding: 22px;
}

.qg-shell-menu-panel[hidden],
.qg-shell-account-panel[hidden] { display: none !important; }

.qg-shell-menu-groups {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 24px;
}

.qg-shell-menu-group h2 {
    margin: 0 0 10px;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--qgs-line);
    color: var(--qgs-text);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.qg-shell-menu-links { display: grid; gap: 4px; }

.qg-shell-module-link {
    display: grid;
    gap: 2px;
    padding: 11px 12px;
    border-radius: 10px;
    color: var(--qgs-text-strong) !important;
    text-decoration: none !important;
    transition: background .15s ease;
}

.qg-shell-module-link:hover,
.qg-shell-module-link:focus-visible,
.qg-shell-module-link.is-active {
    background: var(--qgs-primary-soft);
    outline: none;
}

.qg-shell-module-link strong { font-size: 15px; line-height: 1.3; }
.qg-shell-module-link span { color: var(--qgs-text); font-size: 12.5px; line-height: 1.35; }
.qg-shell-module-link.is-active strong { color: var(--qgs-primary); }

.qg-shell-auth-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.qg-shell-runtime-slot { display: flex; align-items: center; }
.qg-shell-runtime-tools.theme-preference-row--global {
    width: auto !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    visibility: visible !important;
}

/* QG_APARENCIA_BINARIA_V1 */
.qg-shell-runtime-tools .qg-theme-toggle {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    font: inherit;
}
.qg-shell-runtime-tools .qg-theme-toggle--applying {
    opacity: .72;
    pointer-events: none;
}

.qg-shell-runtime-tools .qg-message-bell { order: 1; }
.qg-shell-runtime-tools .qg-notification-bell { order: 2; }
.qg-shell-runtime-tools .theme-preference,
.qg-shell-runtime-tools .qg-theme-toggle { order: 3; }

.qg-shell-runtime-tools .qg-theme-toggle[hidden] {
    display: none !important;
}

.qg-shell-runtime-tools .qg-message-bell,
.qg-shell-runtime-tools .qg-notification-bell,
.qg-shell-runtime-tools .theme-preference > summary,
.qg-shell-runtime-tools .qg-theme-toggle {
    position: relative;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid var(--qgs-line-strong) !important;
    border-radius: 10px !important;
    background: var(--qgs-surface) !important;
    color: var(--qgs-text) !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

.qg-shell-runtime-tools .qg-message-bell:hover,
.qg-shell-runtime-tools .qg-notification-bell:hover,
.qg-shell-runtime-tools .theme-preference > summary:hover,
.qg-shell-runtime-tools .qg-theme-toggle:hover,
.qg-shell-runtime-tools .qg-theme-toggle:focus-visible {
    background: var(--qgs-primary-soft) !important;
    border-color: var(--qgs-primary-soft-border) !important;
    color: var(--qgs-primary) !important;
}

.qg-shell-runtime-tools .qg-message-bell-icon,
.qg-shell-runtime-tools .qg-notification-bell-icon,
.qg-shell-runtime-tools .theme-preference-summary-icon,
.qg-shell-runtime-tools .qg-theme-toggle-icon {
    width: 19px !important;
    height: 19px !important;
    font-size: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.qg-shell-runtime-tools .qg-message-bell-icon svg,
.qg-shell-runtime-tools .qg-notification-bell-icon svg,
.qg-shell-runtime-tools .theme-preference-summary-icon svg,
.qg-shell-runtime-tools .qg-theme-toggle-icon svg {
    width: 19px !important;
    height: 19px !important;
    stroke: currentColor !important;
    stroke-width: 1.8 !important;
}

.qg-shell-runtime-tools .theme-preference > summary > span:last-of-type,
.qg-shell-runtime-tools .theme-preference > summary::after { display: none !important; }

.qg-shell-runtime-tools .theme-preference-panel {
    top: calc(100% + 10px) !important;
    right: 0 !important;
    left: auto !important;
    color: var(--qgs-text-strong) !important;
    background: var(--qgs-surface) !important;
    border-color: var(--qgs-line) !important;
}

.qg-shell-runtime-tools .qg-message-badge,
.qg-shell-runtime-tools .qg-notification-badge {
    border-color: var(--qgs-surface) !important;
}

.qg-shell-account { position: relative; }
.qg-shell-account-button { max-width: 230px; padding: 0 12px 0 8px; }
.qg-shell-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    background: var(--qgs-primary-soft);
    color: var(--qgs-primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .03em;
}
.qg-shell-account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qg-shell-account-panel {
    right: 0;
    width: min(310px, calc(100vw - 28px));
    padding: 12px;
}
.qg-shell-account-head { padding: 8px 9px 12px; display: grid; gap: 3px; }
.qg-shell-account-head strong { font-size: 14px; overflow-wrap: anywhere; }
.qg-shell-account-head span { color: var(--qgs-text); font-size: 12px; }
.qg-shell-account-links { display: grid; gap: 2px; }
.qg-shell-account-links a {
    padding: 10px 9px;
    border-radius: 9px;
    color: var(--qgs-text-strong) !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
}
.qg-shell-account-links a:hover,
.qg-shell-account-links a:focus-visible { background: var(--qgs-primary-soft); outline: none; }
.qg-shell-account-links--professional a { color: var(--qgs-primary) !important; }
.qg-shell-account-separator { height: 1px; margin: 8px 0; background: var(--qgs-line); }
.qg-shell-account-section-title { margin: 8px 9px 4px; color: var(--qgs-text); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.qg-shell-logout-form { margin: 0; padding: 0; }
.qg-shell-logout-form .qg-shell-logout {
    width: 100%;
    padding: 10px 9px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #b42318;
    text-align: left;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}
.qg-shell-logout-form .qg-shell-logout:hover,
.qg-shell-logout-form .qg-shell-logout:focus-visible { background: var(--qgs-primary-soft); outline: none; }
html[data-theme="dark"] .qg-shell-logout-form .qg-shell-logout { color: #fca5a5; }

html.qg-shell-mounted body > main > header.topbar,
html.qg-shell-mounted body > main > header.users-topbar,
html.qg-shell-mounted body > main > header.professor-topbar,
html.qg-shell-mounted body > main > header.editor-topbar,
html.qg-shell-mounted body > main > header.moderator-topbar,
html.qg-shell-mounted body > main > header.import-topbar,
html.qg-shell-mounted body > main > header.support-topbar,
html.qg-shell-mounted body > main > header.dup-topbar,
html.qg-shell-mounted body > main > header.editorial-topbar,
html.qg-shell-mounted body > main > header.taxonomy-topbar,
html.qg-shell-mounted body > main > header.permalink-topbar,
html.qg-shell-mounted body > main > header.critical-topbar,
html.qg-shell-mounted body > main > header.admin-topbar,
html.qg-shell-mounted body > main > header.administrator-topbar,
html.qg-shell-mounted body > main > header.qg-admin-topbar,
html.qg-shell-mounted body > main > header.admin-logs-topbar {
    display: none !important;
}

/* QG_GLOBAL_SHELL_SSR_PREPAINT_V1
 * O shell correto chega no HTML inicial; o chrome legado nunca participa do primeiro paint. */
html.qg-shell-ssr .qg-public-topbar { display: none !important; }
html.qg-shell-ssr body > .qg-global-shell { visibility: visible; }

html.qg-shell-home-auth .qg-public-topbar { display: none !important; }

.qg-global-footer {
    width: 100%;
    border-top: 1px solid var(--qgs-line);
    background: var(--qgs-footer);
}

.qg-global-footer__inner {
    width: min(1220px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 28px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    align-items: center;
}

.qg-global-footer__brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.qg-shell-brand--footer .qg-shell-brand-logo { width: 170px; }
.qg-global-footer__brand p { margin: 0; max-width: 560px; color: var(--qgs-text); font-size: 14px; line-height: 1.55; }
.qg-global-footer__nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px 22px; }
.qg-global-footer__nav a { color: var(--qgs-nav) !important; font-size: 14px; font-weight: 750; text-decoration: none !important; }
.qg-global-footer__nav a:hover { color: var(--qgs-primary) !important; }
.qg-global-footer__bottom {
    width: min(1220px, calc(100% - 48px));
    margin: 0 auto;
    padding: 18px 0 24px;
    border-top: 1px solid var(--qgs-line);
    color: var(--qgs-text);
    font-size: 13px;
}

@media (max-width: 900px) {
    .qg-global-shell__inner { width: min(100% - 28px, 1500px); gap: 14px; }
    .qg-shell-brand-logo { width: 175px; }
    .qg-shell-account-name { max-width: 120px; }
    .qg-shell-menu-panel { left: -150px; }
}

@media (max-width: 680px) {
    .qg-global-shell { height: 80px; }
    .qg-global-shell__inner { width: calc(100% - 20px); gap: 8px; }
    .qg-shell-brand-logo { width: 150px; }
    .qg-shell-modules-button { width: 42px; min-width: 42px; padding: 0; }
    .qg-shell-modules-button > span:not(.qg-shell-button-icon) { display: none; }
    .qg-shell-auth-actions { gap: 6px; }
    .qg-shell-runtime-tools.theme-preference-row--global { gap: 5px !important; }
    .qg-shell-runtime-tools .qg-message-bell,
    .qg-shell-runtime-tools .qg-notification-bell,
    .qg-shell-runtime-tools .theme-preference > summary,
    .qg-shell-runtime-tools .qg-theme-toggle { width: 40px !important; min-width: 40px !important; height: 40px !important; min-height: 40px !important; }
    .qg-shell-account-button { width: 42px; min-width: 42px; padding: 0; }
    .qg-shell-account-name,
    .qg-shell-account-button > .qg-shell-chevron { display: none; }
    .qg-shell-menu-panel { position: fixed; top: 86px; right: 10px; left: 10px; width: auto; max-height: calc(100vh - 100px); overflow: auto; }
    .qg-shell-menu-groups { grid-template-columns: 1fr; gap: 18px; }
    .qg-shell-account-panel { position: fixed; top: 86px; right: 10px; left: 10px; width: auto; max-height: calc(100vh - 100px); overflow: auto; }
    .qg-global-footer__inner { width: min(100% - 36px, 1220px); grid-template-columns: 1fr; align-items: flex-start; }
    .qg-global-footer__brand { align-items: flex-start; flex-direction: column; gap: 12px; }
    .qg-shell-brand--footer .qg-shell-brand-logo { width: 155px; }
    .qg-global-footer__nav { justify-content: flex-start; }
    .qg-global-footer__bottom { width: min(100% - 36px, 1220px); }
}

@media (max-width: 520px) {
    /* QG_SHELL_80PX_V1 — visitante também permanece em uma única barra de 80 px. */
    .qg-global-shell--public { height: 80px; }
    .qg-global-shell--public .qg-global-shell__inner { height: 100%; min-height: 0; padding: 0; flex-wrap: nowrap; gap: 6px; }
    .qg-global-shell--public .qg-shell-brand { width: auto; justify-content: flex-start; }
    .qg-global-shell--public .qg-shell-brand-logo { width: 118px; }
    .qg-global-shell--public .qg-shell-public-nav { display: none; }
    .qg-global-shell--public .qg-shell-public-actions { width: auto; margin-left: auto; gap: 6px; }
    .qg-global-shell--public .qg-shell-btn { flex: 0 0 auto; min-height: 40px; height: 40px; padding: 0 10px; font-size: 12px; }
    .qg-global-shell--auth .qg-shell-brand-logo { width: 132px; }
}

/* QG_AUTH_MODAL_PASSWORD_RECOVERY_V1 */

/* ======================================================================
   QG_AUTH_MODAL_GLOBAL_V1
   Entrar / Criar conta / 2FA em modal, preservando topbar e footer globais.
   ====================================================================== */

body.qg-auth-modal-open { overflow: hidden !important; }

.qg-auth-modal[hidden],
.qg-auth-view[hidden],
.qg-auth-recovery[hidden],
.qg-auth-alert[hidden],
.qg-auth-success[hidden] { display: none !important; }

.qg-auth-modal,
.qg-auth-modal * { box-sizing: border-box; }

.qg-auth-modal {
    position: fixed;
    inset: 0;
    z-index: 2147482000;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow-y: auto;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #0f172a;
}

.qg-auth-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 20, 39, .58);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.qg-auth-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 18px;
    box-shadow: 0 28px 72px rgba(4, 20, 44, .22), 0 7px 22px rgba(4, 20, 44, .10);
    outline: none;
}

.qg-auth-dialog__top {
    min-height: 66px;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid #e2e8f0;
}

.qg-auth-dialog__brand {
    grid-column: 2;
    justify-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #002f73 !important;
    font-size: 16px;
    font-weight: 850;
    letter-spacing: -.025em;
    text-decoration: none !important;
}

.qg-auth-dialog__brand .qg-shell-brand-logo {
    width: 122px;
}

.qg-auth-close {
    grid-column: 3;
    justify-self: end;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #536780;
    cursor: pointer;
}

.qg-auth-close:hover { background: #f1f5f9; color: #0f172a; }
.qg-auth-close:focus-visible { outline: 3px solid rgba(20, 120, 255, .18); outline-offset: 1px; }
.qg-auth-close svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.qg-auth-content {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 36px 32px 38px;
}

.qg-auth-content--mfa { max-width: 460px; }

.qg-auth-eyebrow {
    display: inline-block;
    margin: 0 0 12px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.qg-auth-title {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.qg-auth-description {
    margin: 0 0 28px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.qg-auth-alert {
    margin: -8px 0 20px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: 7px;
    background: #fef2f2;
    color: #991b1b;
    font-size: 13px;
    line-height: 1.45;
}

.qg-auth-success {
    margin: -8px 0 20px;
    padding: 10px 12px;
    border: 1px solid #bbf7d0;
    border-radius: 7px;
    background: #f0fdf4;
    color: #166534;
    font-size: 13px;
    line-height: 1.45;
}

.qg-auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.qg-auth-field label {
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.qg-auth-input-wrap { position: relative; display: flex; align-items: center; }

.qg-auth-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    background: #fff;
    color: #0f172a;
    font: inherit;
    font-size: 15px;
}

.qg-auth-input::placeholder { color: #7b8798; opacity: 1; }
.qg-auth-input:hover { border-color: #b8c7d8; }
.qg-auth-input:focus { border-color: #1b3a6b; box-shadow: 0 0 0 3px rgba(27, 58, 107, .15); }
.qg-auth-input--password { padding-right: 48px; }

.qg-auth-input--totp {
    height: 48px;
    padding: 0 16px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: .25em;
    text-align: center;
}

.qg-auth-input--totp::placeholder { letter-spacing: .15em; opacity: .5; font-weight: 400; }
.qg-auth-input--recovery { height: 42px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 14px; }

.qg-auth-help { margin-top: 2px; color: #64748b; font-size: 12px; line-height: 1.4; }

.qg-auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.qg-auth-password-toggle:hover { color: #0f172a; }
.qg-auth-password-toggle:focus-visible { outline: 2px solid rgba(20, 120, 255, .25); outline-offset: 1px; }
.qg-auth-password-toggle svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.qg-auth-eye { display: inline-flex; align-items: center; justify-content: center; }
.qg-auth-eye[hidden] { display: none !important; }

.qg-auth-submit {
    width: 100%;
    height: 44px;
    margin-top: 8px;
    margin-bottom: 24px;
    border: 0;
    border-radius: 6px;
    background: #1b3a6b;
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
}

.qg-auth-submit--mfa { height: 46px; margin-top: 4px; margin-bottom: 20px; }
.qg-auth-submit:hover { background: #132a4e; }
.qg-auth-submit:focus-visible { outline: 3px solid rgba(20, 120, 255, .22); outline-offset: 2px; }
.qg-auth-submit:disabled { opacity: .62; cursor: wait; }

.qg-auth-links { display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.qg-auth-links p, .qg-auth-cancel { margin: 0; color: #64748b; line-height: 1.45; }
.qg-auth-links a, .qg-auth-cancel a { color: #002f73 !important; font-weight: 550; text-decoration: none !important; }
.qg-auth-links a:hover, .qg-auth-cancel a:hover { text-decoration: underline !important; text-underline-offset: 3px; }

.qg-auth-recovery {
    margin: 0 0 24px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.qg-auth-recovery summary {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.qg-auth-recovery summary::-webkit-details-marker { display: none; }
.qg-auth-recovery-arrow { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.5; }
.qg-auth-recovery[open] .qg-auth-recovery-arrow { transform: rotate(90deg); }

.qg-auth-recovery-body {
    padding: 16px;
    border-top: 1px solid #cbd5e1;
    background: #f8fafc;
}

.qg-auth-recovery-body p { margin: 0 0 12px; color: #64748b; font-size: 13px; line-height: 1.4; }

.qg-auth-recovery-button {
    width: 100%;
    height: 40px;
    margin-top: 10px;
    border: 1px solid #1b3a6b;
    border-radius: 6px;
    background: transparent;
    color: #1b3a6b;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.qg-auth-recovery-button:hover { background: #1b3a6b; color: #fff; }
.qg-auth-cancel { text-align: left; font-size: 14px; }
.qg-auth-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }

/* Fallbacks diretos: mesmas dimensões dos modais, sem tocar topbar/footer globais. */
.qg-auth-fallback-main {
    width: 100%;
    min-height: min(690px, calc(100vh - var(--qgs-topbar-height)));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px 48px;
}

.qg-auth-fallback-card {
    width: 100% !important;
    max-width: 440px !important;
    margin: 0 !important;
    padding: 36px 32px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #0f172a !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,.05), 0 2px 4px -2px rgba(0,0,0,.05) !important;
}

.qg-auth-fallback-card--mfa { max-width: 460px !important; }
.qg-auth-fallback-card--wide { max-width: 520px !important; }
.qg-auth-dialog__top--fallback { margin: -18px -32px 28px; }
.qg-auth-close--link { text-decoration: none !important; }
.qg-auth-fallback-card--reset .qg-auth-help { margin: -12px 0 18px; }
.qg-auth-fallback-card--reset .qg-auth-links { margin-top: 0; }
.qg-auth-fallback-card .qg-auth-submit { margin-bottom: 20px; }
.qg-auth-fallback-card .qg-auth-links { margin-top: 0; }

@media (max-width: 600px) {
    .qg-auth-modal { padding: 14px; align-items: center; }
    .qg-auth-dialog { width: min(100%, 520px); max-height: calc(100vh - 28px); border-radius: 16px; }
    .qg-auth-dialog__top { min-height: 60px; padding: 0 14px; }
    .qg-auth-content, .qg-auth-content--mfa { max-width: none; padding: 30px 24px 32px; }
    .qg-auth-fallback-main { align-items: flex-start; min-height: 0; padding: 28px 16px 40px; }
    .qg-auth-fallback-card { padding: 30px 24px !important; }
    .qg-auth-dialog__top--fallback { margin: -14px -24px 24px; }
}


/* QG_TOPNAV_DISTRIBUIDA_V1 — navegação principal distribuída na barra inteira. */
.qg-global-shell__inner {
    width: calc(100% - 32px);
    max-width: none;
    margin: 0 16px;
    gap: 14px;
}
.qg-shell-primary-nav {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    gap: 4px;
}
.qg-shell-top-link {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--qgs-nav) !important;
    background: transparent;
    font-size: 12.5px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none !important;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.qg-shell-top-link:hover,
.qg-shell-top-link:focus-visible {
    color: var(--qgs-primary) !important;
    background: var(--qgs-primary-soft);
    border-color: var(--qgs-line);
    outline: none;
}
.qg-shell-top-link.is-active,
.qg-shell-top-link[aria-current="page"] {
    color: var(--qgs-primary) !important;
    background: var(--qgs-primary-soft);
    border-color: var(--qgs-primary-soft-border);
}
.qg-shell-auth-actions {
    margin-left: auto;
    flex: 0 0 auto;
}
.qg-shell-mobile-nav { display: none; }
.qg-shell-mobile-nav > summary {
    list-style: none;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid var(--qgs-line);
    border-radius: 6px;
    background: var(--qgs-surface);
    color: var(--qgs-text-strong);
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}
.qg-shell-mobile-nav > summary::-webkit-details-marker { display: none; }
.qg-shell-mobile-nav > nav {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 100050;
    width: min(320px, calc(100vw - 24px));
    padding: 8px;
    display: grid;
    gap: 4px;
    border: 1px solid var(--qgs-line);
    border-radius: 8px;
    background: var(--qgs-surface);
    box-shadow: var(--qgs-shadow);
}
.qg-shell-mobile-nav > nav .qg-shell-top-link {
    justify-content: flex-start;
    min-height: 38px;
    width: 100%;
}
@media (max-width: 1080px) {
    .qg-shell-primary-nav { display: none; }
    .qg-shell-mobile-nav { display: block; position: relative; flex: 0 0 auto; }
}
@media (max-width: 680px) {
    .qg-global-shell__inner { width: calc(100% - 20px); margin: 0 10px; gap: 8px; }
    .qg-shell-mobile-nav > summary { width: 40px; padding: 0; font-size: 0; }
    .qg-shell-mobile-nav > summary::before { content: "Menu"; font-size: 11px; }
}
