/* SIGA Américas · legibilidade mobile e continuidade visual de borda a borda.
   Camada única, carregada por último nas páginas públicas e no login.
   Não altera formulários, eventos, IDs, validações ou permissões. */
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  html:has(body.auth-locked) { background: #07382e; }

  /* O cabeçalho e o rodapé acompanham o fundo, sem faixas brancas isoladas.
     env(safe-area-inset-*) atende notch e indicador inferior em modo standalone. */
  body:has(.pub-top) {
    min-height: 100dvh;
    display: flex; flex-direction: column;
    background: linear-gradient(165deg,#f6faf6 0%,#f2f7f2 58%,#f7faf7 100%);
    font-size: 16px;
    line-height: 1.55;
  }
  body:has(.pub-top) > main.pub-shell { width: 100%; flex: 1 0 auto; }
  body:has(.pub-top) .pub-top {
    background: #f3f8f3;
    border-bottom: 1px solid #dde9df;
    padding-top: env(safe-area-inset-top);
    box-shadow: none;
  }
  body:has(.pub-top) .pub-top-inner { min-height: 72px; height: auto; padding-block: 10px; }
  body:has(.pub-top) .pub-brand { gap: 10px; min-width: 0; }
  body:has(.pub-top) .pub-brand strong { font-size: 18px; line-height: 1.2; letter-spacing: -.035em; }
  body:has(.pub-top) .pub-brand small { font-size: 12px; line-height: 1.4; color: #658773; }
  body:has(.pub-top) .pub-back {
    min-height: 44px; min-width: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; line-height: 1.35;
  }
  body:has(.pub-top) .pub-footer {
    margin-top: auto; background: #f3f8f3;
    border-top: 1px solid #e2ece3; box-shadow: none;
    padding-bottom: env(safe-area-inset-bottom);
  }
  body:has(.pub-top) .pub-footer > .pub-shell {
    padding-top: 16px; padding-bottom: 16px;
    font-size: 13px; line-height: 1.5;
    color: #658272;
  }
  body:has(.pub-top) .pub-footer small { font-size: 12px; line-height: 1.5; color: #829c88; }
  body:has(.pub-top) .pub-footer strong { color: #2a714a; }
  body:has(.pub-top) :is(button, a, input, select, textarea):focus-visible {
    outline: 3px solid #76b68b; outline-offset: 2px;
  }

  /* Portal dos técnicos: informação principal legível sem apertar os cartões. */
  .tech-main { max-width: 510px; padding-top: 26px; padding-bottom: 26px; }
  .tech-eyebrow { font-size: 12px; line-height: 1.45; letter-spacing: .045em; }
  .tech-intro { margin-bottom: 22px; }
  .tech-intro h1 { font-size: clamp(29px, 7.2vw, 35px); line-height: 1.16; margin: 12px 0 9px; }
  .tech-intro p { font-size: 16px; line-height: 1.52; max-width: 38ch; color: #5c7767; }
  .tech-choices { gap: 14px; }
  .tech-choice {
    min-height: 118px; grid-template-columns: 48px minmax(0,1fr) 22px;
    gap: 13px; padding: 18px 16px; border-radius: 16px;
  }
  .tech-icon { width: 48px; height: 48px; }
  .tech-icon svg { width: 25px; height: 25px; }
  .tech-copy { gap: 6px; }
  .tech-copy > strong { font-size: 18px; line-height: 1.27; }
  .tech-copy > span { font-size: 15px; line-height: 1.5; color: #526f60; }
  .tech-copy > small { font-size: 13px; line-height: 1.45; color: #467e57; font-weight: 750; }
  .tech-arrow { height: 22px; width: 22px; }
  .tech-note { margin: 19px 0 8px; padding: 14px; font-size: 13.5px; line-height: 1.55; }
  .tech-note svg { width: 21px; height: 21px; flex-basis: 21px; }

  /* Registro semanal: orientar o usuário com títulos, controles e avisos legíveis. */
  body:has(#public-field-form) .pub-eyebrow { font-size: 12px; }
  body:has(#public-field-form) .pub-hero h1 { font-size: clamp(28px,7vw,34px); line-height: 1.18; }
  body:has(#public-field-form) .pub-hero p { font-size: 15px; line-height: 1.55; }
  body:has(#public-field-form) .pub-progress { gap: 5px; }
  body:has(#public-field-form) .pub-progress-step strong { font-size: 12px; line-height: 1.3; }
  body:has(#public-field-form) .pub-progress-step > span:first-child { font-size: 12px; }
  body:has(#public-field-form) .pub-panel-heading h2 { font-size: 19px; line-height: 1.35; }
  body:has(#public-field-form) .pub-panel-heading p { font-size: 14px; line-height: 1.6; }
  body:has(#public-field-form) .pub-panel-heading span:not(.required) { font-size: 11px; }
  body:has(#public-field-form) .pub-fields label { font-size: 14px; line-height: 1.5; }
  body:has(#public-field-form) .pub-fields small { font-size: 13px; line-height: 1.55; }
  body:has(#public-field-form) .pub-fields :is(input,select,textarea) { font-size: 16px; }
  body:has(#public-field-form) .pub-help p { font-size: 14px; line-height: 1.55; }
  body:has(#public-field-form) .pub-os-checkbox strong { font-size: 15px; line-height: 1.4; }
  body:has(#public-field-form) .pub-os-checkbox small { font-size: 13px; line-height: 1.5; }
  body:has(#public-field-form) .pub-os-chip { font-size: 12px; max-width: 116px; }
  body:has(#public-field-form) .pub-os-prompt { font-size: 13px; }
  body:has(#public-field-form) .pub-check-option { font-size: 14px; }
  body:has(#public-field-form) .pub-absence-head strong { font-size: 15px; }
  body:has(#public-field-form) .pub-absence-head p { font-size: 13px; }
  body:has(#public-field-form) .pub-attention-copy strong { font-size: 15px; }
  body:has(#public-field-form) .pub-attention-copy p { font-size: 14px; }
  body:has(#public-field-form) .pub-attention-action { font-size: 14px; }
  body:has(#public-field-form) .pub-quick-general > label { font-size: 14px; }
  body:has(#public-field-form) .pub-quick-general textarea { font-size: 16px; }
  body:has(#public-field-form) .pub-wizard-next,
  body:has(#public-field-form) .pub-wizard-back,
  body:has(#public-field-form) .pub-submit { font-size: 15px; min-height: 50px; }
  body:has(#public-field-form) .pub-wizard-count,
  body:has(#public-field-form) .pub-consent,
  body:has(#public-field-form) .pub-summary-guidance { font-size: 14px; line-height: 1.5; }
  body:has(#public-field-form) .pub-alert { font-size: 14px; }

  /* Checklist pré-uso: rótulos e observações não devem parecer notas de rodapé. */
  .preuse-main { padding-bottom: 26px; }
  .preuse-hero .pub-eyebrow { font-size: 12px; }
  .preuse-hero h1 { font-size: clamp(29px,7vw,34px); line-height: 1.2; }
  .preuse-hero p { font-size: 15px; line-height: 1.56; }
  .preuse-stats > span { font-size: 13px; line-height: 1.45; }
  .preuse-stats strong { font-size: 24px; }
  .preuse-message { font-size: 14px; line-height: 1.55; }
  .preuse-section-heading h2 { font-size: 19px; line-height: 1.35; }
  .preuse-section-heading p { font-size: 14px; line-height: 1.55; }
  .preuse-identification-grid .preuse-field-label { font-size: 14px; }
  .preuse-identification-grid > label > small { font-size: 12.5px; line-height: 1.5; }
  .preuse-identification-grid > label :is(input,select) { font-size: 16px; min-height: 50px; }
  .preuse-group > summary > strong { font-size: 15px; line-height: 1.4; }
  .preuse-group-count { font-size: 12px; line-height: 1.45; }
  .preuse-group-body > p { font-size: 13px; }
  .preuse-unit strong { font-size: 14px; line-height: 1.45; }
  .preuse-unit small { font-size: 12.5px; line-height: 1.5; }
  .preuse-check-items strong { font-size: 14px; }
  .preuse-check-items span { font-size: 13px; }
  .preuse-result legend { font-size: 14px; }
  .preuse-result label { font-size: 14px; min-height: 48px; }
  .preuse-hint,.preuse-safety { font-size: 13.5px; line-height: 1.55; }
  .preuse-problem > label { font-size: 14px; }
  .preuse-quantity,.preuse-plates { font-size: 14px; }
  .preuse-quantity input,.preuse-plates input { font-size: 16px; }
  #preuse-submit { min-height: 52px; font-size: 16px; }

  /* Tela de login: 16px no texto principal e 14px nas informações auxiliares. */
  body.auth-locked .auth-login-grid .auth-card { padding: 22px 21px 24px; }
  body.auth-locked .auth-login-grid .auth-brand-stack { height: 90px; }
  body.auth-locked .auth-login-grid .auth-card > .eyebrow { font-size: 12px; }
  body.auth-locked .auth-login-grid .auth-card h1 { font-size: 28px; line-height: 1.2; }
  body.auth-locked .auth-login-grid .auth-card p { font-size: 15px; line-height: 1.6; }
  body.auth-locked .auth-login-grid .auth-form .field label { font-size: 15px; }
  body.auth-locked .auth-login-grid .auth-form .field input { font-size: 16px; min-height: 53px; height: 53px; }
  body.auth-locked .auth-login-grid .auth-form .btn { font-size: 16px; min-height: 53px; }
  body.auth-locked .auth-login-grid .public-access-link { min-height: 86px; padding: 13px; }
  body.auth-locked .auth-login-grid .public-access-copy strong { font-size: 16px; }
  body.auth-locked .auth-login-grid .public-access-copy small { font-size: 13.5px; line-height: 1.5; }
  body.auth-locked .auth-login-grid .public-access-symbol { width: 45px; height: 45px; flex-basis: 45px; }
}

/* Telas estreitas: reduzir somente o espaço, não a tipografia. */
@media (max-width: 370px) {
  .tech-choice { grid-template-columns: 43px minmax(0,1fr) 19px; gap: 10px; padding: 15px 12px; }
  .tech-icon { width: 43px; height: 43px; }
  .tech-copy > strong { font-size: 17px; }
  .tech-copy > span { font-size: 14px; }
  .tech-copy > small { font-size: 12px; }
  body:has(#public-field-form) .pub-progress-step strong { font-size: 11px; }
  .preuse-stats > span { padding: 11px; }
  body.auth-locked .auth-login-grid .auth-card { padding-inline: 17px; }
}

/* Assinatura do termo: a mesma superfície de cabeçalho e rodapé do portal,
   sem reduzir a leitura do documento jurídico no celular. */
@media (max-width: 760px) {
  body:has(.sign-header) {
    min-height: 100dvh; display: flex; flex-direction: column;
    background: linear-gradient(165deg,#f6faf6,#f2f7f2 65%,#f7faf7);
    font-size: 16px; line-height: 1.55;
  }
  body:has(.sign-header) .sign-header {
    background: #f3f8f3; border-bottom: 1px solid #dde9df;
    padding-top: env(safe-area-inset-top);
  }
  body:has(.sign-header) .sign-head { min-height: 72px; }
  body:has(.sign-header) .sign-brand strong { font-size: 18px; }
  body:has(.sign-header) .sign-brand small { font-size: 12px; line-height: 1.4; }
  body:has(.sign-header) .sign-secure { font-size: 12px; }
  body:has(.sign-header) main.sign-shell { flex: 1 0 auto; }
  body:has(.sign-header) .sign-intro span { font-size: 12px; }
  body:has(.sign-header) .sign-intro h1 { font-size: 28px; }
  body:has(.sign-header) .sign-intro p,
  body:has(.sign-header) .sign-body { font-size: 16px; line-height: 1.65; }
  body:has(.sign-header) .sign-body h3 { font-size: 17px; }
  body:has(.sign-header) .sign-status,
  body:has(.sign-header) .sign-ack label { font-size: 15px; }
  body:has(.sign-header) .sign-fields dt,
  body:has(.sign-header) .sign-warning { font-size: 13px; }
  body:has(.sign-header) .sign-fields dd { font-size: 14px; }
  body:has(.sign-header) .sign-name { font-size: 15px; }
  body:has(.sign-header) .sign-name input { height: 50px; font-size: 16px; }
  body:has(.sign-header) .sign-button { min-height: 48px; font-size: 15px; }
  body:has(.sign-header) .sign-footer {
    width: 100%; max-width: none; margin: 0;
    padding: 17px max(15px,calc((100vw - 800px)/2)) calc(17px + env(safe-area-inset-bottom));
    background: #f3f8f3; border-top: 1px solid #e2ece3;
    font-size: 13px; line-height: 1.55; color: #658272;
  }
}

/* Ajuste de proporção 02/11/2026: telas iniciais sem faixas cromáticas alheias ao fundo.
   Corrige o excesso de tamanho do login e dos cartões sem reduzir a legibilidade. */
@media (max-width: 760px) {
  html:has(body.auth-locked) { background: #f5f8f4; color-scheme: light; }
  body.auth-locked { background: #f5f8f4 !important; background-image: none !important; }
  body.auth-locked .main-content::before,
  body.auth-locked .main-content::after { display: none !important; }
  body.auth-locked .main-content {
    background: transparent !important;
    min-height: 100dvh; height: auto; overflow: visible;
    padding: 16px 14px calc(20px + env(safe-area-inset-bottom));
    align-items: flex-start; justify-content: center;
  }
  body.auth-locked .auth-wrap.auth-login-grid {
    width: min(420px,100%); max-width: 100%;
    margin-inline: auto;
  }
  body.auth-locked .auth-login-grid .auth-card {
    padding: 19px 19px 20px;
    border-radius: 18px;
    border-color: #e0e9e1;
    box-shadow: 0 9px 28px rgba(21,65,40,.085);
  }
  body.auth-locked .auth-login-grid .auth-brand-stack {
    height: 73px; min-height: 0; margin-bottom: 11px; padding-bottom: 3px;
  }
  body.auth-locked .auth-login-grid .auth-lockup { max-width: 277px; max-height: 69px; }
  body.auth-locked .auth-login-grid .auth-card > .eyebrow { font-size: 11px; }
  body.auth-locked .auth-login-grid .auth-card h1 {
    font-size: 25px; line-height: 1.17; margin: 7px 0;
  }
  body.auth-locked .auth-login-grid .auth-card p {
    font-size: 14.5px; line-height: 1.5; margin: 8px 0 12px;
  }
  body.auth-locked .auth-login-grid .auth-form { gap: 10px; }
  body.auth-locked .auth-login-grid .auth-form .field label { font-size: 14px; margin-bottom: 4px; }
  body.auth-locked .auth-login-grid .auth-form .field input {
    height: 49px; min-height: 49px; font-size: 16px;
  }
  body.auth-locked .auth-login-grid .auth-form .btn {
    min-height: 49px; font-size: 15.5px; margin-top: 2px;
  }
  body.auth-locked .auth-login-grid .public-access-link {
    min-height: 72px; margin-top: 12px; padding: 11px 12px;
  }
  body.auth-locked .auth-login-grid .public-access-copy strong { font-size: 15px; }
  body.auth-locked .auth-login-grid .public-access-copy small { font-size: 12.5px; line-height: 1.4; }
  body.auth-locked .auth-login-grid .public-access-symbol {
    width: 42px; height: 42px; flex-basis: 42px;
  }

  /* Também no portal, cabeçalho e rodapé prolongam a superfície da página. */
  body:has(.tech-main) {
    background: #f5f8f4;
  }
  body:has(.tech-main) .pub-top,
  body:has(.tech-main) .pub-footer {
    background: #f5f8f4; box-shadow: none;
    border-color: #e1ebe2;
  }
  .tech-main { padding-top: 23px; padding-bottom: 20px; }
  .tech-eyebrow { font-size: 11.5px; }
  .tech-intro { margin-bottom: 20px; }
  .tech-intro h1 {
    font-size: clamp(27px,6.5vw,31px); line-height: 1.17;
    margin: 10px 0 7px;
  }
  .tech-intro p { font-size: 15px; line-height: 1.48; }
  .tech-choices { gap: 12px; }
  .tech-choice {
    min-height: 105px;
    grid-template-columns: 45px minmax(0,1fr) 21px;
    gap: 11px; padding: 15px 14px; border-radius: 15px;
  }
  .tech-icon { width: 45px; height: 45px; }
  .tech-icon svg { width: 24px; height: 24px; }
  .tech-copy { gap: 4px; }
  .tech-copy > strong { font-size: 16.5px; line-height: 1.28; }
  .tech-copy > span { font-size: 14px; line-height: 1.42; }
  .tech-copy > small { font-size: 12px; line-height: 1.4; }
  .tech-note { padding: 11px 12px; font-size: 12px; line-height: 1.5; }
}
@media (max-width: 370px) {
  body.auth-locked .auth-login-grid .auth-card { padding: 17px 16px 19px; }
  body.auth-locked .auth-login-grid .auth-card h1 { font-size: 23px; }
  body.auth-locked .auth-login-grid .auth-brand-stack { height: 67px; }
  .tech-choice { gap: 9px; padding: 14px 12px; }
  .tech-copy > strong { font-size: 16px; }
  .tech-copy > span { font-size: 13.5px; }
  .tech-copy > small { font-size: 11.5px; }
}

/* Auditoria mobile 02/11/2026: telas públicas e login. */
@media (max-width:760px) {
 /* Blocos públicos e formulário semanal: largura contida e ações sem corte. */
 body:has(.pub-top) :is(.pub-shell,.pub-panel,.preuse-panel) {min-width:0}
 body:has(.pub-top) .pub-top-inner {gap:10px}
 body:has(.pub-top) .pub-brand {min-width:0;max-width:calc(100% - 52px)}
 body:has(.pub-top) .pub-brand>span {min-width:0}
 body:has(.pub-top) .pub-back {flex-shrink:0}
 body:has(#public-field-form) .pub-hero {min-width:0;max-width:100%;margin-top:15px}
 body:has(#public-field-form) .pub-hero h1 {overflow-wrap:anywhere}
 body:has(#public-field-form) .pub-progress {max-width:100%;min-width:0}
 body:has(#public-field-form) .pub-progress-step {min-width:0}
 body:has(#public-field-form) .pub-wizard-actions {
  min-width:0;max-width:100%;display:flex;align-items:center;
  justify-content:space-between;flex-wrap:wrap;gap:8px;
 }
 body:has(#public-field-form) .pub-wizard-count {min-width:0;flex:1;text-align:center}
 body:has(#public-field-form) .pub-wizard-next,
 body:has(#public-field-form) .pub-wizard-back {
  min-width:0;min-height:44px;max-width:100%;
  white-space:normal;line-height:1.3;padding:10px 12px;
 }
 body:has(#public-field-form) .pub-submit-row {min-width:0;max-width:100%}
 body:has(#public-field-form) .pub-submit {min-width:0;white-space:normal}

 /* Login: impedir que textos e controles extrapolem o cartão no celular. */
 body.auth-locked .auth-wrap.auth-login-grid,
 body.auth-locked .auth-login-grid .auth-card {min-width:0;max-width:100%}
 body.auth-locked .auth-login-grid .auth-brand-stack {max-width:100%}
 body.auth-locked .auth-login-grid .auth-lockup {max-width:100%;object-fit:contain}
 body.auth-locked .auth-login-grid .auth-form,
 body.auth-locked .auth-login-grid .auth-form .field {min-width:0;max-width:100%}
 body.auth-locked .auth-login-grid .auth-form .field input {
  width:100%;min-width:0;max-width:100%;font-size:16px;
 }
 body.auth-locked .auth-login-grid .public-access-link {min-width:0;max-width:100%}
 body.auth-locked .auth-login-grid .public-access-copy {
  min-width:0;overflow-wrap:anywhere;
 }

 /* Checklist pré-uso: controles sempre contidos nos painéis. */
 body:has(.preuse-main) .preuse-panel,
 body:has(.preuse-main) .preuse-identification-grid,
 body:has(.preuse-main) .preuse-group {min-width:0;max-width:100%}
 body:has(.preuse-main) .preuse-identification-grid :is(input,select,textarea) {
  min-width:0;max-width:100%;
 }
}
