/*
 * Prospecta Corban / v289 — reflexo de botoes e cards, acoes azuis
 * Somente CSS. Exclusivo do tema escuro.
 * Nao modifica: simbolo Prospecta, logos, fases/alertas, valores, JS ou regras.
 */

/* 1. Corrige acoes que ainda herdavam o verde do tema antigo.
   A cor verde continua onde comunica um status real (sucesso, valor liberado etc). */
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-bank-cpf-input-shell button:not(:disabled),
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-bank-customer-next button:not(:disabled),
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-proposal-minimum-action > button:not(:disabled),
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-proposal-in100-required button.is-primary:not(:disabled),
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-proposal-final-action button:not(:disabled),
html[data-app-theme="dark"] body :is(
  .automation-proposal-bank-success-confirm,
  .automation-proposal-bank-success-open,
  .automation-proposal-bank-success-copy-button,
  .automation-proposal-submit-success-actions button,
  .automation-proposal-submit-success-actions a,
  .automation-table-settings-save,
  .automation-banks-admin-new,
  .company-bank-access-save
):not(:disabled) {
  color: #041b31 !important;
  border: 1px solid rgba(147, 232, 255, .78) !important;
  background: linear-gradient(112deg, #3f9af8 0%, #66d3ff 56%, #94efff 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.38),
              0 0 16px rgba(59,174,251,.21),
              0 7px 20px rgba(24,105,213,.23) !important;
  text-shadow: none !important;
}
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-bank-cpf-input-shell button:not(:disabled):hover,
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-bank-customer-next button:not(:disabled):hover,
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-proposal-minimum-action > button:not(:disabled):hover,
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-proposal-in100-required button.is-primary:not(:disabled):hover,
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-proposal-final-action button:not(:disabled):hover,
html[data-app-theme="dark"] body :is(
  .automation-proposal-bank-success-confirm,
  .automation-proposal-bank-success-open,
  .automation-proposal-bank-success-copy-button,
  .automation-proposal-submit-success-actions button,
  .automation-proposal-submit-success-actions a,
  .automation-table-settings-save,
  .automation-banks-admin-new,
  .company-bank-access-save
):not(:disabled):hover {
  border-color: #bcf4ff !important;
  background: linear-gradient(115deg, #63b5ff, #94e7ff 65%, #b1f6ff) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.43),
              0 0 23px rgba(68,188,253,.28),
              0 10px 25px rgba(24,118,215,.25) !important;
}
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-bank-cpf-input-shell button:disabled,
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-bank-customer-next button:disabled {
  color: rgba(180,210,231,.55) !important;
  border-color: rgba(92,157,213,.18) !important;
  background: rgba(37,88,134,.18) !important;
  box-shadow: none !important;
}
/* Acoes complementares de tabelas e fluxos bancarios nao ficam verdes. */
html[data-app-theme="dark"] #app-view :is(
  .automation-table-settings-bank-actions button,
  .automation-bank-admin-table-row button
):not(:disabled),
html[data-app-theme="dark"] #automation-bank-flow-backdrop :is(
  .automation-proposal-bank-success-open,
  .automation-proposal-bank-success-copy-button
):not(:disabled) {
  color: #b4e6ff !important;
  border-color: rgba(96, 188, 247, .44) !important;
  background: linear-gradient(135deg, rgba(27,91,157,.27), rgba(10,41,77,.80)) !important;
  box-shadow: inset 0 1px 0 rgba(174,235,255,.06) !important;
}
html[data-app-theme="dark"] #app-view :is(
  .automation-table-settings-bank-actions button,
  .automation-bank-admin-table-row button
):not(:disabled):hover {
  color: #f2fbff !important;
  border-color: #7bcfff !important;
  background: linear-gradient(135deg, rgba(44,127,210,.37), rgba(14,62,112,.90)) !important;
}

/* 2. Reflexo limitado a botoes de ACAO conhecidos, nao a todos os
   botoes do documento. O seletor generico antigo atingia ate o olhinho de
   senha: 'position:relative' sobrepunha 'position:absolute', quebrando o login.
   Tambem forçava verificacao de estilo de cada botao no carregamento.
   Nao recria pseudo-elementos de toggles de senha, navegacao ou dropdowns.
   Usar transform em vez de left evita recalculos de layout durante o brilho. */
