/* Visual da página pública do perfil (também usado na prévia do painel). */
.perfil {
  --cor: #7c3aed;
  --bg: #0f0f14;
  --bg2: #1b1b24;
  --card: rgba(255, 255, 255, .07);
  --card-hover: rgba(255, 255, 255, .13);
  --borda: rgba(255, 255, 255, .10);
  --texto: #f5f5f7;
  --texto2: #c6c6d0;
  position: relative;
  min-height: 100%;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--texto);
  background: var(--bg);
  background-image: radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--cor) 45%, transparent) 0, transparent 55%);
  overflow: hidden;
  isolation: isolate;
}
.perfil.claro {
  --bg: #f4f4f7;
  --bg2: #ffffff;
  --card: rgba(255, 255, 255, .85);
  --card-hover: #ffffff;
  --borda: rgba(0, 0, 0, .08);
  --texto: #18181b;
  --texto2: #46464f;
}
.perfil *, .perfil *::before, .perfil *::after { box-sizing: border-box; }

/* Fundo sem foto: formas na cor principal, que mudam junto com ela.
   .fundo-padrao reaproveita o mesmo desenho na caixa "Foto de fundo" do painel. */
.perfil, .fundo-padrao { --forma-1: 24%; --forma-2: 14%; --forma-base: 20%; }
.perfil.claro, .fundo-padrao.claro { --forma-1: 15%; --forma-2: 9%; --forma-base: 12%; }
.fundo-padrao { --cor: #7c3aed; --bg: #0f0f14; }
.fundo-padrao.claro { --bg: #f4f4f7; }
.perfil:not(.com-capa), .fundo-padrao {
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, transparent 0, transparent 300px, var(--bg) 760px),
    radial-gradient(circle 190px at calc(100% - 50px) 70px, color-mix(in srgb, var(--cor) var(--forma-1), transparent) 99.5%, transparent 100%),
    radial-gradient(circle 150px at 30px 330px, color-mix(in srgb, var(--cor) var(--forma-2), transparent) 99.5%, transparent 100%),
    linear-gradient(180deg, color-mix(in srgb, var(--cor) var(--forma-base), var(--bg)) 0, var(--bg) 760px);
}

/* Foto de fundo */
.perfil-capa {
  position: absolute; inset: 0; z-index: -1;
  background-size: cover; background-position: center;
}
.perfil-capa::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 15, .35) 0%, rgba(10, 10, 15, .75) 45%, rgba(10, 10, 15, .92) 100%);
}
.perfil.claro .perfil-capa::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, .25) 0%, rgba(244, 244, 247, .8) 45%, rgba(244, 244, 247, .95) 100%);
}
.perfil.com-capa .perfil-botao, .perfil.com-capa .perfil-rede { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

.perfil-conteudo {
  width: 100%; max-width: 480px; margin: 0 auto;
  padding: 44px 16px calc(32px + env(safe-area-inset-bottom));
}
.perfil-topo { text-align: center; margin-bottom: 22px; }
.perfil-avatar {
  width: 116px; height: 116px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--cor);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--cor) 25%, transparent), 0 10px 30px rgba(0, 0, 0, .35);
  background: var(--bg2);
}
.perfil h1 { font-size: 1.45rem; font-weight: 700; margin: 14px 0 0; line-height: 1.25; }
.perfil-descricao { color: var(--texto2); font-size: .92rem; margin: 6px 0 0; white-space: pre-line; line-height: 1.5; }

