:root{
  /* ===== TOKENS (Hub - claro) ===== */
  --bg: linear-gradient(135deg,#f8fafc 0%,#eef2f7 60%,#ffffff 100%);
  --ink:#0f172a;
  --muted:#6b7280;

  --brand:#01516d;
  --brand-2:#0ea5e9;
  --accent:#a855f7;

  --card:#ffffff;
  --card-border:#e5e7eb;

  --radius:18px;
  --shadow:0 10px 25px rgba(2,6,23,.08);
  --btn-glow: rgba(1,81,109,.25);

  --particle: rgba(1,81,109,.22);
  --particle-2: rgba(14,165,233,.22);
  --shape-stroke: rgba(1,81,109,.25);
  --shape-fill: rgba(1,81,109,.08);

  --max: 720px;
}

.theme-dark{
  --bg: radial-gradient(1200px 800px at 20% -10%, #1e293b, transparent 60%),
        linear-gradient(135deg,#0f172a 0%,#111827 60%,#0b1020 100%);
  --ink:#e5e7eb;
  --muted:#94a3b8;

  --brand:#4f46e5;
  --brand-2:#7c3aed;
  --accent:#22d3ee;

  --card:#0b1222;
  --card-border:rgba(255,255,255,.08);

  --shadow:0 10px 25px rgba(0,0,0,.35);
  --btn-glow: rgba(79,70,229,.35);

  --particle: rgba(124,58,237,.28);
  --particle-2: rgba(79,70,229,.28);
  --shape-stroke: rgba(148,163,184,.35);
  --shape-fill: rgba(124,58,237,.10);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  min-height:100vh;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  display:flex;
  flex-direction:column;
  align-items:center;
  padding: 18px 14px 28px;
  position:relative;
  overflow-x:hidden;
}

/* ===== Fundo animado (Hub) ===== */
.bg-wrap{ position: fixed; inset:0; z-index:-1; pointer-events:none; overflow:hidden; }
.particles{ position:absolute; inset:0; }
.particle{
  position:absolute; width:10px; height:10px; border-radius:999px;
  background:var(--particle);
  animation: pFloat 12s ease-in-out infinite;
  will-change: transform, opacity;
  opacity:.8; filter: blur(.2px);
}
.particle.p2{ background:var(--particle-2); animation-duration: 14s; }
.particle.p3{ width:8px; height:8px; animation-duration: 16s; opacity:.7; }
.particle.p4{ width:12px; height:12px; animation-duration: 18s; opacity:.85; }
.particle:nth-child(1){ left:6vw; top:12vh; animation-delay: 0s; }
.particle:nth-child(2){ left:12vw; top:34vh; animation-delay: 2s; }
.particle:nth-child(3){ left:8vw; top:66vh; animation-delay: 4s; }
.particle:nth-child(4){ right:8vw; top:18vh; animation-delay: 1s; }
.particle:nth-child(5){ right:12vw; top:44vh; animation-delay: 3s; }
.particle:nth-child(6){ right:6vw; top:72vh; animation-delay: 5s; }
@keyframes pFloat{
  0%{ transform:translateY(0) translateX(0); opacity:.55; }
  25%{ transform:translateY(-18px) translateX(8px); opacity:.9; }
  50%{ transform:translateY(0) translateX(14px); opacity:.7; }
  75%{ transform:translateY(16px) translateX(-6px); opacity:.9; }
  100%{ transform:translateY(0) translateX(0); opacity:.55; }
}

.shapes{ position:absolute; inset:0; }
.geometric-shape{
  position:absolute; border:2px solid var(--shape-stroke);
  background: linear-gradient(180deg, var(--shape-fill), transparent);
  box-shadow: 0 0 0 1px rgba(0,0,0,.02) inset;
  border-radius:16px;
  animation: gRotate 22s linear infinite;
  will-change: transform; filter: blur(.15px);
}
.shape-1{ top:10%; left:6%; width:110px; height:110px; --rot: 0deg; }
.shape-2{ bottom:12%; right:6%; width:90px; height:90px; border-radius:50%; --rot: 0deg; }
.shape-3{ top:38%; left:3%; width:76px; height:76px; --rot: 45deg; }
@keyframes gRotate{ from{transform:rotate(var(--rot,0))} to{transform:rotate(calc(var(--rot,0) + 360deg))} }

:focus-visible{ outline:2px solid var(--brand-2); outline-offset:2px; border-radius:10px; }
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation:none !important;transition:none !important}
  .bg-wrap{display:none}
}

/* ===== Layout base ===== */
.wrap{ width:min(var(--max),100%); margin: 0 auto; }
.wrap.wide{ width:min(1100px,100%); }

/* ===== Logo fora do card ===== */
.brandmark{
  width:92px;
  height:92px;
  border-radius:999px;
  margin: 10px auto -18px; /* negativo pra “encaixar” visualmente */
  background: transparent;
  display:grid;
  place-items:center;
  z-index: 2;
  position: relative;
}
.brandmark img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(2,6,23,.12));
}

