:root{
  --bg1:#0b1020;
  --bg2:#0a1a2a;
  --page-bg:#0b1020;
  --card:rgba(255,255,255,.08);
  --stroke:rgba(255,255,255,.14);
  --text:#fff;
  --muted:rgba(255,255,255,.72);
  --shadow:0 18px 40px rgba(0,0,0,.35);
  --radius:18px;
  --cor-botoes:#007bff;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:Arial, sans-serif;
  color:var(--text);
  background-color:var(--page-bg);
  background-image:
    radial-gradient(900px 600px at 20% 10%, rgba(120,80,255,.18), transparent 60%),
    radial-gradient(900px 600px at 80% 20%, rgba(0,180,255,.14), transparent 60%);
  background-size:auto;
  background-position:center;
  background-repeat:no-repeat;
  min-height:100vh;
}
a{color:inherit}
.muted{color:var(--muted); margin:.5rem 0; line-height:1.45}
.auth{display:flex;align-items:center;justify-content:center;padding:18px}
.card{
  width:min(560px, 100%);
  background:var(--card);
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding:16px;
}
h1,h2,h3{margin:0 0 10px 0}
label{display:block;font-weight:700;font-size:14px;margin-top:10px}
input, textarea, select{
  width:100%;
  border:1px solid rgba(255,255,255,.20);
  background:rgba(0,0,0,.25);
  color:var(--text);
  font-family: inherit;
  font-weight: inherit;
  border-radius:12px;
  padding:12px;
  outline:none;
  margin-top:8px;
}
textarea{min-height:90px; resize:vertical}
.hint{font-size:12px;color:var(--muted);margin-top:6px;line-height:1.35}
button, .btn{
  width:100%;
  margin-top:14px;
  padding:12px;
  border:0;
  border-radius:12px;
  background: var(--btn-glass, rgba(255,255,255,.22));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border:1px solid rgba(255,255,255,.22);
  box-shadow:0 10px 24px rgba(0,0,0,.22);
  color:var(--text);
  font-size:16px;
  font-family: inherit;
  font-weight: inherit;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  gap:10px;
}
.secondary{background:rgba(255,255,255,.14)}
.danger{background:rgba(255,70,90,.25)}
.mini{padding:8px 10px;font-size:12px;border-radius:10px;margin-top:0;width:auto}
.alert{
  background:rgba(255,70,90,.18);
  border:1px solid rgba(255,70,90,.28);
  padding:10px;
  border-radius:12px;
  margin:10px 0;
}
.alert.ok{
  background:rgba(80,255,160,.14);
  border:1px solid rgba(80,255,160,.24);
}
.topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 18px;border-bottom:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.20);position:sticky;top:0;
}
.brand{font-weight:800}
.nav{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.nav a{opacity:.9;text-decoration:none}
.nav a:hover{opacity:1}
.wrap{padding:18px;display:grid;gap:14px;max-width:1050px;margin:0 auto}
.panel{
  background:var(--card);
  border:1px solid var(--stroke);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding:16px;
}
.row{display:flex;gap:10px;align-items:center}
.row input{margin-top:0}
.row button{margin-top:0;width:auto;white-space:nowrap}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.field{min-width:0}
.field.full{grid-column:1 / -1}
@media (max-width:820px){ .grid{grid-template-columns:1fr} }

.public{display:flex;justify-content:center}
.public-wrap{width:100%;max-width:640px;padding:18px}
.hero{text-align:center;margin-bottom:12px}
.hero h1{font-size:30px;margin-top:10px}
.bio{color:var(--muted);line-height:1.55;margin:8px auto 0 auto;max-width:56ch}
.hero-media{
  width:100%;max-height:42vh;border-radius:16px;object-fit:contain;
  box-shadow:0 18px 40px rgba(0,0,0,.35);
}
.avatar-shell{
  width:128px;height:128px;margin:0 auto;display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.06);box-shadow:0 18px 40px rgba(0,0,0,.35);overflow:hidden;
}
.avatar-shell.round{border-radius:50%;border:5px solid var(--cor-botoes)}
.avatar-shell.square{border-radius:16px;border:1px solid rgba(255,255,255,.18)}
.avatar-img{width:100%;height:100%;object-fit:cover}
.btn.link{
  width:100%;margin:12px auto;max-width:560px;padding:16px 16px;border-radius:18px;
  justify-content:flex-start;
  background: var(--btn-glass, rgba(255,255,255,.22));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
border:1px solid rgba(255,255,255,.18);
  box-shadow:0 10px 22px rgba(0,0,0,.18);
}
.btn img{width:26px;height:26px;object-fit:contain}

