/* ===== RESET & ROOT ===== */
:root {
  --accent: #ce440e;
  --accent2: #ff7b00;
  --accent-glow: rgb(255, 60, 0);
  --bg: #0d0d0d;
  --bg2: #141414;
  --bg3: #1c1c1c;
  --surface: #1a1a1a;
  --surface2: #222222;
  --border: rgba(255, 61, 0, 0.2);
  --text: #f0f0f0;
  --text-muted: #888;
  --text-dim: #555;
  --sidebar-w: 240px;
  --radius: 12px;
  --font-head: 'Russo One', sans-serif;
  --font-body: 'Lato', sans-serif;
  --transition: 0.22s ease;
}
[data-theme="light"] {
  --bg: #f5f5f5; --bg2: #ebebeb; --bg3: #e0e0e0;
  --surface: #ffffff; --surface2: #f0f0f0;
  --border: rgba(255,61,0,0.2); --text: #111; --text-muted: #555; --text-dim: #999;
}
[data-theme="red"] {
  --bg: #971919; --bg2: #311111; --bg3: #202020;
  --surface: #1a1a1a; --surface2: #1a1a1a; --border: rgba(5, 5, 5, 0.3);
}
[data-theme="orange"] {
  --bg: #ff6600; --bg2: #1f1f1f; --bg3: #1f1f1f;
  --surface: #1f1f1f; --surface2: #4b4540; --border: rgba(211, 209, 207, 0.3);
}
[data-theme="yellow"] {
  --bg: #72520e; --bg2: #111100; --bg3: #191900;
  --surface: #161600; --surface2: #1e1e00; --border: rgba(220,200,0,0.3);
  --accent: #d4a800; --accent2: #ffcc00;
}

* { margin:0; padding:0; box-sizing:border-box; font-family:var(--font-body); transition: background-color var(--transition), color var(--transition); }
body { background:var(--bg); color:var(--text); display:flex; height:100vh; overflow:hidden; }
a { color:inherit; text-decoration:none; }
input, select, button { font-family:var(--font-body); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width:6px; }
::-webkit-scrollbar-track { background:var(--bg2); }
::-webkit-scrollbar-thumb { background:var(--accent); border-radius:99px; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease, width 0.3s ease;
}
.sidebar-logo {
  padding: 24px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-logo .logo-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
  
}

