/* APAS_VISUAL_PWA_V240. Carregado apenas nas views APAS. */
body.apas-login-v240, body.apas-app {
    --apas-primary: #176981; --apas-primary-dark: #104f64;
    --apas-navy: #123e50; --apas-navy-2: #184d60;
    --apas-muted: #627a86; --apas-border: #d9e5e9;
    --apas-bg: #f1f6f8; --apas-text: #1a3948;
    --apas-radius: 14px; --apas-red: #bd2b35;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.apas-login-v240 *, .apas-install-dialog * { box-sizing: border-box; }
.apas-login-v240 { margin: 0; background: #f4f7f9; color: #1a3948; min-height: 100vh; min-height: 100svh; }
.apas-login-v240 button, .apas-login-v240 input, .apas-login-v240 select { font: inherit; }
.apas-login-v240 button, .apas-install-dialog button { cursor: pointer; }
.apas-login-v240 a { color: #176981; }
.apas-login-v240 [hidden], .apas-app [hidden], .apas-install-dialog [hidden] { display: none !important; }
.apas-login-v240 svg, .apas-install-dialog svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.apas-login-v240 a:focus-visible, .apas-login-v240 button:focus-visible, .apas-app button:focus-visible, .apas-install-dialog button:focus-visible { outline: 3px solid #26849c; outline-offset: 4px; }
.apas-skip-link { position: fixed; left: 16px; top: -80px; z-index: 4000; padding: 12px; background: white; border-radius: 6px; }
.apas-skip-link:focus { top: 12px; }
.apas-public-header { display: flex; align-items: center; gap: 24px; width: 100%; padding: 15px max(32px, calc((100% - 1220px) / 2)); background: #fff; border-bottom: 1px solid #e2e9ed; }
.apas-public-header > a:first-child { display: flex; flex: 0 0 auto; }
.apas-public-header img { width: 144px; height: auto; display: block; }
.apas-header-context { border-left: 1px solid #dfe7ec; padding-left: 24px; display: grid; gap: 6px; font-size: 11px; color: #667c88; }
.apas-header-context strong { font-size: 14px; font-weight: 600; color: #204556; }
.apas-header-site { margin-left: auto; white-space: nowrap; font-size: 13px; font-weight: 600; text-decoration: none; }
.apas-header-site span { display: inline-block; margin-left: 12px; font-size: 19px; }
.apas-access-main { max-width: 1284px; margin: 0 auto; padding: 50px 32px 26px; }
.apas-access-card { display: grid; grid-template-columns: 1.07fr 1fr; background: #fff; border: 1px solid #dee8ee; border-radius: 24px; overflow: hidden; box-shadow: 0 18px 52px #143c5010; }
.apas-welcome { background: #e7f1f6; display: flex; flex-direction: column; min-width: 0; position: relative; }
.apas-welcome-copy { padding: 40px 46px 28px; position: relative; z-index: 1; }
.apas-eyebrow { color: #176981; letter-spacing: .14em; font-size: 10px; line-height: 1.6; font-weight: 700; margin: 0 0 17px; }
.apas-welcome-copy .apas-eyebrow { display: flex; align-items: center; gap: 10px; }
.apas-eyebrow > span { display: inline-block; width: 22px; height: 3px; background: #bd2b35; border-radius: 3px; }
.apas-welcome h2 { font-size: clamp(35px, 3.3vw, 48px); font-weight: 650; letter-spacing: -.045em; line-height: 1.12; margin: 0 0 16px; color: #133f54; }
.apas-welcome h2 em { font-style: normal; color: #1d718b; }
.apas-welcome-copy > p:last-child { color: #4b6a7a; font-size: 15px; line-height: 1.65; margin: 0; }
.apas-family-image { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; display: block; margin-top: auto; }
.apas-welcome-footer { display: flex; align-items: center; gap: 14px; background: #12556c; color: #cae1eb; font-size: 11px; line-height: 1.8; padding: 18px 36px; }
.apas-welcome-footer strong { font-size: 13px; font-weight: 500; color: #fff; }
.apas-welcome-heart { font: 38px/1 Arial,sans-serif; color: #fff; }
.apas-access-form-panel { padding: 44px 48px 32px; align-self: center; min-width: 0; }
.apas-access-intro { margin-bottom: 29px; }
.apas-access-intro .apas-eyebrow { margin-bottom: 10px; }
.apas-access-intro h1 { font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -.035em; margin: 0 0 12px; }
.apas-access-intro > p:last-child { font-size: 14px; line-height: 1.7; color: #667c88; margin: 0; }
.apas-access-form { display: grid; gap: 19px; }
.apas-access-field label { display: block; font-size: 12px; font-weight: 600; margin: 0 0 8px; color: #254553; }
.apas-access-field label > span { color: #697f8c; font-weight: 400; }
.apas-field-wrap { position: relative; }
.apas-field-icon { position: absolute; top: 17px; left: 15px; width: 19px; height: 19px; color: #76919e; pointer-events: none; }
.apas-access-field input, .apas-access-field select { display: block; width: 100%; min-width: 0; min-height: 53px; border: 1px solid #d3dfe5; border-radius: 9px; padding: 12px 15px 12px 44px; color: #213e4c; background: #fcfdfe; font-size: 14px; transition: border-color .15s, box-shadow .15s; }
.apas-access-field input::placeholder { color: #7a8d98; opacity: 1; }
.apas-access-field input:focus, .apas-access-field select:focus { border-color: #26849c; box-shadow: 0 0 0 3px #26849c18; outline: none; background: #fff; }
.apas-access-field select { padding-right: 30px; text-overflow: ellipsis; }
#apas_senha { padding-right: 49px; }
.apas-password-toggle { position: absolute; top: 5px; right: 5px; width: 43px; height: 43px; border: 0; border-radius: 6px; background: transparent; color: #718a97; display: grid; place-items: center; }
.apas-password-toggle:hover { background: #ebf3f6; }
.apas-password-toggle svg { width: 20px; height: 20px; }
.apas-password-toggle[aria-pressed="true"] { color: #bd2b35; }
.apas-access-submit { display: flex; align-items: center; justify-content: center; gap: 15px; width: 100%; min-height: 53px; margin-top: 5px; border: 1px solid #176981; border-radius: 9px; background: #176981; color: white; font-size: 14px !important; font-weight: 600 !important; transition: background .15s; }
.apas-access-submit:hover { background: #104f64; }
.apas-access-submit svg { width: 19px; height: 19px; }
.apas-access-submit:disabled { cursor: wait; opacity: .65; }
.apas-login-alert { border: 1px solid #e9c9cf; background: #fff2f3; color: #982833; border-radius: 9px; font-size: 13px; line-height: 1.6; padding: 12px 14px; margin: 0 0 17px; }
.apas-login-help { font-size: 11px; line-height: 1.8; text-align: center; color: #677c88; margin: 17px 0 25px; }
.apas-login-help a { font-weight: 600; text-decoration: none; white-space: nowrap; }
.apas-install-card { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid #dce7ed; background: #f5f9fb; border-radius: 12px; }
.apas-install-card img { flex: 0 0 auto; width: 43px; height: 43px; border: 1px solid #e0e8ed; border-radius: 10px; }
.apas-install-card > div { flex: 1; min-width: 0; }
.apas-install-card strong { display: block; font-size: 12px; font-weight: 650; line-height: 1.4; }
.apas-install-card p { font-size: 10px; color: #677f8c; margin: 5px 0 0; line-height: 1.4; }
.apas-install-card button { min-height: 42px; padding: 9px 10px; border: 1px solid #b9d1dd; background: #fff; color: #176981; border-radius: 7px; font-size: 11px; font-weight: 650; }
.apas-access-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: #708590; font-size: 10px; line-height: 1.6; margin: 21px 0 0; }
.apas-access-note svg { width: 15px; height: 15px; flex: 0 0 auto; }
.apas-public-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1284px; margin: 0 auto; padding: 0 36px 28px; color: #758894; font-size: 10px; line-height: 1.7; }
.apas-public-footer a { text-decoration: none; color: #667d8a; }
.apas-powered { white-space: nowrap; }
.apas-powered strong { color: #4d6c7d; font-style: italic; font-size: 13px; margin-left: 5px; }
/* Tema da área interna: conserva tabelas, menus e modais existentes. */
.apas-app .apas-sidebar { background: #123e50; }
.apas-app .apas-brand { min-height: 92px; background: white; border-bottom: 1px solid #dfebef; }
.apas-app .apas-brand-logo { width: 118px; }
.apas-app .apas-brand-product { color: #476977; border-color: #dce6ec; font-size: 10px; letter-spacing: 0; line-height: 1.6; font-weight: 500; }
.apas-app .apas-nav-item.active { background: #226981; box-shadow: none; }
.apas-app .apas-nav-section { color: #a2bfcc; }
.apas-app .apas-nav-item { color: #d7e6ed; }
.apas-app .apas-topbar { border-top: 3px solid #176981; }
.apas-app .apas-card { box-shadow: 0 5px 24px #143c5008; }
.apas-sidebar-install { display: block; width: 100%; border: 1px solid #6498ac; border-radius: 7px; background: #205469; color: #fff; min-height: 44px; font: inherit; font-size: 12px; margin-bottom: 12px; padding: 8px; }
/* Instruções de instalação: dialog nativo, foco contido e Escape. */
.apas-install-dialog { width: calc(100% - 32px); max-width: 425px; max-height: calc(100dvh - 40px); margin: auto; padding: 30px; border: 1px solid #dbe7ed; border-radius: 20px; box-shadow: 0 20px 75px #092b4940; background: #fff; color: #1a3948; font-family: "Segoe UI", Roboto, Arial, sans-serif; }
.apas-install-dialog::backdrop { background: #0c2a3f88; backdrop-filter: blur(3px); }
.apas-install-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; background: #f2f6f8; border-radius: 50%; color: #506b78; font-size: 25px; }
.apas-install-icon { border: 1px solid #dfe8ed; border-radius: 15px; margin-bottom: 20px; }
.apas-install-dialog .apas-eyebrow { margin-bottom: 9px; }
.apas-install-dialog h2 { font-size: 23px; letter-spacing: -.025em; margin: 0 0 14px; }
.apas-install-dialog p, .apas-install-dialog li { font-size: 14px; line-height: 1.65; }
.apas-install-dialog ol { padding-left: 22px; }
.apas-install-dialog li { margin-bottom: 9px; padding-left: 5px; }
.apas-install-dialog .apas-install-note { font-size: 12px; color: #667e8b; background: #f1f7fa; border-radius: 8px; padding: 12px; }
.apas-install-done { background: #176981; color: #fff; border: 0; border-radius: 8px; min-height: 46px; padding: 10px 20px; width: 100%; font: inherit; margin-top: 6px; }
@media (min-width: 1500px) {
    .apas-access-main { padding-top: 65px; }
}
@media (max-width: 1100px) and (min-width: 781px) {
    .apas-access-form-panel { padding: 35px 30px 28px; }
    .apas-welcome-copy { padding: 37px 33px 28px; }
    .apas-welcome-footer { padding: 17px 28px; }
    .apas-welcome-footer strong { font-size: 12px; }
    .apas-access-intro h1 { font-size: 25px; }
    .apas-header-context > span { max-width: 260px; }
    .apas-desktop-break { display: none; }
}
@media (max-width: 780px) {
    .apas-public-header { padding: 10px 23px; gap: 17px; }
    .apas-public-header img { width: 109px; }
    .apas-header-context { padding-left: 17px; gap: 3px; }
    .apas-header-context > span { display: none; }
    .apas-header-context strong { font-size: 12px; }
    .apas-header-site { display: none; }
    .apas-access-main { padding: 23px 18px 21px; max-width: 530px; }
    .apas-access-card { display: flex; flex-direction: column-reverse; border-radius: 18px; }
    .apas-access-form-panel { padding: 30px 27px 25px; align-self: stretch; }
    .apas-access-intro { margin-bottom: 25px; }
    .apas-access-intro h1 { font-size: 27px; }
    .apas-access-intro > p:last-child { font-size: 13px; }
    .apas-access-field input, .apas-access-field select { font-size: 16px; }
    .apas-access-form { gap: 18px; }
    .apas-welcome-copy { padding: 24px 27px 20px; }
    .apas-welcome h2 { font-size: 30px; }
    .apas-welcome h2 br { display: none; }
    .apas-welcome-copy .apas-eyebrow { font-size: 9px; margin-bottom: 10px; }
    .apas-welcome-copy > p:last-child { font-size: 13px; }
    .apas-welcome-footer { padding: 15px 25px; }
    .apas-family-image { aspect-ratio: 3/2; }
    .apas-public-footer { flex-direction: column; text-align: center; gap: 7px; padding: 0 20px 25px; }
    .apas-desktop-break { display: none; }
}
@media (max-width: 370px) {
    .apas-access-main { padding: 15px 10px; }
    .apas-access-form-panel { padding: 25px 18px; }
    .apas-access-intro h1 { font-size: 25px; }
    .apas-install-card { padding: 10px; gap: 7px; }
    .apas-install-card img { width: 34px; height: 34px; }
    .apas-install-card strong { font-size: 11px; }
    .apas-install-card button { padding: 8px; }
}
@media (display-mode: standalone) {
    [data-apas-install-wrap] { display: none !important; }
    .apas-public-header { padding-top: max(10px, env(safe-area-inset-top)); }
    .apas-public-footer { padding-bottom: max(25px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    .apas-login-v240 *, .apas-app * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* APAS_BRASIL_V241 */
.apas-national-brand { display:flex; flex:0 0 auto; align-items:center; }
.apas-national-brand img { object-fit:contain; }
.apas-login-v240 .apas-install-card { margin-top:25px; }
