/* Sistema de Tickets P&D - GRUPO FAJ | Formulario publico */

:root {
  --azul: #0f3460;
  --azul-claro: #1a5490;
  --acento: #e94560;
  --ok: #2f9e44;
  --alerta: #f08c00;
  --texto: #1a202c;
  --texto-fraco: #64748b;
  --borda: #e2e8f0;
  --fundo: #f1f5f9;
  --branco: #fff;
  --raio: 10px;
  --sombra: 0 1px 3px rgba(15, 52, 96, .08), 0 4px 16px rgba(15, 52, 96, .06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--fundo);
  color: var(--texto);
  line-height: 1.55;
}

.container { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.oculto { display: none !important; }

/* ------------------------------------------------------------------ topo */
.topo {
  background: linear-gradient(135deg, var(--azul), var(--azul-claro));
  color: var(--branco);
  padding: 22px 0;
  margin-bottom: 28px;
}
.topo-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.marca { display: flex; align-items: center; gap: 14px; }
.marca-logo {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .25);
  padding: 8px 12px; border-radius: 8px; font-weight: 700; letter-spacing: 1px;
}
.topo h1 { font-size: 1.25rem; font-weight: 600; }
.topo p { font-size: .85rem; opacity: .85; }

/* --------------------------------------------------------------- cartao */
.cartao {
  background: var(--branco);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  padding: 8px 28px 28px;
  margin-bottom: 40px;
}
.bloco { padding: 22px 0; border-bottom: 1px solid var(--borda); }
.bloco:last-of-type { border-bottom: 0; }
.bloco-titulo {
  font-size: .95rem; font-weight: 700; color: var(--azul);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 16px;
}
.opcional { font-weight: 400; text-transform: none; color: var(--texto-fraco); }

/* --------------------------------------------------------------- campos */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.campo { margin-bottom: 16px; }
.campo:last-child { margin-bottom: 0; }

label {
  display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px;
}
.req { color: var(--acento); }

input[type="text"], input[type="email"] {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--borda); border-radius: 8px;
  font-size: .95rem; font-family: inherit; background: var(--branco);
  transition: border-color .15s, box-shadow .15s;
}
input:focus {
  outline: none; border-color: var(--azul-claro);
  box-shadow: 0 0 0 3px rgba(26, 84, 144, .12);
}

.ajuda { display: block; font-size: .8rem; color: var(--texto-fraco); margin-top: 6px; }
.ajuda.alerta { color: var(--alerta); font-weight: 600; }
.erro { display: block; font-size: .8rem; color: var(--acento); margin-top: 5px; }

/* ----------------------------------------------------------- categorias */
.categorias {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px;
}
.categoria {
  display: flex; flex-direction: column; gap: 3px;
  padding: 16px; text-align: left; cursor: pointer;
  background: var(--branco); border: 2px solid var(--borda);
  border-radius: var(--raio); font-family: inherit;
  transition: border-color .15s, background .15s, transform .1s;
}
.categoria:hover { border-color: var(--azul-claro); transform: translateY(-1px); }
.categoria.ativa { border-color: var(--azul); background: #f0f6ff; }
.categoria-icone { font-size: 1.5rem; }
.categoria-nome { font-weight: 600; font-size: .9rem; color: var(--texto); }
.categoria-desc { font-size: .78rem; color: var(--texto-fraco); }

/* ------------------------------------------------------------- editor */
#editor { height: 200px; background: var(--branco); }
.ql-toolbar.ql-snow, .ql-container.ql-snow { border-color: var(--borda); }
.ql-toolbar.ql-snow { border-radius: 8px 8px 0 0; }
.ql-container.ql-snow { border-radius: 0 0 8px 8px; font-size: .95rem; }

/* textarea de fallback, quando o editor rico nao carrega */
.form-textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--borda);
  border-radius: 8px; font-family: inherit; font-size: .95rem;
  line-height: 1.5; resize: vertical; min-height: 180px;
}
.form-textarea:focus {
  outline: none; border-color: var(--azul-claro);
  box-shadow: 0 0 0 3px rgba(26, 84, 144, .12);
}

