html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #f4f6fb;
  color: #1f2937;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.app-navbar {
  background: linear-gradient(90deg, #0f172a, #1e293b);
}

.navbar-dark .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.85);
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: #fff;
}

.navbar-dark .navbar-brand {
  color: #fff;
}

/* E-mail do usuário: truncar só em telas estreitas */
.app-navbar-user-greeting {
  display: inline-block;
  max-width: min(14rem, 45vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 992px) {
  .app-navbar-user-greeting {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
  }
}

.page-container {
  min-height: calc(100vh - 140px);
}

/* Área logada: shell + menu lateral */
body.app-logged-in .app-shell {
  min-height: calc(100vh - 56px - 60px);
  display: flex;
  flex-direction: column;
}

body.app-logged-in .app-shell-row {
  flex: 1 1 auto;
  align-items: stretch;
  min-height: 0;
}

body.app-logged-in .app-sidebar-col {
  width: 100%;
}

@media (min-width: 992px) {
  body.app-logged-in .app-sidebar-col {
    width: 15rem;
    flex: 0 0 15rem;
    max-width: 15rem;
  }
}

body.app-logged-in .app-main-col {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-width: 0;
}

body.app-logged-in main.app-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

body.app-logged-in .app-sidebar {
  position: sticky;
  top: 1rem;
}

body.app-logged-in .app-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  color: #334155;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

body.app-logged-in .app-sidebar-link:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

body.app-logged-in .app-sidebar-link.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0.05));
  color: #1d4ed8;
}

body.app-logged-in .app-sidebar-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

body.app-logged-in .app-sidebar-icon.bi {
  font-size: 1.25rem;
  line-height: 1;
  width: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.app-logged-in .app-sidebar-toggle.app-sidebar-link.active .app-sidebar-chevron {
  transform: rotate(180deg);
}

body.app-logged-in .app-sidebar-chevron {
  transition: transform 0.2s ease;
  opacity: 0.75;
}

body.app-logged-in .app-sidebar-submenu .app-sidebar-sublink {
  padding-left: 1.35rem;
  font-size: 0.92rem;
  font-weight: 450;
}

body.app-logged-in .app-sidebar-submenu .app-sidebar-nested-toggle {
  padding-left: 1.5rem;
  font-size: 0.92rem;
}

body.app-logged-in .app-sidebar-submenu .app-sidebar-submenu-nested .app-sidebar-sublink-nested {
  padding-left: 2.35rem;
  font-size: 0.88rem;
}

body.app-logged-in .app-sidebar-submenu .app-sidebar-toggle.app-sidebar-nested-toggle.active .app-sidebar-chevron {
  transform: rotate(180deg);
}

body.app-logged-in .dashboard-panel {
  flex: 1 1 auto;
  min-height: 100%;
}

body.app-logged-in .dashboard-chart-wrap {
  height: min(360px, 55vh);
  min-height: 260px;
}

body.app-logged-in .company-panel-shell {
  flex: 1 1 auto;
  min-height: 100%;
  background: #fff;
  padding: 1rem;
}

body.app-logged-in .company-panel-card {
  min-height: auto;
  position: relative;
  overflow-x: hidden;
}

body.app-logged-in .company-form-header {
  padding: 1.25rem 1.25rem 1.35rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

@media (min-width: 768px) {
  body.app-logged-in .company-form-header {
    padding: 1.35rem 1.5rem 1.5rem;
  }
}

body.app-logged-in .company-form-kicker {
  letter-spacing: 0.1em;
  color: #1d4ed8;
  font-size: 0.7rem;
}

body.app-logged-in .company-form-title {
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.25;
}

body.app-logged-in .company-form-lead {
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 40rem;
}

/* Campos somente leitura (ex.: cadastro da empresa) — leve contraste, sem “efeito cinza pesado” */
body.app-logged-in .form-field-bloqueado {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
  cursor: default;
}

body.app-logged-in .form-field-bloqueado:focus {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.22rem rgba(148, 163, 184, 0.35);
  color: #475569;
}

.empresa-cadastro-toast {
  position: fixed;
  top: calc(56px + 1rem);
  right: 1rem;
  color: #fff;
  border-radius: 10px;
  padding: 0.65rem 0.9rem;
  font-weight: 500;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.26s ease, transform 0.26s ease;
  z-index: 1060;
  max-width: min(90vw, 420px);
}

.empresa-cadastro-toast.is-success {
  background: #16a34a;
}

.empresa-cadastro-toast.is-error {
  background: #dc2626;
}

.empresa-cadastro-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.empresa-cadastro-toast.hide {
  opacity: 0;
  transform: translateY(-6px);
}

@media (max-width: 767.98px) {
  body.app-logged-in .company-panel-shell {
    padding: 0.75rem;
  }

  .empresa-cadastro-toast {
    top: calc(56px + 0.75rem);
    left: 0.75rem;
    right: 0.75rem;
    max-width: none;
  }
}

/* Offcanvas do menu: cobre navbar, conteúdo e rodapé */
body.app-logged-in .app-sidebar-offcanvas {
  --bs-offcanvas-width: min(18rem, 88vw);
  z-index: 1055;
}

body.app-logged-in .offcanvas-backdrop {
  z-index: 1050;
}

body.app-logged-in .support-widget-root {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 1048;
}

body.app-logged-in .support-fab-button {
  border-radius: 999px;
  font-weight: 600;
}

body.app-logged-in .support-floating-card {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.65rem);
  width: min(92vw, 360px);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
  padding: 0.9rem;
}

body.app-logged-in .support-floating-header {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.55rem;
}

@media (max-width: 991.98px) {
  body.app-logged-in .support-widget-root {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  body.app-logged-in .support-fab-button {
    width: 100%;
  }

  body.app-logged-in .support-floating-card {
    right: 0;
    width: 100%;
  }
}

.surface-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e9edf5;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.hero-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  color: #64748b;
}

.brand-logo-text {
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #0f172a, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.footer {
  background-color: #fff;
  line-height: 60px;
}

/* Páginas de autenticação: fundo em degradê com animação suave */
@keyframes auth-gradient-flow {
  0%, 100% {
    background-position: 0% 40%;
  }
  50% {
    background-position: 100% 60%;
  }
}

@keyframes auth-card-reveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes auth-dots-shimmer {
  0%, 100% {
    opacity: 0.38;
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    opacity: 0.78;
    transform: translate3d(3%, 2.5%, 0) scale(1.04);
  }
}

body.auth-surface {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin-bottom: 0;
  background: linear-gradient(
    125deg,
    #0b1220 0%,
    #0f172a 28%,
    #1e3a5f 52%,
    #2563eb 78%,
    #38bdf8 100%
  );
  background-size: 280% 280%;
  animation: auth-gradient-flow 22s ease-in-out infinite;
  color: #e2e8f0;
}

/* Grade de pontos + brilho suave (estilo “loading” discreto) por cima do degradê */
body.auth-surface::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(
    circle at 1.1px 1.1px,
    rgba(255, 255, 255, 0.1) 1px,
    transparent 1.35px
  );
  background-size: 22px 22px;
}