/* ===== Hero (Hub-like) ===== */
.hero{
  position:relative;
  background: rgba(255,255,255,.85);
  border:1px solid var(--card-border);
  border-radius:22px;
  padding: 20px 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  text-align:center;
  margin: 8px 0 14px;
  overflow:hidden;
}
.theme-dark .hero{ background: rgba(11,18,34,.70); }
/* ===== Logo do cabeçalho (controle de tamanho) ===== */
.hero .logo{
  margin: 14px auto 20px; /* topo | lados | baixo */
  display:flex;
  align-items:center;
  justify-content:center;
}


/* ===== Logo do cabeçalho (2 arquivos: claro/escuro) ===== */
.hero .logo img{
  display:block;
  width:auto;
  height:auto;
  max-height:170px;      /* 👈 ajuste aqui (48–60) */
  max-width:170px;
  object-fit:contain;
}

/* Tema CLARO: mostra logo-light, esconde logo-dark */
.hero .logo .logo-dark{ display:none; }
.hero .logo .logo-light{
  display:block;
  filter: drop-shadow(0 8px 14px rgba(2,6,23,.10));
}

/* Tema ESCURO: mostra logo-dark, esconde logo-light */
.theme-dark .hero .logo .logo-light{ display:none; }
.theme-dark .hero .logo .logo-dark{
  display:block;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.45));
}


.hero h1{ margin:0; font-size:18px; letter-spacing:.2px; }
.hero p{ margin:8px 0 0; color: var(--muted); font-size:13px; }

.hero::after{
  content:""; position:absolute; inset:-2px; border-radius:24px;
  background:
    linear-gradient(120deg,transparent 0 35%, rgba(255,255,255,.7) 45%, transparent 55% 100%),
    linear-gradient(135deg, var(--brand), var(--brand-2));
  background-size:300% 100%, 100% 100%;
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor; mask-composite:exclude;
  padding:2px; z-index:0; pointer-events:none;
  animation:sheen 3.8s ease-in-out infinite; opacity:.55;
}
@keyframes sheen{ 0%{background-position:-200% 0,0 0} 50%{-50% 0,0 0} 100%{200% 0,0 0} }

/* ===== Theme toggle (opcional) ===== */
.theme-toggle{
  display:flex; align-items:center; gap:10px; justify-content:center;
  background: var(--card);
  border:1px solid var(--card-border);
  padding: 8px 14px; border-radius:999px;
  box-shadow: var(--shadow);
  margin: 0 0 14px 0;
  position:relative; overflow:hidden;
}
.theme-toggle::after{
  content:""; position:absolute; inset:0; pointer-events:none; opacity:.35;
  background:radial-gradient(120% 120% at 10% -10%, rgba(255,255,255,.7), transparent 35%);
}
.theme-label{ font-size:12px; color: var(--muted); position:relative; }
.theme-toggle button{
  position:relative;
  background:linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color:#fff;
  border:none; border-radius:999px;
  padding:8px 12px;
  font-weight:700;
  cursor:pointer;
  box-shadow:0 8px 20px var(--btn-glow);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  overflow:hidden;
}
.theme-toggle button::after{
  content:""; position:absolute; inset:0;
  background:linear-gradient(120deg, transparent 0 40%, rgba(255,255,255,.6) 50%, transparent 60%);
  transform:translateX(-120%); transition: transform .5s ease;
}
.theme-toggle button:hover{ transform:translateY(-1px); box-shadow:0 14px 28px var(--btn-glow); filter:saturate(1.05); }
.theme-toggle button:hover::after{ transform:translateX(120%); }

