/* ============================
   Simulador de Operações (Gmais Sistemas) – tema Dourado + Verde + Branco
   ============================ */

/* etapas do formulário (wizard) */
.sop-step {
  display: none;
}
.sop-step.is-active {
  display: block;
}

/* Layout Base */
.sop-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  font-family: "Inter", system-ui, sans-serif;
  color: #222;
  background: #fff;
}

/* Títulos */
.sop-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: #0a5c42; /* verde principal */
}
.sop-sub {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* ============================
   Tabs (Resultados / Gráficos / Simulações)
   ============================ */
.sop-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
  border-bottom: 2px solid #eee;
  overflow-x: auto;
}
.sop-tab {
  padding: 0.6rem 1.2rem;
  background: #fff;
  border: 1px solid #f0dca7;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
  white-space: nowrap;
  color: #0a5c42;
}

/* hover VERDE nas abas */
.sop-tab:hover {
  background: linear-gradient(135deg, #0a5c42, #128a5c);
  color: #fff;
  border-color: #0a5c42;
}

.sop-tab.is-active {
  /* dourado com leve gradiente */
  background: linear-gradient(135deg, #c9a227, #e6c85b);
  color: #fff;
  border-color: #c9a227;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Painéis */
.sop-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}
.sop-panel.is-active {
  display: block;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================
   Cards
   ============================ */
.sop-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}
.sop-card-title {
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: #c9a227; /* dourado */
  border-left: 4px solid #0a5c42; /* verde */
  padding-left: 8px;
}

/* ============================
   Resumo do cenário (topo dos resultados)
   ============================ */
.sop-summary {
  border-left: 4px solid #0a5c42;
}
.sop-summary-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sop-summary-title {
  font-size: 1.05rem;
  color: #0a5c42;
  margin-bottom: 4px;
}
.sop-summary-sub {
  color: #6b7280;
  font-size: 0.9rem;
}
.sop-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sop-summary-section {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 10px;
}
.sop-summary-section > summary {
  cursor: pointer;
  font-weight: 700;
  color: #0a5c42;
  list-style: none;
}
.sop-summary-section > summary::-webkit-details-marker { display: none; }
.sop-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 12px;
  margin-top: 10px;
}
.sop-summary-item {
  border: 1px solid #eee;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
}
.sop-summary-k {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 4px;
}
.sop-summary-v {
  font-weight: 700;
  color: #111827;
}

@media (max-width: 768px) {
  .sop-summary-head {
    flex-direction: column;
    align-items: stretch;
  }
  .sop-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================
   Grid de inputs – Tema Dourado e Verde
   ============================ */
.sop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.sop-grid label {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  min-height: 65px;
  justify-content: space-between;
  color: #0a5c42; /* verde principal para texto */
}

.sop-grid label span {
  line-height: 1.3;
  word-break: break-word;
}

.sop-grid input,
.sop-grid select {
  margin-top: 4px;
  padding: 0.55rem 0.7rem;
  border: 1px solid #d7d7d7; /* neutro padrão */
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
  color: #222;
  transition: all 0.25s ease;
}

/* quando estiver ativo (um único bloco) */
.sop-grid input:focus,
.sop-grid select:focus {
  outline: none;
  border: 2px solid #0a5c42; /* verde escuro */
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3); /* brilho dourado */
  background: #fffef8; /* leve tom quente ao fundo */
}

/* labels longos */
.sop-grid label[for*="suplemento"],
.sop-grid label[for*="consumo"],
.sop-grid label[for*="premiacao"] {
  min-height: 70px;
}

/* Tooltip de ajuda */
.sop-help {
  background: #c9a227; /* dourado */
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 0.7rem;
  margin-left: 4px;
  cursor: help;
}

/* ============================
   Botões
   ============================ */
.sop-actions {
  margin-top: 1rem;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sop-btn {
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.2s;
  background: #fff;
  border: 1px solid #f0dca7;
  color: #0a5c42;
}

/* botão principal */
.sop-btn.primary {
  background: linear-gradient(135deg, #c9a227, #e6c85b);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 10px rgba(201, 162, 39, 0.25);
}

/* hover do botão principal → VERDE */
.sop-btn.primary:hover {
  background: linear-gradient(135deg, #0a5c42, #128a5c);
  border-color: #0a5c42;
  color: #fff;
}

/* botão fantasma */
.sop-btn.ghost {
  background: #f5f5f5;
  color: #333;
}
.sop-btn.ghost:hover {
  background: #e0e0e0;
}

/* ============================
   Tabela de resultados e cenários
   ============================ */
.sop-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.8rem;
  font-size: 0.95rem;
  background: #fff;
  border: 1px solid #f0dca7;
}
.sop-table thead {
  background: #fff8e4;
}
.sop-table td,
.sop-table th {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #f7ebcc;
}
.sop-table tr:nth-child(even) {
  background: #fffdf7;
}

/* ============================
   Gráficos
   ============================ */
.sop-grid-graphs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}
canvas {
  width: 100% !important;
  height: auto !important;
}

/* ============================
   Inputs numéricos
   ============================ */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* ============================
   Responsividade
   ============================ */
@media (max-width: 900px) {
  .sop-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 550px) {
  .sop-grid {
    grid-template-columns: 1fr;
  }
  .sop-tab {
    font-size: 0.85rem;
    padding: 0.45rem 0.8rem;
  }
}

/* --- Mobile UX: abas sticky + FAB --- */
@media (max-width: 768px) {
  .sop-tabs {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    margin: 0 -1rem 10px;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  }
}

/* Botão flutuante para alternar Resultados ↔ Gráficos (mostra só no mobile) */
#sop-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 0.7rem 1rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #c9a227, #e6c85b);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(201, 162, 39, 0.35);
}
#sop-fab:active {
  transform: translateY(1px);
}