body.auth-surface::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    52% 42% at 24% 22%,
    rgba(255, 255, 255, 0.14),
    transparent 70%
  );
  animation: auth-dots-shimmer 15s ease-in-out infinite;
}

body.auth-surface > header {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

body.auth-surface > .page-container {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 1;
}

/* Rodapé no fim da viewport: layout em coluna + override do absolute do _Layout.cshtml.css */
body.auth-surface > footer.footer {
  position: relative;
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  z-index: 1;
  line-height: normal;
  padding: 0.65rem 0;
}

body.auth-surface > footer.footer .auth-footer-version {
  margin-top: 0.15rem;
  opacity: 0.85;
}

body.auth-surface .page-container > main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.auth-surface .auth-login-row {
  flex: 0 1 auto;
  min-height: min(60vh, 480px);
}

body.auth-surface .surface-card {
  color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 24px 48px rgba(15, 23, 42, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

body.auth-surface .surface-card a:not(.btn) {
  color: var(--bs-primary);
}

body.auth-surface .surface-card a:not(.btn):hover {
  color: var(--bs-primary-text-emphasis, #0a58ca);
}

body.auth-surface .auth-card-reveal {
  animation: auth-card-reveal 0.55s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  body.auth-surface {
    animation: none;
    background-size: 100% 100%;
  }

  body.auth-surface::after {
    animation: none;
    opacity: 0.45;
    transform: none;
  }

  body.auth-surface .auth-card-reveal {
    animation: none;
  }
}

/* PDV */
body.pdv-page .app-main {
  min-height: 0;
}

.pdv-shell {
  min-height: calc(100vh - 56px - 8rem);
  max-height: calc(100vh - 56px - 4rem);
}

.pdv-main-row {
  min-height: 0;
  flex: 1 1 auto;
}

.pdv-grid-wrap {
  min-height: 12rem;
  max-height: min(52vh, 28rem);
}

@media (min-width: 992px) {
  .pdv-grid-wrap {
    max-height: calc(100vh - 56px - 14rem);
  }
}

.pdv-itens-table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pdv-total-valor {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 700;
  color: #0f172a;
  line-height: 1.1;
}

.pdv-footer .btn-lg {
  min-width: 10rem;
}

.pdv-pagamento-input:focus {
  background-color: #fffacd;
  box-shadow: 0 0 0 0.2rem rgba(234, 179, 8, 0.2);
}

/* PDV — modais de impressão (pergunta + andamento): tema claro, borda azul Mercatto */
.pdv-modal-cupom {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 45%, #f1f5f9 100%);
  color: #1e293b;
  border-radius: 1.25rem;
  border: 1px solid rgba(59, 130, 246, 0.28) !important;
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.06),
    0 12px 40px rgba(15, 23, 42, 0.1);
}

.pdv-modal-cupom-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(219, 234, 254, 0.95), rgba(191, 219, 254, 0.45));
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #2563eb;
  font-size: 1.65rem;
  line-height: 1;
}

.pdv-modal-cupom-title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.3;
}