html[data-app-theme="dark"] #app-view :is(
  .btn, .toolbar-button, .pipeline-icon-action,
  .company-new-button, .company-register-button,
  .credential-finish-button, .employee-new-button, .employee-save-button,
  .proposal-save-button, .table-catalog-save-button,
  .mcd-section-action, .mcd-refresh, .mcd-pipeline-close,
  .workers-primary, .workers-refresh,
  .automation-banks-admin-new, .automation-banks-admin-refresh,
  .company-bank-access-save, .settings-back-button,
  .pipeline-filter-button, .company-license-action,
  .profile-save-button, .profile-photo-button
):not(:disabled),
html[data-app-theme="dark"] #automation-bank-flow-backdrop :is(
  .automation-bank-cpf-input-shell button,
  .automation-bank-customer-next button,
  .automation-proposal-final-action button,
  .automation-proposal-minimum-action button,
  .automation-proposal-in100-required button,
  .automation-bank-flow-head > button
):not(:disabled),
html[data-app-theme="dark"] #new-proposal-bank-modal :is(
  .new-proposal-bank-close, .new-proposal-bank-footer button
):not(:disabled) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
html[data-app-theme="dark"] #app-view :is(
  .btn, .toolbar-button, .pipeline-icon-action,
  .company-new-button, .company-register-button,
  .credential-finish-button, .employee-new-button, .employee-save-button,
  .proposal-save-button, .table-catalog-save-button,
  .mcd-section-action, .mcd-refresh, .mcd-pipeline-close,
  .workers-primary, .workers-refresh,
  .automation-banks-admin-new, .automation-banks-admin-refresh,
  .company-bank-access-save, .settings-back-button,
  .pipeline-filter-button, .company-license-action,
  .profile-save-button, .profile-photo-button
):not(:disabled)::after,
html[data-app-theme="dark"] #automation-bank-flow-backdrop :is(
  .automation-bank-cpf-input-shell button,
  .automation-bank-customer-next button,
  .automation-proposal-final-action button,
  .automation-proposal-minimum-action button,
  .automation-proposal-in100-required button,
  .automation-bank-flow-head > button
):not(:disabled)::after,
html[data-app-theme="dark"] #new-proposal-bank-modal :is(
  .new-proposal-bank-close, .new-proposal-bank-footer button
):not(:disabled)::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 2;
  left: -60%;
  top: -75%;
  width: 34%;
  height: 250%;
  border: 0;
  border-radius: 0;
  opacity: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(237,251,255,.03) 18%,
    rgba(248,253,255,.33) 50%,
    rgba(229,249,255,.06) 82%,
    transparent 100%);
  transform: translate3d(0, 0, 0) skewX(-22deg);
  transition: transform .63s cubic-bezier(.23,.58,.22,1), opacity .13s ease;
}
html[data-app-theme="dark"] #app-view :is(
  .btn, .toolbar-button, .pipeline-icon-action,
  .company-new-button, .company-register-button,
  .credential-finish-button, .employee-new-button, .employee-save-button,
  .proposal-save-button, .table-catalog-save-button,
  .mcd-section-action, .mcd-refresh, .mcd-pipeline-close,
  .workers-primary, .workers-refresh,
  .automation-banks-admin-new, .automation-banks-admin-refresh,
  .company-bank-access-save, .settings-back-button,
  .pipeline-filter-button, .company-license-action,
  .profile-save-button, .profile-photo-button
):not(:disabled):is(:hover, :focus-visible)::after,
html[data-app-theme="dark"] #automation-bank-flow-backdrop :is(
  .automation-bank-cpf-input-shell button,
  .automation-bank-customer-next button,
  .automation-proposal-final-action button,
  .automation-proposal-minimum-action button,
  .automation-proposal-in100-required button,
  .automation-bank-flow-head > button
):not(:disabled):is(:hover, :focus-visible)::after,
html[data-app-theme="dark"] #new-proposal-bank-modal :is(
  .new-proposal-bank-close, .new-proposal-bank-footer button
):not(:disabled):is(:hover, :focus-visible)::after {
  transform: translate3d(500%, 0, 0) skewX(-22deg);
  opacity: 1;
}

