/* ===== Contas, seletor de login e perfil ===== */
/* Carregar depois de style.css e hud.css. Sem estilos inline: a CSP do site só aceita arquivos próprios. */

/* ---------- avatar ---------- */
.account-avatar{
  --avatar-size:72px;
  display:grid;place-items:center;flex:none;
  width:var(--avatar-size);height:var(--avatar-size);
  overflow:hidden;border-radius:50%;
  border:1px solid var(--line-strong);
  background:var(--sumi-800);
  color:var(--washi-2);font-family:var(--font-ui);font-weight:700;
  font-size:calc(var(--avatar-size) * .42);line-height:1;text-transform:uppercase;
}
.account-avatar img{display:block;width:100%;height:100%;object-fit:cover}
.account-avatar-logo{padding:calc(var(--avatar-size) * .14);background:var(--sumi-input)}
.account-avatar-logo img{object-fit:contain}
.account-avatar-sm{--avatar-size:38px}
.account-avatar-lg{--avatar-size:132px;border-width:2px}
.account-avatar-plus{background:transparent;border-style:dashed;color:var(--muted);font-size:1.7rem}

/* ---------- seletor de contas (tela de login) ---------- */
.login-shell.login-shell-wide{width:min(640px,100%)}
.account-picker,.account-login-form{display:none}
.account-picker{margin-top:4px}
.account-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:12px}
.account-tile-wrap{position:relative;margin:0}
.account-tile{
  position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;
  width:100%;min-height:158px;padding:18px 12px 14px;
  border:1px solid var(--line);border-radius:16px;
  background:rgba(255,255,255,.03);color:var(--text);
  font:inherit;text-align:center;cursor:pointer;
  transition:border-color .15s ease,background .15s ease,transform .15s ease;
}
.account-tile:hover,.account-tile:focus-visible{border-color:var(--accent-line);background:rgba(255,255,255,.055);transform:translateY(-1px);outline:none}
.account-tile strong{max-width:100%;overflow:hidden;font-size:.95rem;text-overflow:ellipsis;white-space:nowrap}
.account-tile small{color:var(--muted);font-size:.74rem;font-weight:700}
.account-tile.is-open{border-color:rgba(49,208,131,.35);background:rgba(49,208,131,.06)}
.account-badge{
  position:absolute;top:9px;left:9px;padding:2px 8px;
  border-radius:999px;background:rgba(49,208,131,.16);color:#9cf0c4;
  font-size:.62rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;
}
.account-tile-remove{
  position:absolute;top:7px;right:7px;display:grid;place-items:center;
  width:26px;height:26px;padding:0;border:1px solid transparent;border-radius:999px;
  background:transparent;color:var(--muted);font-size:1.05rem;line-height:1;cursor:pointer;
}
.account-tile-remove:hover,.account-tile-remove:focus-visible{border-color:var(--accent-line);background:var(--accent-soft);color:#fff;outline:none}
.account-forget{margin:14px 0 0;text-align:center}
.account-link-btn{padding:4px 6px;border:0;background:none;color:var(--muted);font:inherit;font-size:.76rem;font-weight:700;text-decoration:underline;cursor:pointer}
.account-link-btn:hover{color:var(--text)}

.js-picker .account-picker{display:block}
.js-picker.is-entering .account-picker{display:none}
.account-login-form{gap:14px}
.account-login-form.is-visible,.login-page:not(.js-picker) .account-login-form{display:grid}
.account-login-head{display:flex;align-items:center;gap:14px;padding-bottom:6px}
.account-login-head strong{display:block;font-size:1.05rem}
.account-login-head small{color:var(--muted);font-size:.8rem;font-weight:700}
.account-remember{display:flex;align-items:center;gap:9px;color:var(--muted-strong);font-size:.84rem;font-weight:700;cursor:pointer}
.account-remember input{width:17px;height:17px;margin:0;accent-color:var(--accent)}
.login-page:not(.js-picker) .account-login-head,.login-page:not(.js-picker) #loginBackBtn{display:none}
.login-page.js-picker .account-login-form [hidden]{display:none}

/* ---------- painel de conta (menu lateral e sala de metas) ---------- */
.account-mini{display:flex;align-items:center;gap:11px;min-width:0}
.account-mini-text{min-width:0}
.account-mini-text strong{display:block;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-mini-text span,.account-mini-text small{display:block;margin:0 0 1px}
.user-panel .account-avatar,.member-profile-card .account-avatar{display:grid;margin:0;color:var(--muted-strong);font-size:calc(var(--avatar-size) * .42);font-weight:800;letter-spacing:0}
.user-panel .account-mini{margin:8px 0 0}
.member-profile-card .account-mini-text span{margin-bottom:3px}
.account-links{display:grid;gap:1px;margin:10px 0 12px}
.account-links:empty{display:none}
.account-links form{margin:0}
.account-link{
  display:block;width:100%;padding:7px 8px;
  border:0;border-radius:7px;
  background:transparent;color:var(--ash);
  font:inherit;font-size:.82rem;font-weight:500;text-align:left;text-decoration:none;cursor:pointer;
  transition:background .15s ease,color .15s ease;
}
.account-link:hover,.account-link:focus-visible{background:rgba(255,232,228,.05);color:var(--washi);outline:none}
.topbar-profile{display:inline-flex;border-radius:50%;text-decoration:none}
.topbar-profile[hidden]{display:none}
.topbar-profile .account-avatar{transition:border-color .15s ease}
.topbar-profile:hover .account-avatar,.topbar-profile:focus-visible .account-avatar{border-color:var(--accent-line)}

/* ---------- página de perfil ---------- */
.profile-page{min-height:100vh;padding:22px}
.profile-shell{position:relative;z-index:1;display:grid;gap:16px;width:min(920px,100%);margin:0 auto}
.profile-topbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.profile-topbar .brand{padding:0}
.profile-topbar-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.profile-topbar-actions form{margin:0}
.profile-hero{display:flex;align-items:center;gap:22px;flex-wrap:wrap}
.profile-hero-text{flex:1;min-width:200px}
.profile-hero-text h1{margin:2px 0 4px;font-size:1.5rem;line-height:1.15;overflow-wrap:anywhere}
.profile-hero-text p{margin:0;color:var(--muted);font-size:.86rem;font-weight:700}
.profile-role{display:inline-flex;align-items:center;gap:7px;margin-top:8px;color:var(--washi-2);font-size:.8rem;font-weight:600}
.profile-role::before{content:"";width:7px;height:7px;border-radius:2px;background:var(--laca-hi)}
.profile-photo-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:13px}
.profile-photo-actions input[type="file"]{display:none}
.profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.profile-grid .profile-card-wide{grid-column:1 / -1}
.profile-form{display:grid;gap:14px}
.profile-form .field small{color:var(--muted);font-size:.74rem;font-weight:600}
.profile-form .form-actions{display:flex;gap:10px;flex-wrap:wrap}
.profile-card-note{margin:0 0 14px;color:var(--muted);font-size:.84rem;line-height:1.5}
.profile-shared-note{border-color:rgba(240,184,75,.3);background:rgba(240,184,75,.06)}
.profile-shared-note p{margin:6px 0 0;color:var(--muted-strong);font-size:.88rem;line-height:1.55}
.profile-page [hidden]{display:none}

@media (max-width:760px){
  .profile-page{padding:14px}
  .profile-grid{grid-template-columns:1fr}
  .profile-hero{flex-direction:column;align-items:flex-start}
  .account-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ---------- ajustes finos ---------- */
.account-tile.is-open{padding-top:32px}
.profile-page a.ghost-btn{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.profile-page .danger-btn{
  padding:10px 16px;border:1px solid rgba(255,58,89,.35);border-radius:10px;
  background:rgba(255,45,79,.09);color:#ffc2cc;font:inherit;font-size:.85rem;font-weight:800;cursor:pointer;
  transition:background .15s ease,border-color .15s ease;
}
.profile-page .danger-btn:hover:not(:disabled){background:rgba(255,45,79,.18);border-color:rgba(255,58,89,.55);color:#fff}
.profile-page .danger-btn:disabled{opacity:.55;cursor:wait}
.profile-card-note[data-kind="ok"]{color:#9cf0c4}
.profile-card-note:empty{display:none}

/* ---------- acabamento "laca" ---------- */
.profile-topbar .brand{border-bottom:0;padding:0}
.profile-page .section-head h3{margin:0 0 8px}
.profile-hero-text h1{font-size:clamp(1.6rem,2.4vw,2rem)}
.account-tile{border-radius:12px;background:var(--sumi-850)}
.account-tile:hover,.account-tile:focus-visible{border-color:rgba(224,67,90,.45);background:var(--sumi-800)}
.account-tile strong{font-weight:600}
.account-tile small{font-weight:500;color:var(--ash)}
.account-tile.is-open{border-color:rgba(107,181,146,.32);background:linear-gradient(180deg,rgba(107,181,146,.07),rgba(107,181,146,0)),var(--sumi-850)}
.account-badge{background:rgba(107,181,146,.14);color:#bfe6d2;letter-spacing:0;text-transform:none;font-size:.7rem;font-weight:600}
.account-link-btn{color:var(--ash);font-weight:500}
.account-login-head strong{font-family:var(--font-display);font-size:1.2rem}
.account-remember{color:var(--washi-2);font-weight:500}
.login-card .hanko-sm{
  position:absolute;top:22px;right:24px;
  padding:7px 5px;border-radius:5px;font-size:.92rem;
  box-shadow:inset 0 0 0 1.5px rgba(255,236,232,.16),inset 0 0 0 3.5px rgba(122,15,32,.55);
  transform:rotate(-4deg);
}
.login-card .login-brand{padding-right:44px}
@media (max-width:520px){.login-card .hanko-sm{top:18px;right:18px}}
