/* assets/style.css */

/* ====== VARIÁVEIS GLOBAIS ====== */
:root{
  --top:#000;
  --mid:#ececec;
  --bot:#000;
  --card:#fff;
  --text:#111;
  --muted:#666;
  --err:#b00020;
  --radius:14px;
  --radius-sm:10px;
  --shadow:0 8px 24px rgba(0,0,0,.08);
  --maxw:980px;
}

/* ====== RESET ====== */
*{box-sizing:border-box}
html,body{margin:0;padding:0}

/* ====== LAYOUT BASE ====== */
body{
  font-family: Arial, Helvetica, sans-serif;
  color:var(--text);
  background:var(--mid);
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

header{
  background:var(--top);
  padding:22px 16px;
  display:flex;
  justify-content:center;
  align-items:center;
}

.logo{
  width:200px;
  max-width:80vw;
  height:auto;
  display:block;
}

main{
  background:var(--mid);
  flex:1;
  padding:18px 12px 22px;
}

.container{
  width:100%;
  max-width:var(--maxw);
  margin:0 auto;
}

.card{
  background:var(--card);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
}

footer{
  background:var(--bot);
  color:#fff;
  text-align:center;
  padding:14px 10px;
  font-size:14px;
}

/* ====== HOME ====== */
.home-title{
  text-align:center;
  margin:0 0 6px;
  line-height:1.25;
  word-break:break-word;
}
.home-sub{
  text-align:center;
  color:var(--muted);
  margin:0 0 18px;
  line-height:1.4;
}

/* CENTRALIZA NO WEB CONFORME QUANTIDADE DE BOTÕES VISÍVEIS */
.menu-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 280px));
  justify-content:center;
  gap:12px;
}

.menu-btn{
  border:none;
  border-radius:12px;
  padding:14px 12px;
  cursor:pointer;
  font-weight:600;
  background:#111;
  color:#fff;
  transition:transform .08s ease, opacity .2s ease;
  min-height:48px;
  width:100%;
  text-align:center;
  white-space:normal;
  word-break:break-word;
}
.menu-btn:hover{opacity:.92}
.menu-btn:active{transform:translateY(1px)}

.notfound{ text-align:center; padding:10px 4px; }
.notfound h2{margin:0 0 6px}
.notfound p{margin:0 0 14px;color:var(--muted)}
.notfound-inner h2{margin:0 0 6px;text-align:center}
.notfound-inner p{margin:0;color:var(--muted);text-align:center}

/* ====== FORMULÁRIOS ====== */
.page-title{ text-align:center; margin:0 0 10px; }
.page-sub{ text-align:center; color:var(--muted); margin:0 0 14px; }
.section-title{ margin:16px 0 8px; font-size:18px; }

.row { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:8px; }
.two-cols .field { flex:1 1 220px; min-width:180px; }
.three-cols .field { flex:1 1 220px; min-width:180px; }
.four-cols .field { flex:1 1 180px; min-width:160px; }

.field { width:100%; margin-bottom:6px; display:flex; flex-direction:column; }
label { font-weight:600; margin-bottom:6px; font-size:14px; }

input,select {
  padding:12px;
  border-radius:var(--radius-sm);
  border:1px solid #ccc;
  font-size:14px;
  background:#fff;
}
input:focus, select:focus {
  outline:2px solid rgba(0,0,0,.06);
  border-color:rgba(0,0,0,.12);
}

/* hardening A11y: mantém visual atual */
input[aria-invalid="true"], select[aria-invalid="true"]{
  border-color:var(--err);
  box-shadow:0 0 0 3px rgba(176,0,32,0.06);
}

.hint { font-size:12px; min-height:18px; color:var(--err); margin-top:6px; }
.req { color:var(--err); }
input.invalid, select.invalid {
  border-color:var(--err);
  box-shadow:0 0 0 3px rgba(176,0,32,0.06);
}

/* erro global inline */
.form-global-error{
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #dc2626;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 8px;
  font-size: 14px;
}