/* 🚀 ícone do logo */
.logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* 🟢 status */
.status-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.sidebar-logo span {
  font-family: var(--font-head);
  font-size: 1.4rem;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* User mini card */
.sidebar-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 1.6rem; color: #fff;
  overflow: hidden; flex-shrink: 0;
  border: 2px solid var(--accent);
}
.sidebar-avatar img { width:100%; height:100%; object-fit:cover; }
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name { font-weight: 700; font-size: 0.9rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user-badge {
  font-size: 0.7rem; color: var(--accent2);
  display: flex; align-items: center; gap: 4px;
}

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.nav-group-label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--text-dim);
  padding: 12px 20px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px;
  color: var(--text-muted);
  cursor: pointer;
  border-left: 3px solid transparent;
  font-size: 0.88rem; font-weight: 600;
  position: relative;
}
.nav-item i { width: 18px; text-align: center; font-size: 1rem; }
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.active {
  color: #ffffff;
  border-left-color: var(--accent);
  background: rgb(170, 24, 24);
}
.nav-item.danger { color: #ff5555; }
.nav-item.danger:hover { background: rgba(255,80,80,0.08); color: #ff3333; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); font-size: 0.72rem; color: var(--text-dim); }

/* ===== MAIN ===== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  transition: margin-left 0.3s ease;
}
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between;
  backdrop-filter: blur(8px);
}
.topbar-title { font-family: var(--font-head); font-size: 1.4rem; }
.topbar-title span { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; padding: 4px 12px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 700; font-family: var(--font-head);
}
.hamburger-btn {
  display: block; background: none; border: none; color: var(--text);
  font-size: 1.4rem; cursor: pointer; padding: 4px;
}

/* ===== SIDEBAR MINIMIZADA — mini menu com ícones (apenas desktop) ===== */
@media (min-width: 769px) {
  body.sidebar-collapsed .sidebar { width: 76px; }
  body.sidebar-collapsed .main { margin-left: 76px; }

  /* esconde os textos, mantém logo, avatar e ícones */
  body.sidebar-collapsed .sidebar-logo span,
  body.sidebar-collapsed .sidebar-user-info,
  body.sidebar-collapsed .sidebar-footer,
  body.sidebar-collapsed .nav-group-label { display: none; }

  /* centraliza logo e avatar */
  body.sidebar-collapsed .sidebar-logo,
  body.sidebar-collapsed .sidebar-user {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
  }

  /* itens do menu viram só ícone, centralizado */
  body.sidebar-collapsed .nav-item {
    justify-content: center;
    gap: 0;
    font-size: 0;              /* remove o texto */
    padding: 12px 0;
    border-left-width: 0;
  }
  body.sidebar-collapsed .nav-item i { font-size: 1.15rem; }
  /* icones sao SVG (.ic) e usam 1em: com font-size:0 do item eles zeram.
     Fixa o tamanho em px para reaparecerem no menu colapsado. */
  body.sidebar-collapsed .nav-item .ic { width: 22px; height: 22px; }
}

/* Page */
.page { display: none; padding: 32px; animation: fadeUp 0.3s ease; }
.page.active { display: block; }
@keyframes fadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.card-title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 8px;
}

/* ===== PROFILE OVERVIEW ===== */
.profile-hero {
  display: flex; align-items: center; gap: 24px;
  background: linear-gradient(135deg, var(--surface), var(--bg3));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
/* glow do canto superior direito removido a pedido */
.profile-hero::before { content: none; }
.profile-big-avatar {
  width: 90px; height: 90px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 3rem; color: #fff;
  border: 3px solid var(--accent);
  overflow: hidden; flex-shrink: 0;
}
.profile-big-avatar img { width:100%; height:100%; object-fit:cover; }
.profile-hero-info h2 { font-family: var(--font-head); font-size: 1.6rem; }
.profile-hero-info p { color: var(--text-muted); margin-top: 4px; font-size: 0.9rem; }
.profile-stats { display: flex; gap: 20px; margin-top: 12px; }
.stat-chip {
  background: var(--bg3); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 99px;
  font-size: 0.78rem; color: var(--text-muted);
}
.stat-chip b { color: var(--accent); }

/* ===== FORM ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 0.78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.form-group input, .form-group select {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group select option { background: var(--bg3); }

/* Toggle CPF / CNPJ */
.doc-label {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.doc-toggle {
  display: inline-flex;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 2px;
}
.doc-opt {
  border: none; background: transparent; color: var(--text-muted);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.5px;
  padding: 3px 12px; border-radius: 99px; cursor: pointer;
  text-transform: uppercase; transition: background 0.2s, color 0.2s;
}
.doc-opt.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.form-group input[readonly] { opacity: 0.5; cursor: not-allowed; }

/* Input de data: texto na mesma cor dos demais campos (evita preto no fundo escuro) */
.form-group input[type="date"] { color: var(--text); }
.form-group input[type="date"]::-webkit-datetime-edit,
.form-group input[type="date"]::-webkit-datetime-edit-text,
.form-group input[type="date"]::-webkit-datetime-edit-month-field,
.form-group input[type="date"]::-webkit-datetime-edit-day-field,
.form-group input[type="date"]::-webkit-datetime-edit-year-field {
  color: var(--text);
}
.form-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.6;
  cursor: pointer;
}
/* No tema claro o ícone volta ao normal (senão fica branco no fundo claro) */
[data-theme="light"] .form-group input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
}

/* ===== CONFIGURAÇÕES: itens "Em breve" (bloqueados) ===== */
.settings-soon .toggle,
.settings-soon .settings-select { pointer-events: none; opacity: 0.45; cursor: not-allowed; }
.soon-badge {
  display: inline-block; margin-left: 8px; vertical-align: middle;
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  color: rgb(133, 132, 132); background:none;
  border: 1px solid rgb(133, 132, 132); padding: 2px 8px; border-radius: 20px;
}

/* ===== CARDS DE PROJETOS (Meus Projetos) ===== */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.proj-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 16px 16px 14px;
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.proj-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.28); }
.proj-card-top { display: flex; align-items: center; justify-content: space-between; }
.proj-status-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--bg3); border: 1px solid var(--border); color: var(--text); font-size: 13px; }
.proj-num { font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--text); background: var(--bg3); border: 1px solid var(--border); padding: 3px 10px; border-radius: 20px; }
.proj-nome { font-family: var(--font-head); font-size: 1.05rem; font-weight: 700; color: var(--text); line-height: 1.2; margin: 0; }
.proj-linhas { display: flex; flex-direction: column; gap: 7px; }
.proj-linha { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.82rem; }
.proj-linha > span { color: var(--text-muted); }
.proj-linha > b { color: var(--text); font-weight: 700; text-align: right; }
.proj-valor { display: inline-flex; align-items: center; gap: 8px; }
.proj-valor b { color: var(--text); font-weight: 800; letter-spacing: .5px; }
.proj-valor-mask { letter-spacing: 2px; }
.proj-eye { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 2px; font-size: 0.85rem; line-height: 1; transition: color .15s ease; }
.proj-eye:hover { color: var(--accent); }
.proj-acoes { display: flex; gap: 10px; margin-top: 2px; }
.proj-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 10px; border-radius: 10px; font-size: 0.82rem; font-weight: 700; cursor: pointer; border: 1px solid var(--border); background: var(--bg3); color: var(--text); transition: opacity .15s ease, background .15s ease; text-decoration: none; }
.proj-btn:hover { opacity: .85; }
.proj-btn[disabled] { opacity: .4; cursor: not-allowed; }
.proj-btn-dom { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; }
.proj-btn-pdf { background: var(--bg3); }

