@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@300..900&display=swap');

:root{
  --bg:#0b0c10;
  --bg2:#0f1117;
  --card:rgba(255,255,255,.05);
  --card2:rgba(255,255,255,.04);
  --border:rgba(255,255,255,.08);
  --text:#e9e9ea;
  --muted:rgba(233,233,234,.70);
  --red:#ff323d;
  --shadow:0 14px 40px rgba(0,0,0,.45);
  --radius:18px;
  --anim: 450ms;
}

*{box-sizing:border-box}
html{height:100%}
body{
  min-height:100%;
  margin:0;
  font-family:"Rubik",system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Arial,sans-serif;
  color:var(--text);
  /* fundo fixo, sem repetir */
  background:
    radial-gradient(900px 400px at 10% 10%, rgba(229,57,53,.14), transparent 60%),
    radial-gradient(700px 340px at 90% 10%, rgba(255,59,48,.10), transparent 55%),
    var(--bg);
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

/* TOPBAR */
.topbar{
  position:sticky;
  top:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px;
  background:rgba(0,0,0,.35);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
  z-index:50;
}
.topbar-btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--text);
  text-decoration:none;
  font-weight:700;
}
.topbar-btn.ghost{width:44px; justify-content:center}
.topbar-btn:hover{border-color:rgba(255,255,255,.18)}
.brand{display:flex; align-items:center; gap:10px; min-width:0}
.brand-dot{
  width:10px; height:10px; border-radius:999px; background:var(--red);
  box-shadow:0 0 0 6px rgba(255,50,61,.12);
}
.brand-name{font-weight:900; letter-spacing:.4px; line-height:1}
.brand-sub{font-size:.84rem; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis}

/* WRAP + CARD */
.wrap{
  max-width:980px;
  margin:18px auto;
  padding:0 14px 28px;
}
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.card-head{padding:18px 18px 8px}
.card-head h1{margin:0 0 6px; font-size:1.35rem}
.card-head p{margin:0; color:var(--muted); font-size:.95rem}

.alert{
  margin:12px 18px 0;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--border);
  display:flex;
  gap:10px;
  align-items:flex-start;
}
.alert-err{background:rgba(255,50,61,.12); border-color:rgba(255,50,61,.25)}
.alert-ok{background:rgba(46,204,113,.12); border-color:rgba(46,204,113,.25)}
.alert i{margin-top:2px}

.form{padding:14px 18px 18px}

/* AVATAR */
.avatar-block{
  background:var(--card2);
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
  margin-bottom:14px;
}
.avatar-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.avatar-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
}
.avatar-preview{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
}
.avatar-preview img{
  width:46px; height:46px;
  border-radius:14px;
  object-fit:cover;
  border:1px solid rgba(255,255,255,.10);
}
.small{font-size:.82rem; color:var(--muted)}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-weight:800}

/* GRID AVATARES (uma única definição) */
.avatar-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:10px;

  overflow:hidden;
  max-height: 0;              /* JS vai setar o valor real */
  transition: max-height var(--anim) cubic-bezier(.2,.9,.2,1);
  will-change: max-height;
}
@media (min-width:640px){
  .avatar-grid{grid-template-columns: repeat(6, minmax(0,1fr));}
}
@media (min-width:980px){
  .avatar-grid{grid-template-columns: repeat(8, minmax(0,1fr));}
}

.avatar-item{
  cursor:pointer;
  border-radius:16px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  padding:8px 8px 10px;
  display:flex;
  flex-direction:column;
  gap:8px;
  text-align:left;
  color:var(--text);
  transition:transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.avatar-item:hover{transform:translateY(-1px); border-color:rgba(255,255,255,.18)}
.avatar-item.is-active{
  border-color:rgba(255,50,61,.55);
  box-shadow:0 0 0 3px rgba(255,50,61,.18);
}
.avatar-item img{
  width:100%;
  aspect-ratio:1/1;
  border-radius:12px;
  object-fit:cover;
  border:1px solid rgba(255,255,255,.10);
}
.avatar-label{
  font-size:.72rem;
  color:var(--muted);
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  text-align: center;
}

/* BOTÃO EXPAND */
.btn-expand{
  width:100%;
  margin-top:10px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--text);
  cursor:pointer;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.btn-expand:hover{border-color:rgba(255,255,255,.18)}
.btn-expand i{transition: transform .2s ease}
.btn-expand.is-open i{transform: rotate(180deg)}

/* GRID CAMPOS */
.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
  margin-top:12px;
}
@media (min-width:820px){
  .grid{grid-template-columns: 1fr 1fr;}
}
.field label{
  display:block;
  font-size:.88rem;
  color:var(--muted);
  margin:0 0 6px;
  font-weight:800;
}
.control{position:relative}
.control i{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  color:rgba(233,233,234,.55);
}
.control input{
  width:100%;
  padding:12px 12px 12px 38px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}