.actions-top{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin:10px 0 8px;
}
.actions-bottom{
  margin-top:16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.right-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.btn-primary {
  padding:12px 18px;
  background:#111;
  color:#fff;
  border:none;
  border-radius:10px;
  cursor:pointer;
}
.btn-outline {
  padding:10px 12px;
  background:#f7f7f7;
  border:1px solid #ddd;
  border-radius:8px;
  cursor:pointer;
}
.muted{ color:var(--muted); }

/* Natureza / Porte / Regime */
.trio-nat-porte-regime{
  display:flex;
  gap:12px;
  align-items:stretch;
  flex-wrap:nowrap;
}
.trio-nat-porte-regime .field{
  flex:1 1 0;
  min-width:0;
}

/* Atividades */
#atividades{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.atividade-principal-item,
.atividade-secundaria-item{
  display:flex;
  align-items:center;
  gap:8px;
}
.atividade-principal-item input[name="atividade[]"],
.atividade-secundaria-item input[name="atividade[]"]{
  flex:1 1 auto;
  width:100%;
  margin-top:0 !important;
  min-height:42px;
}
.btn-trash-atividade{
  border:1px solid #ddd;
  background:#fff;
  border-radius:8px;
  width:40px;
  min-width:40px;
  height:40px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  line-height:1;
}
.btn-trash-atividade:hover{ background:#f7f7f7; }

/* ====== 404 ====== */
.page-404{ margin:0; display:flex; min-height:100vh; flex-direction:column; }
.head-404{ display:flex; align-items:center; gap:12px; }
.logo-404{ height:40px; width:auto; }
.brand-404{ font-weight:600; color:#fff; }

.main-404{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#efefef;
}
.box-404{
  background:#fff;
  padding:28px;
  border-radius:10px;
  max-width:760px;
  text-align:center;
  box-shadow:0 8px 28px rgba(0,0,0,0.08);
}
.btn-link-404{
  display:inline-block;
  margin-top:8px;
  padding:8px 12px;
  background:#111;
  color:#fff;
  border-radius:6px;
  text-decoration:none;
}

/* ====== RESPONSIVO ====== */
@media (max-width:992px){
  .trio-nat-porte-regime{
    flex-direction:column;
    gap:10px;
    flex-wrap:nowrap;
  }
  .trio-nat-porte-regime .field{
    flex:1 1 100%;
    width:100%;
    min-width:0;
  }

  .menu-grid{
    grid-template-columns:repeat(2, minmax(180px, 1fr));
    justify-content:stretch;
  }
}

@media (max-width:860px){
  .menu-grid{
    grid-template-columns:1fr;
    justify-content:stretch;
  }
  .card{padding:14px}
}

@media (max-width:560px){
  .two-cols .field, .three-cols .field, .four-cols .field { flex:1 1 100%; min-width:0; }
  .actions-bottom { flex-direction:column; align-items:stretch; }
  .right-actions { width:100%; }
  .btn-primary, .btn-outline { width:100%; }

  main{ padding:14px 8px 18px; }
  .card{ border-radius:12px; padding:12px; }
  .home-title{ font-size:1.1rem; }
  .home-sub{ font-size:.93rem; margin-bottom:14px; }
}

/* ====== PERFIL ADMINISTRATIVO - QUADRO E POPUPS ====== */
.perfil-admin-box{
  border:1px solid #ddd;
  border-radius:10px;
  padding:10px;
  background:#fafafa;
}
.perfil-admin-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.perfil-item{
  border:1px solid #e5e5e5;
  border-radius:8px;
  padding:8px 10px;
  display:flex;
  align-items:center;
  gap:8px;
  background:#fff;
}
.perfil-item span{
  flex:1;
  font-size:14px;
}
.perfil-info{
  width:24px;
  height:24px;
  min-width:24px;
  border:1px solid #bbb;
  border-radius:50%;
  background:#fff;
  cursor:pointer;
  font-weight:700;
  line-height:1;
}
.perfil-info:hover{ background:#f2f2f2; }
@media (max-width:860px){
  .perfil-admin-grid{ grid-template-columns:1fr; }
}

/* ====== PERFIL ADMINISTRATIVO - RESPONSIVO ====== */
.perfil-admin-box{
  border:1px solid #ddd;
  border-radius:10px;
  padding:10px;
  background:#fafafa;
}
.perfil-admin-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(240px,1fr));
  gap:10px;
}
.perfil-item{
  border:1px solid #e5e5e5;
  border-radius:10px;
  padding:10px 12px;
  display:flex;
  align-items:center;
  gap:10px;
  background:#fff;
  min-height:50px;
}
.perfil-item input[type="radio"]{
  margin:0;
  flex:0 0 auto;
}
.perfil-item span{
  flex:1;
  min-width:0;
  line-height:1.3;
  word-break:break-word;
}
.perfil-info{
  width:26px;
  height:26px;
  min-width:26px;
  border:1px solid #bbb;
  border-radius:50%;
  background:#fff;
  cursor:pointer;
  font-weight:700;
  line-height:1;
}
.perfil-info:hover{ background:#f2f2f2; }

.btn-remove-socio{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  border:1px solid #d9d9d9;
  border-radius:10px;
  background:#fff;
  color:#111;
  cursor:pointer;
  font-weight:600;
}
.btn-remove-socio:hover{ background:#f7f7f7; }
.btn-remove-socio .trash-icon{
  font-size:16px;
  line-height:1;
}

@media (max-width:860px){
  .perfil-admin-grid{
    grid-template-columns:1fr;
  }
}

/* ====== DIVISÃO VISUAL DOS SÓCIOS ====== */
#sociosContainer{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.card-socio.socio-divider{
  border:1px solid #e6e6e6;
  border-radius:12px;
  background:#fff;
  box-shadow:0 2px 10px rgba(0,0,0,.04);
  padding:14px;
  position:relative;
}

.card-socio.socio-divider + .card-socio.socio-divider{
  border-top:3px solid #111;
}

.card-socio.socio-divider .card-title{
  margin-top:0;
  margin-bottom:10px;
  padding-bottom:8px;
  border-bottom:1px dashed #d8d8d8;
}

.card-socio.socio-divider.is-new{
  animation:socioIn .45s ease-out;
}

@keyframes socioIn{
  from{ opacity:.4; transform:translateY(6px); }
  to{ opacity:1; transform:translateY(0); }
}

@media (max-width:560px){
  .card-socio.socio-divider{
    padding:12px;
  }
}