/* Estados */
.proj-ativo .proj-status-ic { color: #3aa0ff; }
.proj-pendente .proj-status-ic { color: #ff5d6c; }
.proj-concluido { border-color: #2ec77e; }
.proj-concluido .proj-status-ic { color: #2ec77e; border-color: #2ec77e; }
.proj-inativo { opacity: .5; }
.proj-cancelado { opacity: .5; border-color: #ff5d6c; }
.proj-cancelado .proj-status-ic { color: #ff5d6c; border-color: #ff5d6c; }

/* Card bloqueado (aguardando assinatura do cliente) */
.proj-locked .proj-body { filter: blur(6px); pointer-events: none; user-select: none; }
.proj-locked-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 16px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border-radius: 16px; backdrop-filter: blur(1px);
}
.proj-locked-overlay > i { font-size: 1.5rem; color: var(--accent); }
.proj-locked-overlay > p { font-size: 0.82rem; color: var(--text); max-width: 210px; }
.proj-assinar-btn {
  border: none; border-radius: 10px; padding: 9px 16px; cursor: pointer;
  font-weight: 800; font-size: 0.85rem; color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.proj-assinar-btn:hover { opacity: .9; }

/* ===== MODAL DE ASSINATURA ===== */
.sign-modal-bg {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.6);
  align-items: center; justify-content: center; padding: 20px;
}
.sign-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px; width: 100%; max-width: 560px;
  display: flex; flex-direction: column; gap: 12px;
}
.sign-modal-head { display: flex; align-items: center; justify-content: space-between; font-size: 1rem; font-weight: 700; color: var(--text); }
.sign-x { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }
.sign-x:hover { color: var(--text); }
.sign-hint { font-size: 0.8rem; color: var(--text-muted); }
.sign-canvas-wrap { position: relative; }
.sign-canvas { display: block; width: 100%; height: 260px; background: #fff; border: 2px dashed var(--border); border-radius: 12px; touch-action: none; cursor: crosshair; }
.sign-titulo { display: inline-flex; align-items: center; gap: 8px; }
.sign-head-btns { display: flex; align-items: center; gap: 10px; }
.sign-hint { display: flex; align-items: flex-start; gap: 8px; }
.sign-modal.full {
  position: fixed; inset: 0; width: 100vw; max-width: none; height: 100vh;
  max-height: none; border-radius: 0; z-index: 9999;
  display: flex; flex-direction: column;
}
.sign-modal.full .sign-canvas-wrap { flex: 1; }
.sign-modal.full .sign-canvas { height: 100%; }
/* linha guia — existe apenas no modal, não é desenhada no bitmap (não vai pro PDF) */
.sign-baseline { position: absolute; left: 26px; right: 26px; bottom: 60px; border-top: 2px solid #333; pointer-events: none; }
.sign-actions { display: flex; gap: 10px; }
.sign-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 10px; font-weight: 700; font-size: 0.85rem; cursor: pointer; border: 1px solid var(--border); }
.sign-btn-clear { background: var(--bg3); color: var(--text); }
.sign-btn-save { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; }
.sign-btn:hover { opacity: .9; }

/* Avatar upload */
.avatar-upload-area {
  display: flex; align-items: center; gap: 20px; margin-bottom: 24px;
}
.avatar-preview {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 2.5rem; color: #fff;
  border: 3px solid var(--accent); overflow: hidden;
}
.avatar-preview img { width:100%; height:100%; object-fit:cover; }
.avatar-btns { display: flex; flex-direction: column; gap: 8px; }
.btn-upload {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); padding: 8px 16px; border-radius: 8px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.btn-upload:hover { border-color: var(--accent); color: var(--accent); }

/* Buttons */
.btn-row { display: flex; gap: 12px; margin-top: 20px; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; padding: 11px 28px;
  border-radius: 8px; font-weight: 700; font-size: 0.9rem;
  cursor: pointer; font-family: var(--font-body);
  display: flex; align-items: center; gap: 8px;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-cancel {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text-muted); padding: 11px 28px;
  border-radius: 8px; font-weight: 700; font-size: 0.9rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-cancel:hover { border-color: var(--text-muted); color: var(--text); }

/* ===== SEALS / BADGES ===== */
.seals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.seal-card {
  background: var(--bg3);
  border: 2px solid var(--seal-color, var(--border));
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  position: relative;
  opacity: 0.5;
  cursor: pointer;
  transition: transform 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
}
/* hover: clareia + zoom, card inteiro clicavel -> PDF */
.seal-card:hover {
  opacity: 1;
  transform: translateY(-4px) scale(1.035);
  box-shadow: 0 12px 34px rgba(var(--seal-rgb, 255,61,0), 0.35);
}
.seal-card:hover .seal-link { text-decoration: none; }
.seal-card.active {
  opacity: 1;
  border-color: var(--seal-color, var(--accent));
}
.seal-card.current {
  opacity: 1;
  border-color: var(--seal-color, var(--accent));
}

.seal-img {
  display: flex;
  align-items: center;
  justify-content: center;
}

.seal-img img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.seal-img { width: 60px; height: 60px; border-radius: 50%;  margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.seal-name { font-family: var(--font-head); font-size: 1rem; margin-bottom: 6px; }
.seal-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }
.seal-link { color: var(--accent); font-size: 0.75rem; text-decoration: underline; cursor: pointer; margin-top: 6px; display: inline-block; }
.seal-badge-current {
  position: absolute; top: -10px; right: -10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: 0.62rem; font-weight: 700;
  padding: 3px 8px; border-radius: 99px;
  font-family: var(--font-head);
}
.seal-locked { font-size: 0.7rem; color: var(--text-dim); margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 4px; }

/* Fonte "Monday" (usada no ponto de interrogação do selo exclusivo) */
@font-face { font-family: 'Monday'; src: url('../fonts/MONDAY.TTF') format('truetype'); font-display: swap; }

/* ===== SELO MISTERIOSO (nível exclusivo / branco) ===== */
.seal-card.seal-mystery { --seal-rgb: 255,255,255; opacity: 1; overflow: hidden; border-color: #fff; box-shadow: none; }
.seal-mystery .seal-mystery-inner { filter: blur(8px); pointer-events: none; user-select: none; }
.seal-mystery-veil { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.seal-mystery-veil span {
  font-family: 'Monday', var(--font-head); font-size: 4rem; font-weight: 700; line-height: 1; color: #fff;
  text-shadow: 0 0 26px rgba(255,255,255,.7), 0 2px 10px rgba(0,0,0,.6);
}

/* ===== BOTÃO "Conferir condições" (canto inferior direito do selo) ===== */
.seal-conditions-row { display: flex; justify-content: flex-end; margin-top: 20px; }
.btn-condicoes {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px; text-decoration: none;
  font-family: var(--font-body); font-weight: 700; font-size: 0.85rem; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 4px 16px rgba(255,90,31,.35); border: none; cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.btn-condicoes:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-condicoes .ic { width: 16px; height: 16px; }

/* Progress bar */
.profile-progress-wrap { margin-bottom: 20px; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px; }
.progress-bar { height: 8px; background: var(--bg3); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 99px; transition: width 0.6s ease; }

/* ===== SETTINGS ===== */
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-info h4 { font-size: 0.9rem; font-weight: 700; }
.settings-info p { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.toggle-wrap { display: flex; align-items: center; gap: 8px; }
.toggle {
  width: 44px; height: 24px; background: var(--bg3);
  border-radius: 99px; cursor: pointer; position: relative;
  border: 1px solid var(--border); transition: background 0.3s;
}
.toggle.on { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.toggle-knob {
  width: 18px; height: 18px; background: #fff; border-radius: 50%;
  position: absolute; top: 2px; left: 2px;
  transition: transform 0.3s; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.toggle.on .toggle-knob { transform: translateX(20px); }
.theme-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-chip {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: transform 0.2s, border-color 0.2s;
}
.theme-chip:hover { transform: scale(1.15); }
.theme-chip.selected { border-color: var(--text); transform: scale(1.15); }
.settings-select {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; color: var(--text);
  font-size: 0.85rem; outline: none; cursor: pointer;
}

/* ===== PROJECTS ===== */
.projects-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.project-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 16px;
}
.project-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff; flex-shrink: 0;
}
.project-info { flex: 1; }
.project-info h4 { font-weight: 700; font-size: 0.95rem; }
.project-info p { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.project-meta { display: flex; align-items: center; gap: 10px; }
.status-chip { font-size: 0.7rem; padding: 3px 10px; border-radius: 99px; font-weight: 700; }
.status-chip.ativo { background: rgba(0,200,100,0.15); color: #00c864; border: 1px solid rgba(0,200,100,0.3); }
.status-chip.inativo { background: rgba(150,150,150,0.15); color: #888; border: 1px solid rgba(150,150,150,0.2); }
.status-chip.dev { background: rgba(255,150,0,0.15); color: #ff9600; border: 1px solid rgba(255,150,0,0.3); }
.project-link { font-size: 0.78rem; color: var(--accent); display: flex; align-items: center; gap: 4px; }
.empty-projects {
  text-align: center; padding: 48px 20px;
  color: var(--text-muted); border: 4px double var(--border);
  border-radius: var(--radius);
}
.empty-projects i { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.4; }
.empty-projects p { font-size: 0.9rem; }

/* ===== LOGOUT MODAL ===== */
.btn-logout {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
  color: #fff; border: none; padding: 13px 36px;
  border-radius: 8px; font-weight: 700; font-size: 1rem;
  cursor: pointer; display: inline-flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 16px rgba(200,50,50,0.4);
}
.btn-logout:hover { opacity: 0.88; transform: translateY(-1px); }
.modal-logout-img {
  width: 64px; height: 64px; object-fit: contain;
  display: block; margin: 0 auto 14px;
}
.btn-cancel-logout {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); padding: 13px 30px;
  border-radius: 8px; font-weight: 600; font-size: 0.9rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 9999;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 0.88rem; font-weight: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform: translateY(80px); opacity: 0;
  transition: all 0.35s cubic-bezier(0.34,1.56,0.64,1);
  display: flex; align-items: center; gap: 10px;
  min-width: 260px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: #00c864; }
.toast.success i { color: #00c864; }
.toast.error { border-color: #ff5555; }
.toast.error i { color: #ff5555; }

/* ===== MODAL ===== */
.modal-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  z-index: 200; align-items: center; justify-content: center;
}
.modal-backdrop.show { display: flex; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 400px; width: 90%; text-align: center;
  animation: fadeUp 0.25s ease;
}
.modal-box h3 { font-family: var(--font-head); font-size: 1.3rem; margin-bottom: 8px; }
.modal-box p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.modal-buttons { display: flex; gap: 12px; justify-content: center; }

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  /* Rolagem natural da página (corrige "não consigo rolar" em áreas longas) */
  html, body {
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
    -webkit-overflow-scrolling: touch;
  }
  body { display: block; }
  /* Trava a rolagem do fundo quando o menu lateral está aberto */
  body.no-scroll { overflow: hidden; }

  .sidebar { transform: translateX(-100%); width: 82%; max-width: 300px; }
  .sidebar.open { transform: translateX(0); }

  /* .main deixa de ser o container de scroll — quem rola é a página */
  .main {
    margin-left: 0;
    min-height: auto;
    height: auto;
    overflow: visible;
    width: 100%;
  }
  .hamburger-btn { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .seals-grid { grid-template-columns: 1fr 1fr; }
  .page { padding: 20px; }
  .topbar { padding: 14px 20px; }
  .profile-hero { flex-direction: column; text-align: center; }
  .profile-stats { justify-content: center; flex-wrap: wrap; }
  .btn-voltar-dash { display: none; }   /* no mobile usa o botão de imagem */
}

/* ===== TELAS PEQUENAS (celulares estreitos) ===== */
@media (max-width: 480px) {
  .page { padding: 16px; }
  .card { padding: 18px 16px; }
  .topbar { padding: 12px 16px; }
  .topbar-title { font-size: 1.2rem; }
  .profile-hero { padding: 20px 16px; }
  .profile-big-avatar { width: 76px; height: 76px; font-size: 2.4rem; }
  .profile-hero-info h2 { font-size: 1.35rem; }
  .seals-grid { grid-template-columns: 1fr; }
  .proj-grid { grid-template-columns: 1fr; }
  .btn-row { flex-direction: column; }
  .btn-row .btn-primary,
  .btn-row .btn-cancel { width: 100%; justify-content: center; }
  .sign-actions { flex-direction: column; }
  .toast { left: 16px; right: 16px; bottom: 16px; min-width: 0; }
}


.seal-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Botão Voltar (desktop) — agora dentro da topbar, no fluxo (nunca sobrepõe) */
.btn-voltar-dash {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  text-decoration: none;
  color: rgba(255, 0, 0, 0.767);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 0, 0, 0.767);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s;
}

.btn-voltar-dash:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Seta mobile — oculta no desktop */
.btn-voltar-mobile {
  display: none;
}

@media (max-width: 768px) {
  /* Some o botão de voltar do desktop (a regra base vinha depois e reexibia) */
  .btn-voltar-dash { display: none !important; }
  .btn-voltar-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
  
    flex-shrink: 0;
  }

  .icon-voltar-mobile {
    width: 30px;
    height: 30px;
    object-fit: contain;
  }
}

/* ===== ALERTA DE NÍVEL (canto superior direito, com imagem + botão) ===== */
.lvl-alert {
  position: fixed; top: 24px; right: 24px; z-index: 10000;
  width: 340px; max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  padding: 16px 30px 16px 14px;
  display: flex; gap: 12px; align-items: flex-start;
  transform: translateX(120%); opacity: 0;
  transition: transform .45s cubic-bezier(0.34,1.56,0.64,1), opacity .3s ease;
}
.lvl-alert.show { transform: translateX(0); opacity: 1; }
.lvl-alert-img { width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; }
.lvl-alert-body { flex: 1; }
.lvl-alert-msg { font-size: 0.86rem; line-height: 1.4; color: var(--text); font-weight: 600; margin: 0; }
.lvl-alert-btn {
  margin-top: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border: none; padding: 7px 16px; border-radius: 8px;
  font-size: 0.8rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.lvl-alert-btn:hover { opacity: .9; }
.lvl-alert-x {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--text-muted);
  font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.lvl-alert-x:hover { color: var(--text); }
@media (max-width: 480px) {
  .lvl-alert { top: 14px; right: 14px; left: 14px; width: auto; }
}

/* ===== MODAL DE TERMOS (antes da assinatura) ===== */
.terms-modal-bg {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.6);
  align-items: center; justify-content: center; padding: 20px;
}
.terms-modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 20px; width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
}
.terms-modal-head { display: flex; align-items: center; justify-content: space-between; font-size: 1rem; font-weight: 700; color: var(--text); }
.terms-x { background: none; border: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }
.terms-x:hover { color: var(--text); }
.terms-hint { font-size: 0.82rem; color: var(--text-muted); margin: 0; }
.terms-list { display: flex; flex-direction: column; gap: 12px; }
.terms-item { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg3); }
.terms-acc {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: none; border: none; color: var(--text); cursor: pointer;
  padding: 12px 14px; font-size: 0.86rem; font-weight: 700; text-align: left; font-family: var(--font-body);
}
.terms-acc i { transition: transform .25s ease; color: var(--accent); }
.terms-acc.open i { transform: rotate(180deg); }
.terms-acc-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; font-size: 0.82rem; color: var(--text-muted); line-height: 1.55; }
.terms-acc-body.open { max-height: 320px; overflow-y: auto; }
.terms-acc-body p { padding: 0 14px 12px; margin: 0; }
.terms-check {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 14px 12px;
  font-size: 0.82rem; color: var(--text); cursor: pointer; border-top: 1px solid var(--border);
}
.terms-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; cursor: pointer; }
.terms-link { color: var(--accent); text-decoration: underline; }
.terms-actions { display: flex; gap: 10px; margin-top: 4px; }
.terms-btn { flex: 1; padding: 11px; border-radius: 10px; font-weight: 700; font-size: 0.85rem; cursor: pointer; border: 1px solid var(--border); }
.terms-btn-cancel { background: var(--bg3); color: var(--text); }
.terms-btn-continue { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; }
.terms-btn-continue:disabled { opacity: .45; cursor: not-allowed; }
.terms-btn:hover:not(:disabled) { opacity: .9; }

/* ===== LOADER GERAL DA DASHBOARD (logo pegando fogo / foguete) ===== */
.dash-loader {
  position: fixed; inset: 0; z-index: 20000;
  background: #0b0a09;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity .5s ease, visibility .5s ease;
}
.dash-loader.hide { opacity: 0; visibility: hidden; }
.dl-fx { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.dl-stage { position: relative; z-index: 2; width: min(340px, 82vw); height: 300px; }
.dl-logo, .dl-rocket {
  position: absolute; z-index: 2; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 138px; height: auto; object-fit: contain;
}
.dl-rocket { opacity: 1; animation: dlFly 1.3s ease-in-out infinite, dlRocketOut .5s ease .25s forwards; }
.dl-logo   { opacity: 0; animation: dlFly 1.3s ease-in-out infinite, dlLogoIn  .5s ease .25s forwards; }
/* voo diagonal (sobe p/ direita e volta) */
@keyframes dlFly {
  0%, 100% { transform: translate(-50%, -50%) rotate(-7deg); }
  50% { transform: translate(calc(-50% + 7px), calc(-50% - 7px)) rotate(-7deg); }
}
/* transição única de 0,5s: começa no foguete e termina na logo (ênfase) */
@keyframes dlRocketOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes dlLogoIn   { from { opacity: 0; } to { opacity: 1; } }
/* ===== ÍCONES EM SVG =====
   Substituem o Font Awesome: nada de webfont, CDN ou CSP — por isso
   funcionam no Safari do iPhone, com bloqueador de conteúdo e offline. */
.ic {
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.135em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.ic-spin { animation: icSpin 1s linear infinite; transform-origin: 50% 50%; }
@keyframes icSpin { to { transform: rotate(360deg); } }

/* o hambúrguer e a seta de voltar precisam de área de toque no celular */
.hamburger-btn .ic { width: 1.4rem; height: 1.4rem; }
.btn-voltar-dash .ic { width: 0.95em; height: 0.95em; }

@media (prefers-reduced-motion: reduce) { .ic-spin { animation: none; } }

/* ===== CAMPOS TRAVADOS (e-mail, contato, documento) =====================
   Estes tres so mudam pelo PRIMUS. A defesa real e o gatilho
   profiles_guard_campos no banco; o que esta aqui evita a pessoa digitar,
   salvar e ver o valor voltar sem nenhuma explicacao. */
.form-group { position: relative; }

.form-group input.travado {
  background: var(--bg2);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Sem isto o atributo hidden do HTML nao vale nada: a classe define
   display e vence o [hidden] por vir depois com a mesma especificidade —
   era por isso que o cadeado aparecia em campo vazio. */
.campo-lock[hidden] { display: none; }

.campo-lock {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  vertical-align: middle;
  color: var(--accent2);
  cursor: help;
}
.campo-lock svg { width: 13px; height: 13px; display: block; }

/* O balao e ancorado no .form-group e ocupa a largura dele: preso ao
   icone com largura propria, ele estourava a tela em qualquer coluna
   estreita. Sem seta, porque seta exige ancorar no icone de novo. */
.campo-lock::after {
  content: attr(data-balao);
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 9px 11px;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
}
.campo-lock:hover::after,
.campo-lock:focus::after { display: block; }

/* ===== SELECT DE UF ===================================================== */
.uf-select { position: relative; display: block; }
.uf-select select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
}
.uf-select .uf-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  margin-top: -7px;
  width: 14px;
  height: 14px;
  color: var(--accent2);
  pointer-events: none;
}

/* Grade do formulario: duas colunas iguais, sem campo ocupando a linha
   inteira. Com um item "full" no meio, a coluna seguinte descia sozinha e
   abria o buraco que aparecia no perfil. */
.form-grid > .form-group { min-width: 0; }
.form-grid > .form-group.full { grid-column: auto; }
.form-group input,
.form-group select { width: 100%; box-sizing: border-box; }
