/* ============ Malu Transportes — estilos globais ============ */
:root {
  --azul-900: #0b1c3d;
  --azul-800: #10275c;
  --azul-700: #1d4ed8;
  --azul-500: #3b82f6;
  --ciano: #0ea5e9;
  --fundo: #f4f6fb;
  --card: #ffffff;
  --texto: #1e293b;
  --texto-suave: #64748b;
  --borda: #e2e8f0;
  --verde: #16a34a;
  --vermelho: #dc2626;
  --ambar: #d97706;
  --sombra: 0 10px 30px rgba(15, 23, 42, .08);
  --raio: 14px;
  font-size: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
/* compensa o topo fixo ao rolar até uma âncora */
section[id] { scroll-margin-top: 90px; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: var(--azul-700); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: .95rem; }

.container { width: min(1120px, 92%); margin-inline: auto; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .7rem 1.4rem; border: none; border-radius: 10px;
  font-weight: 600; font-size: .95rem; transition: .2s;
}
.btn-primario { background: linear-gradient(135deg, var(--azul-700), var(--ciano)); color: #fff; }
.btn-primario:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-fantasma { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.4); }
.btn-fantasma:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-claro { background: #eef2ff; color: var(--azul-700); }
.btn-claro:hover { background: #e0e7ff; }
.btn-perigo { background: #fee2e2; color: var(--vermelho); }
.btn-perigo:hover { background: #fecaca; }
.btn-pequeno { padding: .4rem .8rem; font-size: .82rem; border-radius: 8px; }

/* ============================================================
   LANDING PAGE
   ============================================================ */
.topo {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(90deg,
    #ffffff 0%, #ffffff 250px,
    #93c5fd 45%, var(--azul-500) 62%,
    var(--azul-800) 82%, var(--azul-900) 100%);
  box-shadow: 0 2px 14px rgba(11, 28, 61, .18);
}
.topo-inner { display: flex; align-items: center; justify-content: space-between; padding: .7rem 0; }
.marca { display: flex; align-items: center; gap: .7rem; flex-shrink: 0; }
.marca-logo { height: 54px; width: auto; max-width: none; }
.menu { display: flex; gap: 1.6rem; align-items: center; }
.menu a { color: #e0eaf8; font-size: .92rem; font-weight: 600; text-shadow: 0 1px 2px rgba(11,28,61,.25); }
.menu a:hover { color: #fff; }

.hero {
  background:
    radial-gradient(ellipse at 20% -10%, rgba(59,130,246,.35), transparent 55%),
    radial-gradient(ellipse at 90% 10%, rgba(14,165,233,.25), transparent 50%),
    linear-gradient(160deg, var(--azul-900) 0%, var(--azul-800) 60%, #0c2f66 100%);
  color: #fff;
  padding: 5.5rem 0 6rem;
}
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); line-height: 1.15; margin-bottom: 1.1rem; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #7dd3fc, #60a5fa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: #b6c3dd; font-size: 1.08rem; max-width: 34rem; margin-bottom: 2rem; }
.hero-acoes { display: flex; gap: 1rem; flex-wrap: wrap; }

.hero-cartao {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px; padding: 1.8rem; backdrop-filter: blur(6px);
}
.hero-cartao h3 { margin-bottom: 1rem; font-size: 1.05rem; color: #e2e8f0; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hero-stat { background: rgba(255,255,255,.05); border-radius: 12px; padding: 1rem; }
.hero-stat strong { display: block; font-size: 1.5rem; color: #7dd3fc; }
.hero-stat span { font-size: .82rem; color: #94a3b8; }

.secao { padding: 4.5rem 0; }
.secao-titulo { text-align: center; margin-bottom: 3rem; }
.secao-titulo h2 { font-size: 1.9rem; margin-bottom: .5rem; }
.secao-titulo p { color: var(--texto-suave); max-width: 38rem; margin-inline: auto; }

.cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.cartao {
  background: var(--card); border-radius: var(--raio); padding: 1.8rem;
  box-shadow: var(--sombra); border: 1px solid var(--borda);
  transition: transform .3s cubic-bezier(.16,.8,.3,1), box-shadow .3s, border-color .3s;
}
.cartao:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(29, 78, 216, .16);
  border-color: #bfdbfe;
}
.cartao:hover .icone { transform: scale(1.08) rotate(-4deg); }
.cartao .icone {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #dbeafe, #e0f2fe); font-size: 1.4rem; margin-bottom: 1rem;
  transition: transform .3s cubic-bezier(.16,.8,.3,1);
}
.cartao h3 { font-size: 1.08rem; margin-bottom: .4rem; }
.cartao p { color: var(--texto-suave); font-size: .92rem; }

.faixa-contato { background: linear-gradient(135deg, var(--azul-900), var(--azul-800)); color: #fff; }
.faixa-contato .secao-titulo h2, .faixa-contato .secao-titulo p { color: #fff; }
.faixa-contato .secao-titulo p { color: #b6c3dd; }
.contato-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; }
.contato-item { background: rgba(255,255,255,.07); border-radius: 12px; padding: 1.2rem 1.4rem; }
.contato-item strong { display: block; color: #7dd3fc; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .3rem; }
.contato-item, .contato-item a { color: #eaf1fb; }
.contato-item a { text-decoration: none; transition: color .15s; }
.contato-item a:hover { color: #7dd3fc; text-decoration: underline; }

.rodape { background: #060f24; color: #64748b; text-align: center; padding: 1.6rem 0; font-size: .85rem; }

/* ---------- Botão flutuante do WhatsApp ---------- */
.whatsapp-flutuante {
  position: fixed; right: 1.4rem; bottom: 1.4rem; z-index: 90;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #25d366, #128c7e);
  box-shadow: 0 8px 24px rgba(18, 140, 126, .45);
  transition: transform .2s ease, box-shadow .2s ease;
  animation: whats-pulso 2.4s ease-out infinite;
}
.whatsapp-flutuante:hover { transform: scale(1.1); box-shadow: 0 10px 28px rgba(18, 140, 126, .6); }
.whatsapp-flutuante svg { width: 32px; height: 32px; }
@keyframes whats-pulso {
  0%   { box-shadow: 0 8px 24px rgba(18,140,126,.45), 0 0 0 0 rgba(37,211,102,.55); }
  70%  { box-shadow: 0 8px 24px rgba(18,140,126,.45), 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 8px 24px rgba(18,140,126,.45), 0 0 0 0 rgba(37,211,102,0); }
}
@media (prefers-reduced-motion: reduce) { .whatsapp-flutuante { animation: none; } }

/* ============================================================
   ANIMAÇÕES — revelar ao rolar
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .7s cubic-bezier(.16,.8,.3,1),
              transform .7s cubic-bezier(.16,.8,.3,1);
  will-change: opacity, transform;
}
.reveal.visivel { opacity: 1; transform: none; }

/* variações de direção */
.reveal.da-esquerda { transform: translateX(-40px); }
.reveal.da-direita  { transform: translateX(40px); }
.reveal.da-esquerda.visivel,
.reveal.da-direita.visivel { transform: none; }

/* efeito escalonado dentro de um grupo (cards, stats…) */
.reveal-grupo > * {
  opacity: 0;
  transform: translateY(30px) scale(.98);
  transition: opacity .6s ease, transform .6s cubic-bezier(.16,.8,.3,1);
}
.reveal-grupo.visivel > * { opacity: 1; transform: none; }
.reveal-grupo.visivel > *:nth-child(1) { transition-delay: .05s; }
.reveal-grupo.visivel > *:nth-child(2) { transition-delay: .13s; }
.reveal-grupo.visivel > *:nth-child(3) { transition-delay: .21s; }
.reveal-grupo.visivel > *:nth-child(4) { transition-delay: .29s; }
.reveal-grupo.visivel > *:nth-child(5) { transition-delay: .37s; }
.reveal-grupo.visivel > *:nth-child(6) { transition-delay: .45s; }

/* respeita quem prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal-grupo > * { opacity: 1 !important; transform: none !important; transition: none; }
}

/* ---------- Modal de login ---------- */
.modal-fundo {
  position: fixed; inset: 0; background: rgba(2, 6, 23, .6); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 100;
}
.modal-fundo { opacity: 0; transition: opacity .25s ease; }
.modal-fundo.aberto { display: flex; opacity: 1; }
.modal {
  background: #fff; border-radius: 18px; padding: 2.2rem; width: min(400px, 92vw);
  box-shadow: 0 25px 60px rgba(0,0,0,.3); position: relative;
  transform: translateY(20px) scale(.96); opacity: 0;
  transition: transform .3s cubic-bezier(.16,.8,.3,1), opacity .3s;
}
.modal-fundo.aberto .modal { transform: none; opacity: 1; }
.modal h2 { margin-bottom: .3rem; font-size: 1.35rem; }
.modal-logo { display: block; width: min(240px, 70%); margin: 0 auto 1.2rem; }
.modal > p { color: var(--texto-suave); font-size: .9rem; margin-bottom: 1.4rem; }
.modal-fechar {
  position: absolute; top: 1rem; right: 1rem; background: #f1f5f9; border: none;
  width: 32px; height: 32px; border-radius: 50%; font-size: 1rem; color: var(--texto-suave);
}

/* ---------- Formulários ---------- */
.campo { margin-bottom: 1rem; }
.campo label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .35rem; color: #334155; }
.campo input, .campo select, .campo textarea {
  width: 100%; padding: .65rem .85rem; border: 1.5px solid var(--borda); border-radius: 10px;
  background: #fbfcfe; transition: border-color .15s;
}
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none; border-color: var(--azul-500); background: #fff;
}
.campo .dica { font-size: .78rem; color: var(--texto-suave); margin-top: .25rem; }
.form-linha { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-linha-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.erro-msg { color: var(--vermelho); font-size: .85rem; margin-top: .5rem; display: none; }
.erro-msg.visivel { display: block; }

/* ============================================================
   ÁREA ADMINISTRATIVA
   ============================================================ */
.admin-corpo { display: flex; min-height: 100vh; }

.lateral {
  width: 240px; flex-shrink: 0;
  background: linear-gradient(180deg,
    #ffffff 0%, #ffffff 92px,
    #60a5fa 140px, var(--azul-800) 230px, #0a1a38 100%);
  color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.lateral .marca { padding: 1rem 1.2rem; justify-content: center; display: flex; }
.lateral .marca-logo { height: 56px; }
.lateral nav { flex: 1; padding: 1rem .8rem; display: flex; flex-direction: column; gap: .3rem; }
.nav-item {
  display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: 10px;
  color: #dbeafe; font-size: .92rem; font-weight: 500; background: none; border: none; text-align: left;
  text-shadow: 0 1px 2px rgba(11,28,61,.3);
}
.nav-item:hover { background: rgba(255,255,255,.12); color: #fff; }
.nav-item.ativo { background: linear-gradient(135deg, rgba(59,130,246,.25), rgba(14,165,233,.18)); color: #fff; }
.lateral .sair { margin: 1rem .8rem; }

.principal { flex: 1; padding: 2rem 2.4rem; min-width: 0; }
.principal-topo { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.8rem; flex-wrap: wrap; gap: 1rem; }
.principal-topo h1 { font-size: 1.5rem; }
.principal-topo .sub { color: var(--texto-suave); font-size: .9rem; }

.paine { display: none; }
.paine.ativo { display: block; }

/* Dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; margin-bottom: 2rem; }
.stat-cartao {
  background: var(--card); border-radius: var(--raio); padding: 1.4rem 1.6rem;
  box-shadow: var(--sombra); border: 1px solid var(--borda);
}
.stat-cartao .rotulo { font-size: .82rem; color: var(--texto-suave); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-cartao .valor { font-size: 1.7rem; font-weight: 700; margin-top: .3rem; }
.stat-cartao.destaque { background: linear-gradient(135deg, var(--azul-700), var(--ciano)); border: none; }
.stat-cartao.destaque .rotulo, .stat-cartao.destaque .valor { color: #fff; }

/* Painéis / tabelas */
.painel-cartao {
  background: var(--card); border-radius: var(--raio); box-shadow: var(--sombra);
  border: 1px solid var(--borda); overflow: hidden; margin-bottom: 1.6rem;
}
.painel-cabecalho {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--borda); flex-wrap: wrap; gap: .8rem;
}
.painel-cabecalho h2 { font-size: 1.05rem; }
.painel-conteudo { padding: 1.4rem; }

.tabela-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: .8rem 1.4rem; background: #f8fafc; color: var(--texto-suave); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--borda); white-space: nowrap; }
td { padding: .85rem 1.4rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }
.vazio { text-align: center; color: var(--texto-suave); padding: 2.5rem 1rem !important; }

.etiqueta { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.etiqueta-verde { background: #dcfce7; color: var(--verde); }
.etiqueta-azul { background: #dbeafe; color: var(--azul-700); }
.etiqueta-ambar { background: #fef3c7; color: var(--ambar); }

.acoes-celula { display: flex; gap: .4rem; flex-wrap: wrap; }

/* Fieldsets do cadastro */
fieldset {
  border: 1.5px solid var(--borda); border-radius: 12px;
  padding: 1.2rem 1.4rem 1rem; margin-bottom: 1.4rem;
}
legend { font-weight: 700; font-size: .92rem; color: var(--azul-700); padding: 0 .5rem; }

/* Upload de documentos */
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.doc-caixa {
  border: 2px dashed var(--borda); border-radius: 12px; padding: 1rem; text-align: center;
  transition: border-color .15s; position: relative;
}
.doc-caixa:hover { border-color: var(--azul-500); }
.doc-caixa.tem-arquivo { border-style: solid; border-color: #bbf7d0; background: #f0fdf4; }
.doc-caixa .doc-titulo { font-size: .85rem; font-weight: 600; margin-bottom: .5rem; }
.doc-caixa input[type=file] { display: none; }
.doc-caixa .doc-status { font-size: .78rem; color: var(--texto-suave); margin-top: .45rem; word-break: break-all; }
.doc-caixa .doc-acoes { display: flex; gap: .4rem; justify-content: center; margin-top: .55rem; flex-wrap: wrap; }
.doc-mini { max-height: 70px; border-radius: 8px; margin-top: .4rem; }

/* Visualizador de documento */
.visor-doc { width: min(860px, 94vw); max-height: 92vh; display: flex; flex-direction: column; }
.visor-doc .corpo { flex: 1; overflow: auto; margin-top: 1rem; text-align: center; }
.visor-doc img { max-width: 100%; border-radius: 10px; }
.visor-doc iframe { width: 100%; height: 70vh; border: none; border-radius: 10px; }

/* OS - resumo financeiro */
.resumo-financeiro {
  background: #f0f9ff; border: 1.5px solid #bae6fd; border-radius: 12px;
  padding: 1rem 1.4rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; margin-bottom: 1.4rem;
}
.resumo-financeiro div span { display: block; font-size: .78rem; color: var(--texto-suave); font-weight: 600; }
.resumo-financeiro div strong { font-size: 1.15rem; }
.positivo { color: var(--verde); }
.negativo { color: var(--vermelho); }

.aviso-local {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 10px; padding: .7rem 1rem; font-size: .83rem; margin-bottom: 1.2rem;
}

/* Toast */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200;
  background: #0f172a; color: #fff; padding: .85rem 1.3rem; border-radius: 12px;
  font-size: .9rem; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  opacity: 0; transform: translateY(10px); transition: .25s; pointer-events: none;
}
.toast.visivel { opacity: 1; transform: translateY(0); }
.toast.sucesso { background: var(--verde); }
.toast.erro { background: var(--vermelho); }

/* ============================================================
   IMPRESSÃO DA ORDEM DE SERVIÇO
   ============================================================ */
.os-impressao { display: none; }

@media print {
  body * { visibility: hidden; }
  .os-impressao, .os-impressao * { visibility: visible; }
  .os-impressao {
    display: block !important; position: absolute; inset: 0;
    background: #fff; padding: 2rem; font-size: 12pt; color: #000;
  }
  .os-imp-topo { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid #1d4ed8; padding-bottom: 1rem; margin-bottom: 1.5rem; }
  .os-imp-topo h1 { font-size: 1.5rem; color: #1d4ed8; }
  .os-imp-topo .num { font-size: 1.1rem; font-weight: 700; }
  .os-imp-tabela { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; }
  .os-imp-tabela th, .os-imp-tabela td { border: 1px solid #cbd5e1; padding: .55rem .8rem; text-align: left; }
  .os-imp-tabela th { background: #eff6ff !important; width: 38%; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .os-imp-assinaturas { display: flex; gap: 3rem; margin-top: 4rem; }
  .os-imp-assinaturas div { flex: 1; border-top: 1.5px solid #000; padding-top: .4rem; text-align: center; font-size: .85rem; }
}

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-cartao { display: none; }
  .menu a:not(.btn) { display: none; }
  .admin-corpo { flex-direction: column; }
  .lateral {
    width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto;
    background: linear-gradient(90deg,
      #ffffff 0%, #ffffff 235px,
      #60a5fa 36%, var(--azul-800) 60%, var(--azul-900) 100%);
  }
  .lateral .marca { border: none; white-space: nowrap; }
  .lateral nav { flex-direction: row; padding: .6rem; }
  .nav-item { white-space: nowrap; }
  .lateral .sair { margin: .6rem; white-space: nowrap; }
  .principal { padding: 1.4rem 1rem; }
  .form-linha, .form-linha-3 { grid-template-columns: 1fr; }
}