/* garante que nada do tema sobreponha */
.sop-wrap * {
  box-sizing: border-box;
}

/* === Abas com bordas e texto verdes === */
.sop-wrap .sop-tabs {
  border-bottom: 2px solid #f0dca7;
}

.sop-wrap .sop-tab {
  background: #fff;
  border: 1px solid #0a5c42; /* verde */
  border-bottom: none;
  color: #0a5c42; /* verde escuro */
  transition: all 0.25s ease;
}

/* Hover verde mais intenso */
.sop-wrap .sop-tab:hover {
  background: linear-gradient(135deg, #0a5c42, #128a5c);
  color: #fff;
  border-color: #0a5c42;
}

/* Aba ativa dourada */
.sop-wrap .sop-tab.is-active {
  background: linear-gradient(135deg, #c9a227, #e6c85b);
  color: #fff;
  border-color: #c9a227;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.sop-step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.4rem;
  color: #c9a227;
  border-left: 4px solid #0a5c42;
  padding-left: 10px;
  margin-bottom: 1rem;
}

.sop-step-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.sop-wrap {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

body,
.elementor,
.elementor-section {
  background: #fff !important;
}

/* ===== BOTÕES ===== */
.sop-btn {
  border-radius: 6px;
  font-weight: 600;
  padding: 10px 22px;
  font-size: 0.95rem;
  transition: all 0.2s ease-in-out;
}

/* Primário – Gerar Resultados */
.sop-btn.primary {
  background: #c9a227;
  color: #fff;
  border: none;
}
.sop-btn.primary:hover {
  background: #b8921f;
}

/* Secundário – Voltar */
.sop-btn.ghost {
  background: #fff;
  border: 1px solid #c9a227;
  color: #0a5c42;
}
.sop-btn.ghost:hover {
  background: #fdf6e1;
}

/* Neutro – Resetar */
.sop-btn.neutral {
  background: #f2f2f2;
  border: 1px solid #ddd;
  color: #444;
}
.sop-btn.neutral:hover {
  background: #e6e6e6;
}

/* Ação especial – Salvar Cenário */
#sop-save {
  background: #fff;
  border: 1px solid #c30e2e;
  color: #c30e2e;
}
#sop-save:hover {
  background: #ffe9ed;
}

/* ===== ABAS ===== */
.sop-tabs {
  display: flex;
  gap: 8px;
  border: none;
  background: none;
}

.sop-tab {
  background: #fff;
  color: #0a5c42;
  border: 1px solid #c9a227;
  border-radius: 4px 4px 0 0;
  font-weight: 600;
  padding: 8px 18px;
  transition: all 0.2s ease-in-out;
}

.sop-tab:hover {
  background: #fdf6e1;
}

.sop-tab.is-active {
  background: #c9a227;
  color: #fff;
  border: 1px solid #c9a227;
}

/* ===== AJUSTES GERAIS ===== */
.sop-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sop-cards-wrap {
  margin-top: .8rem;
}

.sop-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
}

.sop-card.soft {
  background: #ffffff;
  border: 1px solid #eef1f1;
  border-radius: 14px;
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.03);
}

.sop-card-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .8rem;
}

.sop-card-head h4 {
  margin: 0;
  font-size: .96rem;
  color: #0a5c42;
  font-weight: 600;
}

.sop-card-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(201,162,39,.12);
  border-radius: 10px;
  font-size: 1rem;
}

.sop-card-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sop-card-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .35rem 0;
  border-bottom: 1px solid #f3f3f3;
  font-size: .87rem;
}

.sop-card-list li:last-child {
  border-bottom: none;
}

.sop-card-list li span {
  color: #4a4a4a;
}

.sop-card-list li strong {
  color: #111;
}

.sop-card-list li.total strong {
  color: #0a5c42;
  font-weight: 700;
}

.sop-card-list li strong.pos { color: #0a5c42; }
.sop-card-list li strong.neg { color: #d9534f; }

@media (max-width: 600px){
  .sop-cards-grid {
    grid-template-columns: 1fr;
  }
}