/* ===== Cards públicos (links) ===== */
.cards{ display:flex; flex-direction:column; gap:12px; margin-top: 10px; }
.card{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding: 14px 14px;
  border-radius: 16px;
  background: var(--card);
  border:1px solid var(--card-border);
  box-shadow: var(--shadow);
  text-decoration:none;
  color: var(--ink);
  position:relative;
  transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease;
  overflow:hidden;
}
.card:hover{ transform:translateY(-2px); box-shadow:0 20px 40px rgba(2,6,23,.12); }
.card::after{
  content:""; position:absolute; inset:-1px; border-radius:18px; pointer-events:none; opacity:0;
  background:linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite:xor; mask-composite:exclude;
  padding:1px; transition:opacity .25s ease;
}
.card:hover::after{ opacity:1; }

.card-left{ display:flex; align-items:center; gap:12px; min-width:0; }
.card-icon{
  width:42px; height:42px; border-radius:12px;
  border:1px solid var(--card-border);
  background: linear-gradient(135deg, rgba(1,81,109,.06), rgba(14,165,233,.06));
  display:grid; place-items:center;
  overflow:hidden;
  flex: 0 0 auto;
}
.theme-dark .card-icon{
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(79,70,229,.12));
}
.card-icon img{ width:100%; height:100%; object-fit:cover; }