/* 3. Mesma passagem de reflexo nos cards de abertura/Home e atalhos.
   O ::before original dos cards de fase (vermelho/amarelo) e preservado. */
html[data-app-theme="dark"] #app-view :is(
  .mcd-flow-card, .mcd-exception, .mcd-metric,
  .mcd-attention-card, .mcd-shortcut,
  .settings-module-card, .reports-launch-card
),
html[data-app-theme="dark"] #new-proposal-bank-modal .new-proposal-bank-card,
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-bank-benefit-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease,
              transform .2s ease, background .2s ease;
}
html[data-app-theme="dark"] #app-view :is(
  .mcd-flow-card, .mcd-exception, .mcd-metric,
  .mcd-attention-card, .mcd-shortcut,
  .settings-module-card, .reports-launch-card
)::after,
html[data-app-theme="dark"] #new-proposal-bank-modal .new-proposal-bank-card::after,
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-bank-benefit-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 2;
  left: -65%;
  top: -58%;
  width: 39%;
  height: 225%;
  background: linear-gradient(90deg,
    transparent,
    rgba(103,215,255,.035) 18%,
    rgba(205,246,255,.25) 52%,
    rgba(116,211,255,.055) 82%,
    transparent);
  opacity: 0;
  transform: translate3d(0, 0, 0) skewX(-21deg);
  transition: transform .70s cubic-bezier(.20,.55,.22,1), opacity .16s ease;
}
html[data-app-theme="dark"] #app-view :is(
  .mcd-flow-card, .mcd-exception, .mcd-metric,
  .mcd-attention-card, .mcd-shortcut,
  .settings-module-card, .reports-launch-card
):is(:hover, :focus-visible)::after,
html[data-app-theme="dark"] #new-proposal-bank-modal .new-proposal-bank-card:is(:hover, :focus-visible)::after,
html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-bank-benefit-card:is(:hover, :focus-visible)::after {
  transform: translate3d(500%, 0, 0) skewX(-21deg);
  opacity: 1;
}
html[data-app-theme="dark"] #app-view :is(
  .mcd-flow-card, .mcd-exception, .mcd-metric,
  .mcd-attention-card, .mcd-shortcut
):is(:hover, :focus-visible) {
  border-color: rgba(117, 216, 255, .63) !important;
  box-shadow: 0 0 21px rgba(43, 157, 248, .13),
              inset 0 1px 0 rgba(199,238,255,.12) !important;
}
/* Icones de atalhos em azul. Indicadores de risco/fase permanecem intactos. */
html[data-app-theme="dark"] #app-view .mcd-shortcut b {
  color: #96e5ff !important;
  background: rgba(45,137,224,.16) !important;
}
html[data-app-theme="dark"] #app-view .mcd-shortcut:is(:hover, :focus-visible) {
  color: #b8edff !important;
}

/* Respeita preferencias do usuario e evita efeitos em controles sensiveis. */
@media (prefers-reduced-motion: reduce) {
  html[data-app-theme="dark"] #app-view :is(
    .btn, .toolbar-button, .pipeline-icon-action, .company-new-button,
    .mcd-section-action, .mcd-refresh, .mcd-pipeline-close,
    .workers-primary, .workers-refresh, .automation-banks-admin-new
  )::after,
  html[data-app-theme="dark"] #automation-bank-flow-backdrop button::after,
  html[data-app-theme="dark"] #new-proposal-bank-modal button::after,
  html[data-app-theme="dark"] #app-view :is(
    .mcd-flow-card, .mcd-exception, .mcd-metric,
    .mcd-attention-card, .mcd-shortcut,
    .settings-module-card, .reports-launch-card
  )::after,
  html[data-app-theme="dark"] #new-proposal-bank-modal .new-proposal-bank-card::after,
  html[data-app-theme="dark"] #automation-bank-flow-backdrop .automation-bank-benefit-card::after {
    transition: none !important;
    opacity: 0 !important;
  }
}

/* Login: protecao explicita contra regressao de alinhamento do olho. */
#login-view .input-shell-password { position: relative; }
#login-view .input-shell-password > #toggle-password {
  position: absolute !important;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  overflow: visible;
  isolation: auto;
}