.album{margin-top:16px}
.album h2{margin:0 0 10px 0}
.album-wrap{position:relative}
.album-track{
  display:flex;
  gap:6px;
  overflow:auto;
  scroll-behavior:smooth;
  padding:4px 34px 10px 34px;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
}
.album-track::-webkit-scrollbar{height:8px}
.album-track img{
  height:180px;
  border-radius:12px;
  object-fit:cover;
  flex:0 0 auto;
  border:1px solid rgba(255,255,255,.14);
  scroll-snap-align:start;
  cursor:pointer;
  will-change: transform;
  transition: transform .22s ease;
  transform-origin: center center;
}
.album-nav{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:34px;height:34px;border-radius:999px;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(255,255,255,.18);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
}
.album-nav:hover{background:rgba(255,255,255,.28)}
.album-nav.prev{left:6px}
.album-nav.next{right:6px}
@media (max-width:680px){
  .album-track{padding-left:10px;padding-right:10px}
  .album-nav{display:none}
}

.photo-modal{
  position:fixed;inset:0;
  background:rgba(0,0,0,.72);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:9999;
}
.photo-modal.open{display:flex}
.photo-card{
  width:min(920px, 100%);
  border-radius:18px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.10);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  box-shadow:0 18px 60px rgba(0,0,0,.45);
  overflow:hidden;
  position:relative;
}
.photo-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 12px;
  border-bottom:1px solid rgba(255,255,255,.14);
}
.photo-head strong{color:var(--text)}
.photo-body{padding:12px}
.photo-view{
  width:100%;
  max-height:68vh;
  display:block;
  object-fit:contain;
  border-radius:14px;
  background:rgba(0,0,0,.18);
}
.photo-meta{
  margin-top:10px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.22);
  border-radius:14px;
  padding:10px 12px;
}
.photo-meta p{margin:0;color:var(--text);line-height:1.35}
.photo-meta a{
  display:inline-flex;
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.14);
  color:var(--text);
  text-decoration:none;
}
.photo-meta a:hover{background:rgba(255,255,255,.24)}
.photo-arw{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:42px;height:42px;border-radius:999px;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(255,255,255,.14);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
}
.photo-arw:hover{background:rgba(255,255,255,.24)}
.photo-arw.prev{left:10px}
.photo-arw.next{right:10px}
@media (max-width:680px){
  .photo-arw{width:40px;height:40px}
}

.album-grid{display:grid;grid-template-columns:repeat(4, 1fr);gap:10px;margin-top:10px}
.album-item{
  position:relative;
  background:rgba(0,0,0,.20);border:1px solid rgba(255,255,255,.12);border-radius:14px;padding:8px;
}
.album-item img{width:100%;height:140px;object-fit:cover;border-radius:10px;display:block}
.album-item form{margin-top:8px}
@media (max-width:860px){ .album-grid{grid-template-columns:repeat(2, 1fr)} }

/* Painel: exclusão rápida do álbum */
.album-item{position:relative}
.album-x{
  z-index:7;

  position:absolute;top:8px;right:8px;
  width:34px;height:34px;border-radius:12px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(0,0,0,.35);
  color:#fff;font-size:22px;line-height:30px;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;
}
.album-x:hover{background:rgba(255,0,0,.35);border-color:rgba(255,255,255,.35)}
.album-select{
  position:absolute;top:10px;left:10px;
  width:24px;height:24px;border-radius:8px;
  border:1px solid rgba(255,255,255,.22);
  background:rgba(0,0,0,.25);
  display:none;align-items:center;justify-content:center;
  cursor:pointer;
  z-index:6;
  width:28px;height:28px;
  border-radius:10px;

}
.album-select input{opacity:0;position:absolute;inset:0}
.album-select span{width:12px;height:12px;border-radius:4px;background:transparent;display:block}
.album-grid.select-on .album-select{display:flex}
.album-grid.select-on .album-item{outline:2px solid rgba(255,255,255,.10)}
.album-grid.select-on .album-check:checked + span{background:rgba(255,255,255,.90)}
.checkline{display:flex;align-items:center;gap:10px;color:rgba(255,255,255,.85);user-select:none}
.checkline input{width:18px;height:18px}