.card-main{ min-width:0; }
.card-title{ font-weight:800; font-size:14px; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.card-sub{ margin-top:4px; color: var(--muted); font-size:12px; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.card-arrow{
  width:36px; height:36px; border-radius:12px;
  display:grid; place-items:center;
  background: rgba(1,81,109,.08);
  border:1px solid rgba(1,81,109,.18);
  color: var(--brand);
  font-weight:900;
  flex: 0 0 auto;
}
.theme-dark .card-arrow{
  background: rgba(79,70,229,.12);
  border-color: rgba(79,70,229,.22);
  color: var(--accent);
}

.foot{
  margin-top: 16px;
  display:flex; justify-content:space-between; gap:12px;
  color: var(--muted);
  font-size:12px;
}
.foot a{ color: var(--muted); text-decoration:none; }
.foot a:hover{ color: var(--ink); }

/* ===== Admin (mantém seu MVP) ===== */
.panel{
  background: var(--card);
  border:1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.topbar{
  display:flex; align-items:flex-end; justify-content:space-between; gap:16px;
  margin-bottom: 12px;
}
.topbar h1{ margin:0; font-size:18px; }
.topbar-actions{ display:flex; gap:10px; }

.grid{
  display:grid;
  grid-template-columns: 1fr 1.6fr;
  gap:14px;
}
@media (max-width: 900px){ .grid{ grid-template-columns:1fr; } }

.form{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.form label{ font-size:12px; color: var(--muted); }
.form input{
  width:100%;
  border-radius: 14px;
  border:1px solid var(--card-border);
  padding: 12px 12px;
  background: rgba(2,6,23,.04);
  color: var(--ink);
  outline:none;
}
.theme-dark .form input{ background: rgba(0,0,0,.20); border-color: rgba(255,255,255,.10); }
.form input:focus{ border-color: rgba(14,165,233,.45); }
.row{ display:flex; gap:10px; align-items:center; }

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:10px;
  padding: 12px 14px;
  border-radius: 14px;
  border:1px solid rgba(1,81,109,.22);
  background: rgba(1,81,109,.08);
  color: var(--ink);
  text-decoration:none;
  cursor:pointer;
  font-weight:800;
}
.btn:hover{ border-color: rgba(14,165,233,.45); }
.btn.ghost{ background: transparent; border-color: var(--card-border); }
.btn.ghost:hover{ border-color: rgba(14,165,233,.35); }
.btn.danger{ border-color: rgba(255,107,122,.35); background: rgba(255,107,122,.10); }

.small{ margin-top:10px; font-size:12px; }
.toast{
  padding: 12px 14px;
  border-radius: 14px;
  border:1px solid var(--card-border);
  margin: 10px 0 14px;
  background: rgba(255,255,255,.65);
}
.theme-dark .toast{ background: rgba(11,18,34,.65); border-color: rgba(255,255,255,.10); }
.toast.ok{ border-color: rgba(14,165,233,.35); }
.toast.err{ border-color: rgba(255,107,122,.35); }
.list{ display:flex; flex-direction:column; gap:10px; margin-top:12px; }
.item{
  padding: 12px;
  border-radius: 16px;
  border:1px solid var(--card-border);
  background: rgba(255,255,255,.65);
  box-shadow: var(--shadow);
}
.theme-dark .item{ background: rgba(11,18,34,.65); border-color: rgba(255,255,255,.10); }
.item.inactive{ opacity:.65; }
.item-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.item-title{ font-weight:900; }
.pill{
  font-size:11px;
  padding: 6px 10px;
  border-radius: 999px;
  border:1px solid var(--card-border);
  color: var(--muted);
  background: rgba(2,6,23,.03);
}
.theme-dark .pill{ background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10); }
.item-url{ margin-top: 6px; font-size:12px; }
.item-url a{ color: var(--brand-2); text-decoration:none; word-break:break-all; }
.item-sub{ margin-top: 6px; color: var(--muted); font-size:12px; }
.item-meta{ margin-top: 8px; display:flex; gap:12px; font-size:12px; color: var(--muted); }
.actions{ display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
details.edit{ margin-top:10px; }
details.edit summary{ cursor:pointer; color: var(--muted); }
/* ===== Card de perfil (primeiro card) ===== */
.card-profile{
  cursor: default;
  background: linear-gradient(
    135deg,
    rgba(1,81,109,.06),
    rgba(14,165,233,.06)
  );
}

.theme-dark .card-profile{
  background: linear-gradient(
    135deg,
    rgba(124,58,237,.12),
    rgba(79,70,229,.12)
  );
}

.card-profile::after{
  /* mantém o brilho sutil igual aos outros */
  opacity: .6;
}

.card-logo{
  width:52px;
  height:52px;
  border-radius:14px;
  background:#fff;
  display:grid;
  place-items:center;
  border:1px solid var(--card-border);
}

.theme-dark .card-logo{
  background:#0b1222;
}

.card-logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:6px;
}

/* remove hover exagerado no card de perfil */
.card-profile:hover{
  transform:none;
  box-shadow: var(--shadow);
}
/* ===== Ícones sociais no hero ===== */
.socials{
  display:flex;
  justify-content:center;
  gap:14px;
  margin-top:14px;
}

.social{
  width:36px;
  height:36px;
  border-radius:999px;
  display:grid;
  place-items:center;
  text-decoration:none;
  background: rgba(1,81,109,.08);
  border:1px solid rgba(1,81,109,.18);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.social:hover{
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(2,6,23,.15);
  background: rgba(1,81,109,.14);
}

.theme-dark .social{
  background: rgba(79,70,229,.12);
  border-color: rgba(79,70,229,.22);
}

/* Ícone via SVG mask */
.icon{
  width:18px;
  height:18px;
  display:block;
  background: currentColor;
  color: var(--brand);
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.theme-dark .icon{ color: var(--accent); }

.icon.instagram{
  -webkit-mask-image:url('/static/icons/instagram.svg');
  mask-image:url('/tree/static/icons/instagram.svg');
}
.icon.linkedin{
  -webkit-mask-image:url('/static/icons/linkedin.svg');
  mask-image:url('/tree/static/icons/linkedin.svg');
}
.icon.email{
  -webkit-mask-image:url('/static/icons/email.svg');
  mask-image:url('/tree/static/icons/email.svg');
}
.icon.facebook{
  -webkit-mask-image:url('/static/icons/facebook.svg');
  mask-image:url('/tree/static/icons/facebook.svg');
}
/* ===== Destaque (contorno dourado) ===== */
.card.is-featured{
  border-color: rgba(212,175,55,.55); /* dourado */
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(212,175,55,.28) inset;
}

.card.is-featured::after{
  opacity: 1; /* mantém o brilho */
  background: linear-gradient(135deg,
    rgba(212,175,55,.95),
    rgba(255,215,130,.85)
  );
}

/* opcional: setinha levemente dourada no destaque */
.card.is-featured .card-arrow{
  border-color: rgba(212,175,55,.45);
  background: rgba(212,175,55,.12);
  color: rgba(160,120,10,1);
}
.theme-dark .card.is-featured .card-arrow{
  border-color: rgba(212,175,55,.40);
  background: rgba(212,175,55,.10);
  color: rgba(255,230,160,1);
}
