/* ./static/css/cadastro.css */
/* ATENÇÃO: não altera IDs/classes do HTML, só organiza visual/UX */

:root{
  --bg:#f6f8fb;
  --text:#0f172a;
  --muted:#64748b;
  --border:#e5e7eb;
  --brand:#6366f1;
  --brand2:#0ea5e9;
  --chip:#f1f5f9;
  --shadow: 0 18px 44px rgba(2,6,23,.10);
  --radius: 16px;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html, body{ height:100%; }

body{
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(1100px 760px at 10% -10%, rgba(99,102,241,.12), transparent 60%),
    radial-gradient(900px 620px at 90% 0%, rgba(14,165,233,.10), transparent 60%),
    var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ===== Topbar ===== */
.topbar{
  height: 72px; /* levemente menor */
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(229,231,235,.9);
  background: rgba(255,255,255,.74);
  backdrop-filter: blur(10px);
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 240px;
}

.brand-badge{
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99,102,241,.95), rgba(14,165,233,.85));
  color:#fff;
  display:grid;
  place-items:center;
  box-shadow: 0 10px 22px rgba(99,102,241,.22);
  font-size: 16px;
  flex: 0 0 auto;
}

.brand-title{
  display:flex;
  flex-direction:column;
  line-height:1.12;
}

.brand-title strong{
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .2px;
}

.brand-title span{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 650;
}

.topbar-center{
  display:flex;
  align-items:center;
  justify-content:center;
  flex: 1;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint-pill{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px; /* menor */
  background: rgba(241,245,249,.78);
  border: 1px solid rgba(229,231,235,.9);
  border-radius: 999px;
  max-width: 100%;
}
.hint-pill i{ color: var(--brand); }

.topbar-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 240px;
  justify-content:flex-end;
}

/* ===== Botões ===== */
.btn{
  border: 1px solid rgba(229,231,235,.95);
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 9px 12px; /* menor */
  font-weight: 850;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s ease;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  white-space: nowrap;
}

.btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(2,6,23,.08);
}

.btn-primary{
  border: none;
  background: linear-gradient(135deg, rgba(99,102,241,.95), rgba(14,165,233,.90));
  color:#fff;
  box-shadow: 0 14px 30px rgba(99,102,241,.20);
}

.btn-ghost{
  background: rgba(241,245,249,.78);
  border: 1px solid rgba(229,231,235,.95);
  color: var(--text);
}