.modal{
  position:fixed;inset:0;background:rgba(0,0,0,.6);display:none;align-items:center;justify-content:center;
  padding:18px;z-index:9999;
}
.modal.open{display:flex}
.modal-card{
  width:min(560px, 100%);border-radius:18px;background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);box-shadow:0 18px 40px rgba(0,0,0,.35);
  backdrop-filter: blur(10px);-webkit-backdrop-filter: blur(10px);padding:16px;
}
.modal-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}

.pwa-install{
  position:fixed;right:14px;bottom:14px;width:auto;padding:12px 14px;border-radius:999px;
  border:1px solid rgba(255,255,255,.18);background:rgba(0,0,0,.35);color:var(--text);
  backdrop-filter: blur(10px);-webkit-backdrop-filter: blur(10px);cursor:pointer;
}

.table{display:grid;gap:6px}
.tr{
  display:grid;grid-template-columns:160px 1fr 90px 1fr;gap:10px;align-items:center;
  padding:10px;border:1px solid rgba(255,255,255,.10);border-radius:14px;background:rgba(0,0,0,.16);
}
.tr.head{background:rgba(255,255,255,.06);font-weight:800}
.actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end;align-items:center}
.badge{padding:5px 10px;border-radius:999px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.16);font-size:12px}


/* Foto principal livre (70% largura) */
.hero-media-free{display:flex;justify-content:center;align-items:center;margin:10px 0 6px;}
.hero-img-free{width:70%;max-width:560px;height:auto;object-fit:contain;}
/* Quando NÃO for circular: sem quadro atrás (somente a imagem + o fundo) */
.hero-media-free.free .hero-img-free{border:0;background:transparent;box-shadow:none;border-radius:0;}

/* Fundo na página pública */
html,body{min-height:100%}
body.public{background-size:var(--bg-size, cover);background-position:center;background-repeat:no-repeat;background-attachment:fixed;min-height:100vh;background-color:var(--page-bg);background-image:none;
  font-family: var(--font-family, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif);
  font-weight: var(--font-weight, 400);
}

/* Dashboard (admin) não deve herdar cores do perfil */
body.dash{
  --text:#fff;
  --muted:rgba(255,255,255,.72);
  --stroke:rgba(255,255,255,.14);
  --card:rgba(255,255,255,.08);
  --page-bg:#0b1020;
  --cor-botoes:#007bff;
  --btn-glass:rgba(255,255,255,.22);
  --btn-glass-hover:rgba(255,255,255,.30);
}
.public[data-bg-fit="cover"]{--bg-size:cover;}
.public[data-bg-fit="contain"]{--bg-size:auto 100%;}
.public[data-bg-fit="auto"]{--bg-size:cover;}
@media (orientation: portrait){.public[data-bg-fit="auto"]{--bg-size:auto 100%;}}



.btn:hover, .btn.link:hover{
  background: var(--btn-glass-hover, rgba(255,255,255,.32));
  transform: translateY(-1px);
}


/* Preview ao vivo dentro do dashboard */
.public-preview-wrap{
  border:1px solid var(--stroke);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow);
}
.public-preview{
  min-height: 520px;
}
.public-preview .container{padding:22px; max-width:460px;}
.public-preview .hero{padding:18px;}
.public-preview .avatar{
  width:76px;height:76px;border-radius:20px;margin:0 auto 10px;
}
.public-preview .btns{margin-top:14px;}


@media (prefers-reduced-motion: reduce){
  .album-track{scroll-behavior:auto}
  .album-track img{transition:none!important;transform:none!important}
}


.album-grid.select-on .album-item{cursor:pointer}
