/* Tokens no padrão do Portifas: um acento só, pill nos botões, 16px nos cards, 10px no pequeno */
:root {
  --f-display: "Space Grotesk", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, sans-serif;
  --f-mono: "Space Mono", ui-monospace, monospace;
  --r-card: 16px; --r-sm: 10px; --r-pill: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --accent: #c6f24e; --accent-ink: #101012;
}
html[data-theme="dark"] {
  --bg: #0b0b0c; --bg-elev: #141416; --bg-elev-2: #1b1b1e;
  --text: #f4f4f2; --text-muted: #a2a2a8; --text-faint: #6e6e75;
  --border: rgba(255,255,255,.09); --border-strong: rgba(255,255,255,.16);
  --accent-text: var(--accent);
  --shadow: 0 24px 60px -20px rgba(0,0,0,.7);
  --perigo: #f87171;
}
html[data-theme="light"] {
  --bg: #faf9f5; --bg-elev: #ffffff; --bg-elev-2: #f2f1ec;
  --text: #101012; --text-muted: #52525b; --text-faint: #85858e;
  --border: rgba(0,0,0,.10); --border-strong: rgba(0,0,0,.18);
  --accent-text: color-mix(in srgb, var(--accent) 38%, #101012);
  --shadow: 0 24px 60px -24px rgba(20,20,25,.28);
  --perigo: #b91c1c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }
body {
  min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: var(--f-body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
h1, h2 { font-family: var(--f-display); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; }
svg { width: 18px; height: 18px; flex-shrink: 0; }
.eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }

/* grão fixo por cima de tudo */
.grao {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: .5; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

/* botão de tema */
.tema {
  position: fixed; top: 16px; right: 16px; z-index: 50;
  width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center;
  border: 1px solid var(--border); color: var(--text-muted);
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(12px);
  transition: color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.tema:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.tema svg:last-child { display: none; }
html[data-theme="light"] .tema svg:first-child { display: none; }
html[data-theme="light"] .tema svg:last-child { display: block; }

/* ---------------- página pública ---------------- */
.aurora, .aurora::before {
  content: ""; position: fixed; border-radius: 50%; pointer-events: none; filter: blur(60px); z-index: 0;
}
.aurora { top: -12vh; left: 50%; width: 70vmin; height: 70vmin; translate: -50% 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%); }
.aurora::before { top: 40vh; left: -30vmin; width: 60vmin; height: 60vmin;
  background: radial-gradient(closest-side, rgba(120,170,255,.16), transparent 70%); }

.pagina { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 72px 16px 40px; }
.perfil { display: flex; flex-direction: column; align-items: center; text-align: center; }
.avatar-anel {
  padding: 3px; border-radius: 50%;
  background: linear-gradient(115deg, #6a6a72 0%, #e9e9ee 24%, #ffffff 40%, #b5b5be 54%, #f2f2f6 70%, #7a7a82 100%);
  box-shadow: var(--shadow);
}
.avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg); background: var(--bg-elev); }
.avatar.vazio { display: grid; place-items: center; font-family: var(--f-display); font-size: 44px; font-weight: 700;
  color: var(--accent-ink); background: var(--accent); }
.status {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 22px;
  font-family: var(--f-mono); font-size: 12px; color: var(--text-muted);
  padding: 6px 14px; border: 1px solid var(--border); border-radius: var(--r-pill);
}
.ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.perfil h1 { font-size: clamp(2.1rem, 8vw, 3rem); margin-top: 16px; }
.bio { color: var(--text-muted); margin-top: 10px; max-width: 42ch; font-size: 1.05rem; }

.lista { display: flex; flex-direction: column; gap: 12px; margin-top: 40px; }
.card {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; gap: 16px; padding: 14px 14px 14px 16px;
  border-radius: var(--r-card); border: 1px solid var(--border); background: var(--bg-elev);
  transition: transform .35s var(--ease), border-color .3s var(--ease), box-shadow .35s var(--ease);
}
.card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0;
  transition: opacity .35s var(--ease);
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%);
}
.card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }
.card:active { transform: translateY(0) scale(.99); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.ico {
  width: 44px; height: 44px; border-radius: var(--r-sm); display: grid; place-items: center; flex-shrink: 0;
  background: var(--bg-elev-2); border: 1px solid var(--border); color: var(--text);
}
.ico svg { width: 20px; height: 20px; }
.txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.txt strong { font-family: var(--f-display); font-weight: 600; font-size: 1.08rem; letter-spacing: -.01em; line-height: 1.3; }
.txt small { font-family: var(--f-mono); font-size: 11.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seta {
  width: 38px; height: 38px; border-radius: var(--r-pill); display: grid; place-items: center; flex-shrink: 0;
  border: 1px solid var(--border); color: var(--text-muted);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.seta svg { width: 17px; height: 17px; transition: transform .25s var(--ease); }
.card:hover .seta { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.card:hover .seta svg { transform: translate(2px, -2px); }
.vazio-msg { text-align: center; color: var(--text-faint); font-family: var(--f-mono); font-size: 13px; padding: 28px;
  border: 1px dashed var(--border-strong); border-radius: var(--r-card); }
.rodape { margin-top: 48px; text-align: center; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .06em; color: var(--text-faint); }

@media (prefers-reduced-motion: no-preference) {
  .ponto { animation: pulso 2.4s var(--ease) infinite; }
  .aurora { animation: deriva 14s ease-in-out infinite alternate; }
  .perfil > *, .card { animation: entra .7s var(--ease) both; }
  .perfil > :nth-child(2) { animation-delay: .06s; }
  .perfil > :nth-child(3) { animation-delay: .12s; }
  .perfil > :nth-child(4) { animation-delay: .18s; }
  .card { animation-delay: calc(.24s + var(--i, 0) * .06s); }
}
@keyframes pulso { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 9px transparent; } }
@keyframes deriva { to { translate: -42% 6%; scale: 1.12; } }
@keyframes entra { from { opacity: 0; transform: translateY(14px); } }

/* ---------------- painel ---------------- */
.painel { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; padding: 56px 16px 64px; }
.painel.estreito { max-width: 400px; padding-top: 18vh; }
.painel h1 { font-size: clamp(2rem, 6vw, 2.6rem); margin-top: 8px; }
.topo { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-right: 48px; }
.acoes { display: flex; gap: 10px; }
.bloco { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-card); padding: 24px; margin-top: 20px; }
.bloco h2 { font-size: 1.25rem; margin-bottom: 16px; }
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inteira { grid-column: 1 / -1; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--text-muted); }
input:not([type=radio]):not([type=hidden]) {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px; font: inherit; font-size: 15px;
  border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--bg); color: var(--text);
  transition: border-color .2s var(--ease);
}
input::placeholder { color: var(--text-faint); }
input:hover { border-color: var(--border-strong); }
input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input[type=file] { padding: 8px; font-size: 14px; color: var(--text-muted); }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 500; margin-right: 12px; padding: 7px 14px; cursor: pointer;
  border-radius: var(--r-pill); border: 1px solid var(--border-strong); background: var(--bg-elev-2); color: var(--text);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; position: relative; overflow: hidden;
  padding: 12px 20px; border-radius: var(--r-pill); white-space: nowrap; line-height: 1;
  font-family: var(--f-display); font-weight: 500; font-size: 15px;
  transition: transform .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 16px; height: 16px; }