/* ===== Page ===== */
.page{
  height: calc(100vh - 72px);
  padding: 14px 16px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.content{
  flex: 1;
  overflow: auto;
  padding-bottom: 18px;
}

.grid-forms{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px; /* menor */
}

@media (min-width: 980px){
  .grid-forms{
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* ===== Painéis ===== */
.panel{
  background: rgba(255,255,255,.80);
  border: 1px solid rgba(229,231,235,.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head{
  padding: 14px 16px; /* menor */
  border-bottom: 1px solid rgba(229,231,235,.9);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
  background:
    radial-gradient(900px 400px at 10% 0%, rgba(99,102,241,.10), transparent 60%),
    radial-gradient(900px 400px at 90% 0%, rgba(14,165,233,.08), transparent 60%),
    rgba(255,255,255,.55);
}

.panel-title{
  display:flex;
  flex-direction:column;
  line-height: 1.15;
}

.panel-title strong{
  font-size: 15px;
  font-weight: 900;
  display:flex;
  align-items:center;
  gap: 10px;
}

.panel-title span{
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 650;
}

.panel-body{ padding: 14px; } /* menor */

/* ===== Form ===== */
.form-row{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;           /* menor */
  margin-bottom: 10px; /* menor */
}
@media (min-width: 620px){
  .form-row.two{ grid-template-columns: 1fr 1fr; }
}

.form-label{
  display:block;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}

.required{ color:#ef4444; }

.input-wrapper{ position:relative; }

.input-icon{
  position:absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 15px;
  pointer-events:none;
}

.form-input{
  width: 100%;
  padding: 10px 12px 10px 40px; /* menor */
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px; /* menor */
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: all .2s ease;
}

.form-input:focus{
  outline:none;
  border-color: rgba(99,102,241,.55);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}

.form-select{
  width:100%;
  padding: 10px 12px; /* menor */
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px; /* menor */
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: all .2s ease;
}

.password-toggle{
  position:absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background:none;
  border:none;
  color: var(--muted);
  cursor:pointer;
  font-size: 16px;
  padding: 0;
}

/* ===== Termos ===== */
.terms{
  margin-top: 8px;
  padding: 12px; /* menor */
  border-radius: 14px;
  border: 1px solid rgba(229,231,235,.9);
  background: rgba(241,245,249,.65);
}

.checkbox-wrapper{
  display:flex;
  align-items:flex-start;
  gap: 10px;
  margin-bottom: 0; /* compacta */
}
.checkbox{
  width: 18px; height: 18px; min-width: 18px; /* menor */
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: all .2s ease;
  margin-top: 2px;
}
.checkbox.checked{ background: var(--brand); border-color: var(--brand); }
.checkbox.checked i{ color:#fff; font-size: 11px; }

.checkbox-label{
  font-size: 13px;
  color: var(--text);
  line-height: 1.45; /* menor */
  font-weight: 650;
  cursor: pointer;
}
.checkbox-label a{
  color: var(--brand);
  text-decoration:none;
  font-weight: 900;
}
.checkbox-label a:hover{ text-decoration: underline; }

/* ===== Ações: desktop sticky discreto / mobile normal ===== */
/* Base: normal (não flutua) */
.footer-actions{ display:none !important; }

/* Dica some (limpa) */
.footer-actions .hint{ display:none; }

.footer-actions .buttons{
  display:flex;
  gap: 10px;
  align-items:center;
  justify-content:flex-end;
}

/* Desktop: botão sempre acessível sem “card flutuante” */
@media (min-width: 980px){
  .content{ padding-bottom: 90px; } /* espaço para o sticky não encostar no fim */

  .footer-actions{
    position: sticky;
    bottom: 12px;
    z-index: 10;
    justify-content:flex-end;
    padding: 8px 0;
    background: linear-gradient(to top, rgba(246,248,251,.92), rgba(246,248,251,0));
  }

  .footer-actions .buttons{
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(229,231,235,.9);
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 16px 34px rgba(2,6,23,.10);
  }
}

/* ===== Ajuste pedido: manter só 1 botão de voltar no topo ===== */
#btnGoLoginTop{ display:none !important; }
#btnBack{ display:none !important; }

/* ===== Tom Select ===== */
.ts-control{
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  padding: 9px 10px !important; /* menor */
  box-shadow: none !important;
}
.ts-control, .ts-dropdown{
  font-family: Inter, system-ui, -apple-system, sans-serif !important;
  font-size: 14px !important; /* menor */
}
.ts-dropdown{
  border-radius: 12px !important;
  border: 1px solid rgba(229,231,235,.95) !important;
  overflow: hidden !important;
}

/* ===== intl-tel-input ===== */
.iti{ width: 100%; }
.iti__tel-input{ width: 100% !important; }
.iti__flag-container{ border-radius: 12px 0 0 12px; }

/* ===== Bandeira no TomSelect ===== */
.country-option{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 2px 0;
}
.country-left{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
}

.country-flag{
  width: 24px;
  height: 18px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(2,6,23,.12);
  flex: 0 0 auto;
  position: relative;
  background: #f1f5f9;
}
.country-flag .iti__flag{
  position: absolute;
  top: 0;
  left: 0;
}

.country-name{
  font-weight: 850;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}
.country-dial{ display:none; }

/* ===== Mobile ===== */
@media (max-width: 520px){
  .brand-title span{ display:none; }
  .topbar-center{ display:none; }
  .topbar-actions{ min-width:auto; }

  .btn{ padding: 10px; }
  .btn span{ display:none; }

  /* No mobile NÃO é sticky (evita barra fixa) */
  .footer-actions{ position: static; }
  .content{ padding-bottom: 18px; }

  .footer-actions .buttons{ width:100%; }
  .footer-actions .buttons .btn{ width: 100%; justify-content: center; }

  .country-name{ max-width: 220px; }
}

/* ===== Scrollbar ===== */
.content::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
.content::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ===== Validação ===== */
.is-invalid{
  outline: 2px solid rgba(239,68,68,.35) !important;
  border-color: rgba(239,68,68,.55) !important;
  box-shadow: 0 0 0 4px rgba(239,68,68,.12) !important;
}

/* SweetAlert2 sempre acima */
.swal2-container{ z-index: 99999 !important; }

/* ===== Novo layout: ações dentro do painel (sem footer flutuante) ===== */
.actions-inline{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap: 10px;
}

@media (max-width: 520px){
  .actions-inline{ justify-content: stretch; }
  .actions-inline .btn{ width:100%; justify-content:center; }
}

/* Termos compactos quando usados lado a lado com o Cargo/Função */
.terms.terms-inline{
  margin-top: 0;
  padding: 10px;
  height: 100%;
  display:flex;
  align-items:center;
}

.terms.terms-inline .checkbox-wrapper{
  margin-bottom: 0;
}

.terms.terms-inline .checkbox-label{
  font-size: 12.5px;
  line-height: 1.35;
}
