/* ============================================
   PORTAL JCHD — Estilos customizados
   Completa o Tailwind com animações e componentes específicos
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Cormorant+Garamond:ital,wght@1,400;1,500&display=swap');

:root {
  --pine-50:  #f2ede4;
  --pine-100: #e8ddcf;
  --pine-200: #dcc9b0;
  --pine-300: #cba67b;
  --pine-400: #b8966a;
  --pine-500: #b8966a;
  --pine-600: #8c6e48;
  --pine-700: #25473d;
  --pine-800: #171411;
  --pine-900: #0e0e0e;
  --gold:     #b8966a;
  --bg:       #eeecef;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: 'DM Sans', system-ui, sans-serif;
}

/* ── Loading ──────────────────────────────── */
#loading-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  transition: opacity 0.4s ease;
}
#loading-screen.fade-out {
  opacity: 0; pointer-events: none;
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--pine-200);
  border-top-color: var(--pine-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Nav ──────────────────────────────────── */
#nav-bar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(238,236,239,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--pine-100);
}
.nav-link {
  font-size: 0.75rem; font-weight: 500;
  color: var(--pine-600);
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-link:hover { background: var(--pine-100); color: var(--pine-800); }
.nav-link.active { background: var(--pine-500); color: #fff; }

/* ── Status badge ─────────────────────────── */
.pkg-badge {
  font-size: 0.625rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--pine-700); color: #fff;
  padding: 0.2rem 0.6rem; border-radius: 9999px;
}

/* ── Quick nav cards ──────────────────────── */
.quick-card {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--pine-100);
  border-radius: 1rem;
  padding: 1rem 0.75rem;
  text-decoration: none;
  color: var(--pine-700);
  font-size: 0.75rem; font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(44,31,20,0.06);
}
.quick-card:hover {
  border-color: var(--pine-300);
  box-shadow: 0 4px 12px rgba(44,31,20,0.12);
  transform: translateY(-1px);
}
.quick-card .icon { font-size: 1.5rem; }

/* ── Timeline ─────────────────────────────── */
.timeline-list { position: relative; }
.timeline-list::before {
  content: '';
  position: absolute; left: 1.1rem; top: 1.5rem; bottom: 1.5rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--pine-200), var(--pine-100));
}
.phase-card {
  position: relative;
  display: flex; gap: 1rem;
  background: #fff;
  border: 1px solid var(--pine-100);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.phase-card:hover { box-shadow: 0 4px 16px rgba(44,31,20,0.1); }
.phase-card.active-phase { border-color: var(--pine-300); }

.phase-dot {
  flex-shrink: 0;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--pine-200);
  position: relative; z-index: 1;
}
.phase-dot.concluida     { background: var(--pine-700); }
.phase-dot.em_andamento  { background: #b8966a; }
.phase-dot.aguardando    { background: #b58427; }
.phase-dot.nao_iniciada  { background: #cfccc7; }
.phase-dot.prazo_estendido { background: #8c2e1f; }

.phase-num {
  font-size: 0.625rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--pine-400);
}

/* ── Approval buttons ─────────────────────── */
.btn-approve {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--pine-500); color: #fff;
  font-size: 0.8rem; font-weight: 500;
  padding: 0.5rem 1rem; border-radius: 0.5rem;
  border: none; cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-approve:hover { background: var(--pine-600); transform: translateY(-1px); }
.btn-approve:active { transform: translateY(0); }

.btn-adjust {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: #fff; color: var(--pine-700);
  font-size: 0.8rem; font-weight: 500;
  padding: 0.5rem 1rem; border-radius: 0.5rem;
  border: 1.5px solid var(--pine-300); cursor: pointer;
  transition: all 0.2s;
}
.btn-adjust:hover { background: var(--pine-50); border-color: var(--pine-500); }

/* ── Accordion (Neurobriefing) ────────────── */
.accordion-btn {
  width: 100%; text-align: left;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  background: none; border: none; cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1.1rem; font-weight: 500;
  color: var(--pine-800);
  transition: color 0.2s;
}
.accordion-btn:hover { color: var(--pine-600); }
.accordion-chevron {
  flex-shrink: 0; font-size: 0.75rem; color: var(--pine-400);
  transition: transform 0.3s ease;
}
.accordion-item.open .accordion-chevron { transform: rotate(180deg); }
.accordion-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.35s ease, padding 0.2s ease;
  padding: 0 1.25rem;
  color: #4a4742; line-height: 1.7;
}
.accordion-item.open .accordion-body {
  max-height: 500px;
  padding: 0 1.25rem 1.25rem;
}

/* ── File cards ───────────────────────────── */
.file-card {
  display: flex; align-items: center; gap: 0.875rem;
  background: #fff; border: 1px solid var(--pine-100);
  border-radius: 0.875rem; padding: 1rem 1.125rem;
  text-decoration: none; color: inherit;
  transition: all 0.2s;
}
.file-card.available:hover {
  border-color: var(--pine-300);
  box-shadow: 0 4px 12px rgba(44,31,20,0.1);
}
.file-card.locked { opacity: 0.55; cursor: default; }
.file-icon { font-size: 1.5rem; flex-shrink: 0; }
.file-name { font-weight: 500; font-size: 0.9rem; color: var(--pine-800); }
.file-desc { font-size: 0.75rem; color: #6e6a63; margin-top: 0.125rem; }

/* ── Modal ────────────────────────────────── */
#modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease;
}
#modal-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

#modal-box {
  background: #fff; border-radius: 1.25rem;
  padding: 2rem; max-width: 380px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Toast ────────────────────────────────── */
#toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  z-index: 200;
  background: var(--pine-700); color: #fff;
  padding: 0.75rem 1.5rem; border-radius: 9999px;
  font-size: 0.875rem; font-weight: 500;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
#toast.show { opacity: 1; }
#toast.success { background: var(--pine-700); }
#toast.error   { background: #8c2e1f; }

/* ── Sections ─────────────────────────────── */
.section-card {
  background: #fff;
  border: 1px solid var(--pine-100);
  border-radius: 1.25rem;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 1px 4px rgba(44,31,20,0.04);
}
.section-title {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 1.6rem; font-weight: 500;
  color: var(--pine-800);
  margin-bottom: 0.25rem;
}
.section-subtitle {
  font-size: 0.875rem; color: #6e6a63;
  margin-bottom: 1.5rem;
}

/* ── Status legend chips ──────────────────── */
.legend-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; font-weight: 500;
  padding: 0.3rem 0.65rem; border-radius: 9999px;
}

/* ── CTA button ───────────────────────────── */
.btn-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: var(--pine-500); color: #fff;
  font-weight: 500; font-size: 0.9rem;
  padding: 0.75rem 1.5rem; border-radius: 0.75rem;
  text-decoration: none; border: none; cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  width: 100%;
}
.btn-cta:hover { background: var(--pine-600); transform: translateY(-1px); }

.btn-outline-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: #fff; color: var(--pine-700);
  font-weight: 500; font-size: 0.9rem;
  padding: 0.75rem 1.5rem; border-radius: 0.75rem;
  text-decoration: none;
  border: 1.5px solid var(--pine-300);
  cursor: pointer; transition: all 0.2s;
  width: 100%;
}
.btn-outline-cta:hover { background: var(--pine-50); border-color: var(--pine-500); }

/* ── Scrollbar (webkit) ───────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--pine-200); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: var(--pine-300); }

/* ── Utilities ────────────────────────────── */
.hidden { display: none !important; }
.divider { height: 1px; background: var(--pine-100); margin: 0.5rem 0; }