.btn.peq { padding: 8px 14px; font-size: 13.5px; }
.primario { background: var(--accent); color: var(--accent-ink); }
.primario::after {
  content: ""; position: absolute; top: 0; left: -140%; width: 60%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.85), transparent); transform: skewX(-18deg);
  transition: left .6s var(--ease);
}
.primario:hover::after { left: 160%; }
.fantasma { border: 1px solid var(--border-strong); color: var(--text); }
.fantasma:hover { border-color: var(--accent-text); }
.perigo { border: 1px solid color-mix(in srgb, var(--perigo) 45%, transparent); color: var(--perigo); }
.perigo:hover { background: color-mix(in srgb, var(--perigo) 12%, transparent); }
.estreito .bloco { display: flex; flex-direction: column; gap: 16px; }
.dica { color: var(--text-muted); font-size: 14px; margin-top: 8px; }

.aviso { margin-top: 20px; padding: 12px 16px; border-radius: var(--r-sm); font-size: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.aviso.erro { margin: 0; border-color: color-mix(in srgb, var(--perigo) 45%, transparent); background: color-mix(in srgb, var(--perigo) 10%, transparent); color: var(--perigo); }

.linha { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 10px; align-items: center; }
.linha input { margin: 0 !important; }
.item {
  display: grid; grid-template-columns: 44px 1fr 1.4fr auto; gap: 10px; align-items: center;
  padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--border);
}
.item input { margin: 0 !important; }
.item .botoes { grid-column: 2 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.item.inativo .ico, .item.inativo input { opacity: .45; }
.cliques { font-family: var(--f-mono); font-size: 12px; color: var(--text-faint); white-space: nowrap; }

.cores { border: 0; display: flex; gap: 12px; flex-wrap: wrap; }
.cores legend { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-bottom: 8px; }
.cor { position: relative; }
.cor input { position: absolute; opacity: 0; }
.cor span { display: block; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; box-shadow: 0 0 0 1px var(--border-strong);
  transition: transform .2s var(--ease); }
.cor span:hover { transform: scale(1.08); }
.cor input:checked + span { box-shadow: 0 0 0 3px var(--bg-elev), 0 0 0 5px var(--text); }
.cor input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 4px; }

@media (max-width: 640px) {
  .grade, .linha { grid-template-columns: 1fr; }
  .item { grid-template-columns: 44px 1fr; }
  .item input[name=url] { grid-column: 2; }
  .item .cliques { grid-column: 2; }
  .bloco { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { .primario::after { display: none; } }