.control input:focus{
  border-color:rgba(255,255,255,.18);
  box-shadow:0 0 0 3px rgba(255,255,255,.06);
}

.control select{
  width:100%;
  padding:12px 12px 12px 38px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
  appearance:none;
}
.control select:focus{
  border-color:rgba(255,255,255,.18);
  box-shadow:0 0 0 3px rgba(255,255,255,.06);
}


.inline-err{
  display:none;
  margin:6px 0 0;
  color:#ff8086;
  font-weight:800;
  font-size:.88rem;
}

/* TERMS */
.terms{
  display:flex;
  gap:10px;
  align-items:flex-start;
  margin:12px 0 8px;
  color:var(--muted);
  font-weight:700;
}
.terms input{margin-top:3px}

.linklike{
  background:none;
  border:none;
  padding:0;
  margin:0;
  color:var(--red);
  text-decoration:underline;
  cursor:pointer;
  font-weight:900;
}

/* BOTÕES */
.btn-primary{
  width:100%;
  margin-top:6px;
  padding:12px 14px;
  border:none;
  border-radius:16px;
  background:var(--red);
  color:white;
  font-weight:900;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.btn-primary:hover{filter:brightness(1.05)}
.btn-secondary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  color:var(--text);
  text-decoration:none;
  font-weight:900;
}
.footer-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-top:12px;
}

/* MODAL */
.modal{
  display:none;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  justify-content:center;
  align-items:center;
  z-index:999;
  padding:14px;
}
.modal-content{
  width:min(520px, 100%);
  max-height:80vh;
  overflow:auto;
  border-radius:18px;
  border:1px solid var(--border);
  background:#12141a;
  box-shadow:var(--shadow);
  padding:18px;
  border-top:4px solid var(--red);
}
.modal-content h2{margin:0 0 8px}
.modal-content p{color:var(--muted); line-height:1.45}
.modal-content ul{color:var(--muted)}
.close-modal{
  position:sticky;
  top:0;
  float:right;
  border:none;
  background:var(--red);
  color:white;
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
}

.help-row{
  display:flex;
  justify-content:flex-end;
  margin-top:8px;
}
.esqueci{ /* garante que funcione bem como <a> também */
  background:none;
  border:none;
  padding:0;
  margin:0;
  color:var(--red);
  text-decoration:underline;
  cursor:pointer;
  font-weight:600;
  text-align: center;
}

/* =========================
   LOGIN: regras específicas
   ========================= */
.page-login .wrap{
  min-height: calc(100vh - 70px); /* topbar */
  display:flex;
  align-items:center;            /* centraliza vertical */
  justify-content:center;        /* centraliza horizontal */
}

.page-login .card{
  width: min(560px, 100%);       /* card mais “justinho” */
}

/* força inputs um embaixo do outro, SEM afetar cadastro */
.page-login .form-login .grid{
  grid-template-columns: 1fr !important;
}

/* opcional: dá uma respirada melhor */
.page-login .form-login{
  padding-top: 10px;
}

.login-header {
  /* background-color: #ff323d; */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* =========================
   Remove “cor do autofill” (Chrome/Edge/Safari)
   Mantém o autofill, só muda o visual
   ========================= */
.control input:-webkit-autofill,
.control input:-webkit-autofill:hover,
.control input:-webkit-autofill:focus,
.control input:-webkit-autofill:active{
  -webkit-text-fill-color: black !important;
  caret-color: var(--text) !important;

  /* pinta o fundo com a MESMA cor do seu input */
  -webkit-box-shadow: 0 0 0 1000px rgba(0,0,0,.25) inset !important;
  box-shadow: 0 0 0 1000px rgba(0,0,0,.25) inset !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px; /* igual ao seu input */
}

/* Firefox */
.control input:-moz-autofill{
  box-shadow: 0 0 0 1000px rgba(0,0,0,.25) inset !important;
  -moz-text-fill-color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px;
}