/* ------------------------------------------------------------ dropzone */
.dropzone {
  border: 2px dashed var(--borda); border-radius: var(--raio);
  padding: 30px 20px; text-align: center; cursor: pointer;
  background: #fafbfc; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone:focus, .dropzone.ativa {
  border-color: var(--azul-claro); background: #f0f6ff; outline: none;
}
.dropzone-icone { font-size: 1.8rem; color: var(--azul-claro); }
.dropzone-texto { font-size: .92rem; margin-top: 6px; }
.dropzone-limites { font-size: .78rem; color: var(--texto-fraco); margin-top: 8px; }

.lista-anexos { list-style: none; margin-top: 14px; display: grid; gap: 8px; }
.anexo {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #f8fafc;
  border: 1px solid var(--borda); border-radius: 8px; font-size: .875rem;
}
.anexo-icone { font-size: 1.1rem; }
.anexo-nome {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.anexo-tamanho { color: var(--texto-fraco); font-size: .8rem; }
.anexo-remover {
  border: 0; background: transparent; color: var(--acento);
  font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 4px;
}
.anexo-remover:hover { color: #b91c3c; }

/* -------------------------------------------------------------- acoes */
.acoes { padding-top: 22px; display: flex; justify-content: flex-end; }

.btn-primario, .btn-secundario, .btn-ghost {
  font-family: inherit; font-size: .95rem; font-weight: 600;
  padding: 12px 26px; border-radius: 8px; cursor: pointer; border: 0;
  transition: background .15s, opacity .15s;
}
.btn-primario { background: var(--azul); color: var(--branco); }
.btn-primario:hover:not(:disabled) { background: var(--azul-claro); }
.btn-primario:disabled { opacity: .6; cursor: not-allowed; }
.btn-secundario {
  background: var(--branco); color: var(--texto); border: 1px solid var(--borda);
}
.btn-secundario:hover { background: var(--fundo); }
.btn-ghost {
  background: rgba(255, 255, 255, .14); color: var(--branco);
  border: 1px solid rgba(255, 255, 255, .3); padding: 9px 16px; font-size: .85rem;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .24); }

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: var(--branco);
  border-radius: 50%; animation: girar .7s linear infinite; vertical-align: -2px;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------- progresso */
.barra-progresso {
  margin-top: 16px; background: var(--borda); border-radius: 999px;
  height: 22px; position: relative; overflow: hidden;
}
.barra-progresso-fill {
  height: 100%; width: 0; background: linear-gradient(90deg, var(--azul), var(--azul-claro));
  transition: width .2s;
}
.barra-progresso-label {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: .75rem; font-weight: 600; color: var(--texto);
}

/* --------------------------------------------------------------- modal */
.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 100;
}
.modal-caixa {
  background: var(--branco); border-radius: 12px; padding: 32px;
  max-width: 460px; width: 100%; text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.modal-caixa h2 { font-size: 1.2rem; margin-bottom: 10px; }
.modal-caixa p { font-size: .9rem; color: var(--texto-fraco); margin-bottom: 12px; }
.modal-icone {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700; color: var(--branco);
}
.modal-icone.ok { background: var(--ok); }
.modal-icone.erro { background: var(--acento); }
.modal-acoes { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-caixa .campo { text-align: left; }

.protocolo {
  font-family: "Consolas", "Courier New", monospace; font-size: 1.4rem;
  font-weight: 700; color: var(--azul); letter-spacing: 1px;
  background: var(--fundo); padding: 14px; border-radius: 8px; margin: 12px 0 16px;
}

.consulta-resultado { text-align: left; margin-top: 14px; }
.consulta-linha {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--borda); font-size: .875rem;
}
.consulta-linha span { color: var(--texto-fraco); }

.pill {
  padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600;
  background: var(--fundo); color: var(--texto);
}
.pill-recebido { background: #e0e7ff; color: #3730a3; }
.pill-em_analise { background: #fef3c7; color: #92400e; }
.pill-aprovado { background: #dbeafe; color: #1e40af; }
.pill-em_desenvolvimento { background: #cffafe; color: #0e7490; }
.pill-em_homologacao { background: #f3e8ff; color: #6b21a8; }
.pill-concluido { background: #dcfce7; color: #166534; }
.pill-reprovado { background: #fee2e2; color: #991b1b; }
.pill-cancelado { background: #e5e7eb; color: #4b5563; }

@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .cartao { padding: 8px 18px 22px; }
  .topo-inner { flex-direction: column; align-items: flex-start; }
}