.perfil-redes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 24px; }
.perfil-rede {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--borda);
  color: var(--texto); font-size: 1.2rem; text-decoration: none;
  transition: transform .15s, background .15s, color .15s;
}
.perfil-rede:hover, .perfil-rede:focus-visible { transform: translateY(-3px); background: var(--cor); color: #fff; }
button.perfil-rede { appearance: none; -webkit-appearance: none; padding: 0; font: inherit; font-size: 1.2rem; cursor: pointer; }

.perfil-botoes { display: flex; flex-direction: column; gap: 12px; }
.perfil-botao {
  display: flex; align-items: center; gap: 14px;
  width: 100%; padding: 14px 18px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--borda);
  color: var(--texto); text-decoration: none; font: inherit; font-weight: 500; font-size: .98rem;
  cursor: pointer; text-align: left;
  transition: transform .15s, background .15s;
}
.perfil-botao:hover, .perfil-botao:focus-visible { background: var(--card-hover); transform: scale(1.015); }
.perfil-botao .ic {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.2rem; color: #fff;
  background: var(--cor);
}
.perfil-botao .tx { flex: 1; min-width: 0; }
.perfil-botao small { display: block; color: var(--texto2); font-weight: 400; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perfil-botao .seta { color: var(--texto2); font-size: .85rem; }
/* Só na prévia do painel: link incompleto */
.perfil-botao.incompleto { background: transparent; border: 1.5px dashed color-mix(in srgb, var(--texto) 45%, transparent); opacity: .8; cursor: default; }
.perfil-botao.incompleto:hover { transform: none; background: transparent; }
.perfil-botao.incompleto .ic { background: color-mix(in srgb, var(--texto) 30%, transparent) !important; }
.perfil-botao.incompleto small { white-space: normal; }

.perfil-acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.perfil-acoes .perfil-botao { justify-content: center; font-size: .9rem; padding: 12px; gap: 8px; }
.perfil-acoes .perfil-botao:only-child { grid-column: 1 / -1; }
.perfil-rodape { text-align: center; color: var(--texto2); font-size: .78rem; margin-top: 30px; }
.perfil-rodape a { color: var(--texto); font-weight: 600; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--texto) 35%, transparent); }
.perfil-rodape a:hover, .perfil-rodape a:focus-visible { border-bottom-color: currentColor; }
.perfil-rodape.no-aviso { position: absolute; left: 16px; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); margin: 0; }

.perfil-aviso { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.perfil-aviso-ic { font-size: 2.4rem; color: var(--texto2); }

/* Modal Pix (anexado ao body) */
.perfil-modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center; padding: 16px;
  font-family: "Poppins", system-ui, sans-serif;
}
@media (min-width: 600px) { .perfil-modal { align-items: center; } }
.perfil-modal-caixa {
  width: 100%; max-width: 420px; background: #1b1b24; color: #f5f5f7;
  border-radius: 22px; padding: 24px 20px; text-align: center;
  border: 1px solid rgba(255, 255, 255, .1); animation: perfilSobe .2s ease-out;
  --card: rgba(255, 255, 255, .07); --card-hover: rgba(255, 255, 255, .13); --borda: rgba(255, 255, 255, .1); --texto: #f5f5f7; --texto2: #b4b4c0;
}
@keyframes perfilSobe { from { transform: translateY(30px); opacity: 0; } }
.perfil-modal h2 { font-size: 1.15rem; margin: 0; }
.perfil-modal p { color: #b4b4c0; font-size: .85rem; margin: 4px 0 0; }
.perfil-qr { background: #fff; padding: 12px; border-radius: 14px; display: inline-block; margin: 18px 0 14px; }
.perfil-qr img, .perfil-qr canvas { display: block; width: 200px; height: 200px; }
.perfil-chave { background: rgba(255, 255, 255, .07); border-radius: 12px; padding: 10px 12px; font-size: .85rem; word-break: break-all; margin-bottom: 12px; }
.perfil-modal .perfil-botao { justify-content: center; margin-top: 8px; box-sizing: border-box; }
.perfil-modal .perfil-botao.principal { background: #32bcad; color: #fff; border: none; }
.perfil-fechar { background: none; border: none; color: #b4b4c0; font: inherit; margin-top: 14px; cursor: pointer; text-decoration: underline; }

.perfil-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #18181b; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .88rem;
  font-family: "Poppins", system-ui, sans-serif;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 1100; max-width: calc(100% - 32px); text-align: center;
}
.perfil-toast.ver { opacity: 1; transform: translate(-50%, 0); }