.pdv-modal-cupom-lead {
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 0;
}

.pdv-modal-cupom-footnote {
  color: #64748b;
  line-height: 1.4;
}

.pdv-modal-cupom-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border-width: 0.22em;
}

.pdv-modal-cupom-btn {
  border-radius: 9999px;
  padding: 0.55rem 1.4rem;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.25;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.pdv-modal-cupom-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

/* Botão com foco (destaque) — azul Mercatto */
.pdv-modal-cupom-btn--accent {
  color: #fff;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 55%, #1d4ed8 100%);
  border: 1px solid rgba(147, 197, 253, 0.35);
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.3);
}

.pdv-modal-cupom-btn--accent:hover {
  filter: brightness(1.05);
  color: #fff;
}

/* Botão sem foco — estilo claro */
.pdv-modal-cupom-btn--muted {
  color: #475569;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: none;
}

.pdv-modal-cupom-btn--muted:hover {
  color: #0f172a;
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* PDV — modal buscar cupom (lista) */
.pdv-modal-busca-cupom-grid {
  max-height: min(48vh, 340px);
  overflow-y: auto;
}

.pdv-modal-busca-cupom-grid tbody tr {
  cursor: pointer;
}

/* PDV — telas estreitas (celular): evita sobreposição por altura fixa / flex + h-100 */
@media (max-width: 991.98px) {
  body.app-logged-in.pdv-page .company-panel-shell.pdv-shell {
    min-height: 0 !important;
  }

  body.pdv-page main.app-main {
    height: auto !important;
    min-height: 0;
    overflow-x: hidden;
  }

  body.pdv-page .pdv-shell {
    min-height: 0 !important;
    max-height: none !important;
  }

  body.pdv-page .pdv-main-row.flex-grow-1 {
    flex-grow: 0 !important;
  }

  body.pdv-page .pdv-main-row > [class*="col-"] {
    min-height: 0;
  }

  body.pdv-page #pdvAsideCaptura {
    height: auto !important;
    min-height: 0 !important;
  }

  body.pdv-page .pdv-cliente-panel {
    flex-grow: 0;
    max-height: 14rem;
  }

  body.pdv-page .pdv-cliente-panel #pdvClienteResultados {
    max-height: 8rem !important;
  }

  body.pdv-page .pdv-grid-wrap {
    max-height: none !important;
    min-height: 0;
    overflow: visible !important;
  }

  body.pdv-page .pdv-grid-wrap > .table-responsive {
    max-height: min(48vh, 20rem);
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.pdv-page .pdv-footer .btn-lg {
    min-width: 0;
  }

  body.pdv-page #pdvFooterBotoesPrincipais {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  body.pdv-page #pdvFooterBotoesPrincipais > .btn {
    width: 100%;
  }

  body.pdv-page .pdv-footer > .d-flex {
    flex-direction: column;
    align-items: stretch !important;
  }
}

/* Pós-cadastro: boas-vindas e passos iniciais */
@keyframes welcome-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes welcome-banner-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.welcome-onboarding .welcome-success-banner {
  animation: welcome-banner-in 0.45s ease-out both;
  background: linear-gradient(135deg, rgba(25, 135, 84, 0.12), rgba(25, 135, 84, 0.04)) !important;
}

.welcome-onboarding .welcome-success-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: rgba(25, 135, 84, 0.2);
  color: #146c43;
}

.welcome-onboarding .welcome-steps {
  position: relative;
  padding-left: 0;
}

.welcome-onboarding .welcome-steps::before {
  content: "";
  position: absolute;
  left: 1.15rem;
  top: 2.25rem;
  bottom: 2.25rem;
  width: 2px;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.35), rgba(37, 99, 235, 0.08));
  border-radius: 2px;
  pointer-events: none;
}

@media (max-width: 575.98px) {
  .welcome-onboarding .welcome-steps::before {
    left: 0.85rem;
  }
}

.welcome-onboarding .welcome-step {
  position: relative;
  margin-bottom: 1rem;
  animation: welcome-fade-up 0.5s ease-out both;
}

.welcome-onboarding .welcome-step:nth-child(1) {
  animation-delay: 0.08s;
}

.welcome-onboarding .welcome-step:nth-child(2) {
  animation-delay: 0.2s;
}

.welcome-onboarding .welcome-step:nth-child(3) {
  animation-delay: 0.32s;
}

.welcome-onboarding .welcome-step:last-child {
  margin-bottom: 0;
}

.welcome-onboarding .welcome-step-inner {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.welcome-onboarding .welcome-step-inner:hover {
  border-color: rgba(37, 99, 235, 0.35) !important;
  box-shadow: 0 0.35rem 1rem rgba(15, 23, 42, 0.08) !important;
}

.welcome-onboarding .welcome-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(145deg, #2563eb, #1d4ed8);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Cadastro: caixa rolável dos termos de uso do Mercatto */
.termos-mercatto {
  max-height: 16rem;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
  line-height: 1.45;
}

.termos-mercatto p {
  margin-bottom: 0.65rem;
}

.termos-mercatto p:last-child {
  margin-bottom: 0;
}