/* =========================
   CSB • Área do Atleta (athlete.css)
   - Arquivo reescrito (sem duplicações)
========================= */

/* =========================
   Layout / Containers
========================= */
.athlete-narrow{
  max-width: 860px;
  margin: 0 auto;
}

/* respiro inferior por causa do menu fixo */
.app{
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}

/* container fluido (sem estourar no mobile) */
.container{
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding-left: clamp(12px, 3vw, 22px);
  padding-right: clamp(12px, 3vw, 22px);
}

/* Cabeçalho de páginas */
.page-head{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  justify-content:space-between;
  flex-wrap: wrap;
}
.head-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Grids auxiliares */
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid3{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
@media (max-width: 920px){
  .grid3{ grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px){
  .grid2{ grid-template-columns: 1fr; }
  .grid3{ grid-template-columns: 1fr; }
  .head-actions{ width:100%; justify-content:flex-start; }
  .head-actions .btn{ width:100%; }
}

/* Inputs 100% */
.field input, .field select, .field textarea{
  width: 100%;
  box-sizing: border-box;
}

/* =========================
   AUTH (centralizado e com menos topo no mobile)
========================= */
#viewAuth{
  min-height: calc(100vh - 92px);
  display:flex;
  align-items:center;
}
#viewAuth .auth-wrap{
  width:100%;
  display:flex;
  justify-content:center;
  padding: clamp(12px, 2.5vw, 22px);
}
#viewAuth .auth-wrap > .card{
  width: min(640px, 100%);
}
@media (max-width: 720px){
  #viewAuth{
    min-height: calc(100vh - 64px);
    align-items:flex-start;
  }
  #viewAuth .auth-wrap{
    padding-top: 10px;
    padding-bottom: 16px;
  }
}

/* =========================
   Listas (cards)
========================= */
.ath-cards{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.ath-card{
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,0.78);
  padding: 12px;
  box-shadow: 0 10px 24px rgba(15,23,42,0.05);
}

.ath-card-top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap: 10px;
  flex-wrap:wrap;
}

.ath-card-title{
  font-weight: 1000;
  font-size: 15px;
  line-height: 1.15;
}

.ath-card-sub{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  word-break: break-word;
}

/* =========================
   Orientações do dashboard
========================= */
.dash-guide-card{
  margin-bottom: 12px;
  border: 1px solid rgba(6,168,79,0.18);
}

.dash-guide-intro{
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px 18px;
  border-radius: 18px;
  background: #06A84F;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 18px 40px rgba(6,168,79,0.22);
  color: #ffffff;
}

.dash-guide-intro-icon{
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.16);
  color: #ffffff;
  font-size: 24px;
}

.dash-guide-intro-body{
  display: grid;
  gap: 5px;
}

.dash-guide-intro-label{
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: .92;
}

.dash-guide-intro-title{
  font-size: 15px;
  line-height: 1.35;
  font-weight: 1000;
  color: #ffffff;
}

.dash-guide-intro-text{
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255,255,255,0.94);
}

@media (max-width: 820px){
  .dash-guide-intro{
    padding: 16px;
    gap: 12px;
  }

  .dash-guide-intro-title{
    font-size: 15px;
  }

  .dash-guide-intro-icon{
    width: 46px;
    height: 46px;
    min-width: 46px;
    font-size: 20px;
  }
}

.dash-guide-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dash-step{
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(2,6,23,0.08);
  background: rgba(255,255,255,0.78);
  box-shadow: 0 10px 24px rgba(15,23,42,0.04);
}

.dash-step-icon{
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.dash-step-body{
  display: grid;
  gap: 6px;
}

.dash-step-title{
  font-size: 15px;
  font-weight: 1000;
  line-height: 1.2;
  color: var(--text);
}

.dash-step-text{
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.dash-step-actions{
  margin-top: 4px;
}

.dash-step-done .dash-step-icon{
  background: rgba(22,163,74,0.10);
  color: #15803d;
}

.dash-step-wait .dash-step-icon{
  background: rgba(245,158,11,0.12);
  color: #b45309;
}

.dash-step-info .dash-step-icon{
  background: rgba(15,75,140,0.10);
  color: var(--brand);
}

.dash-step-link .dash-step-icon{
  background: rgba(99,102,241,0.10);
  color: #4f46e5;
}

.dash-guide-foot{
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(2,6,23,0.08);
}

.dash-guide-foot a{
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.dash-guide-reopen{
  margin-bottom: 12px;
}

@media (max-width: 820px){
  .dash-guide-grid{
    grid-template-columns: 1fr;
  }
}

.ath-card-grid{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
@media (max-width: 640px){
  .ath-card-grid{ grid-template-columns: 1fr; }
}

.ath-field{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(15,75,140,0.04);
  border: 1px solid rgba(15,75,140,0.08);
}
.ath-field .k{
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.ath-field .v{
  font-size: 12px;
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}

.ath-actions{
  display:flex;
  justify-content:flex-end;
  gap: 8px;
  margin-top: 10px;
}
.btn-sm{
  padding: 8px 10px !important;
  border-radius: 12px !important;
  font-size: 12px !important;
}

/* =========================
   Carteirinha
========================= */
.ath-id-wrap{
  display:grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items:start;
}

/* controles (dropdown) */
.ath-id-controls{
  width: 100%;
}

.ath-id-card{
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(15,75,140,0.20);
  background: linear-gradient(180deg, rgba(15,75,140,0.10), rgba(255,255,255,0.85));
  padding: 14px;
  display:grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
  overflow: hidden;
}

@media (max-width: 640px){
  .ath-id-card{ grid-template-columns: 1fr; }
}

.ath-id-top{
  grid-column: 1 / -1;
  display:flex;
  gap: 10px;
  align-items:center;
}

.ath-id-logo{
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.ath-id-h{
  font-weight: 1000;
  font-size: 16px;
}

.ath-id-sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  overflow-wrap:anywhere;
}

.ath-id-body{
  display:grid;
  gap: 8px;
}

.ath-id-line{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.70);
  border: 1px solid rgba(15,75,140,0.10);
}
.ath-id-line span{
  font-size: 11px;
  color: var(--muted);
}
.ath-id-line b{
  font-size: 12px;
  text-align:right;
  overflow-wrap:anywhere;
}

.ath-id-qr{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(15,75,140,0.10);
}
.ath-id-qr canvas{
  width: 160px;
  height: 160px;
  max-width: 100%;
}

/* =========================
   FAB + menu atleta (mobile/desktop)
========================= */
.ath-fab-menu{
  position:fixed;
  right:14px;
  bottom:calc(14px + env(safe-area-inset-bottom));
  z-index:9600;
  width:52px;
  height:52px;
  border:none;
  border-radius:999px;
  background:linear-gradient(135deg,var(--csb-blue),var(--csb-blue-soft));
  color:#fff;
  display:none;
  align-items:center;
  justify-content:center;
  box-shadow:0 14px 34px rgba(9,50,98,.30);
  cursor:pointer;
}

.ath-fab-menu[hidden],
.ath-sheet[hidden],
.ath-sheet-backdrop[hidden]{
  display:none !important;
}
.ath-fab-menu i{
  font-size:22px;
  line-height:1;
}
.ath-fab-menu:hover{
  transform:translateY(-1px);
  box-shadow:0 18px 40px rgba(9,50,98,.36);
}

.ath-sheet-backdrop{
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(2,6,23,0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.ath-sheet-backdrop.show{
  opacity: 1;
  pointer-events: auto;
}

.ath-sheet{
  position:fixed;
  left:10px;
  right:10px;
  bottom:calc(10px + env(safe-area-inset-bottom));
  z-index:9600;
  transform:translateY(110%);
  transition:transform .20s ease;
  background:rgba(255,255,255,.99);
  border-radius:20px;
  border:1px solid rgba(2,6,23,0.10);
  box-shadow:0 -18px 48px rgba(2,6,23,.22);
  height:min(78vh, 620px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.ath-sheet.show{
  transform:translateY(0);
}
.ath-sheet-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:12px 12px 8px;
  border-bottom:1px solid rgba(2,6,23,0.08);
  flex:0 0 auto;
}
.ath-sheet-name{
  font-weight:1000;
  font-size:14px;
}
.ath-sheet-close{
  border:0;
  background:transparent;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  opacity:.75;
  padding:6px 8px;
}
.ath-sheet-close:hover{ opacity:1; }

.ath-sheet-body{
  flex:1 1 auto;
  min-height:0;
  padding:10px 12px 8px;
  display:grid;
  gap:12px;
  align-content:start;
  grid-auto-rows:max-content;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  scrollbar-color:rgba(15,75,140,.28) transparent;
}
.ath-sheet-body::-webkit-scrollbar{ width:4px; }
.ath-sheet-body::-webkit-scrollbar-track{ background:transparent; }
.ath-sheet-body::-webkit-scrollbar-thumb{
  background:rgba(15,75,140,.24);
  border-radius:999px;
}
.ath-sheet-body::-webkit-scrollbar-thumb:hover{
  background:rgba(15,75,140,.34);
}

.ath-menu-group{
  display:grid;
  gap:8px;
  align-content:start;
  grid-auto-rows:max-content;
}
.ath-menu-label{
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
  padding:2px 4px 0;
}

.ath-sheet-btn{
  width:100%;
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:flex-start !important;
  text-align:left !important;
  gap:10px;
  padding:11px 13px;
  font-size:14px;
  font-weight:800;
  line-height:1.1;
  color:var(--text) !important;
  border:1px solid rgba(15,75,140,.16);
  background:linear-gradient(180deg,#ffffff 0%, #f8fbff 100%);
  border-radius:14px;
  box-shadow:none;
}
.ath-sheet-btn:hover{
  border-color:rgba(15,75,140,.28);
  background:linear-gradient(180deg,#ffffff 0%, #f2f8ff 100%);
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}
.ath-sheet-btn i{
  flex:0 0 18px;
  width:18px;
  text-align:left;
  font-size:15px;
  opacity:.92;
  color:inherit !important;
}
.ath-sheet-btn span{
  flex:1 1 auto;
  display:block;
  text-align:left !important;
  font-size:14px;
  font-weight:800;
  color:inherit !important;
}

.ath-sheet-footer{
  flex:0 0 auto;
  padding:10px 12px calc(12px + env(safe-area-inset-bottom));
  border-top:1px solid rgba(2,6,23,0.08);
  background:rgba(255,255,255,.98);
}
.ath-sheet-btn-danger{
  border-color:rgba(239,68,68,.18);
  background:linear-gradient(180deg,#fff 0%, #fff6f6 100%);
}
.ath-sheet-btn-danger:hover{
  border-color:rgba(239,68,68,.30);
  background:linear-gradient(180deg,#fff 0%, #fff0f0 100%);
}

.ath-oc-body{
  padding:12px 14px;
  display:grid;
  gap:14px;
  align-content:start;
  grid-auto-rows:max-content;
  overflow:auto;
}
.ath-oc-footer{
  margin-top:auto;
  padding:12px 14px calc(14px + env(safe-area-inset-bottom));
  border-top:1px solid rgba(2,6,23,0.08);
  background:rgba(255,255,255,.98);
}

.ath-offcanvas .ath-sheet-btn{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:flex-start !important;
  text-align:left !important;
  gap:10px;
  padding:12px 14px;
  font-size:15px;
  font-weight:800;
  line-height:1.2;
  color:var(--text) !important;
  border:1px solid rgba(15,75,140,.16);
  background:linear-gradient(180deg,#ffffff 0%, #f8fbff 100%);
  border-radius:14px;
  box-shadow:none;
}
.ath-offcanvas .ath-sheet-btn:hover{
  border-color:rgba(15,75,140,.28);
  background:linear-gradient(180deg,#ffffff 0%, #f2f8ff 100%);
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}
.ath-offcanvas .ath-sheet-btn i{
  flex:0 0 18px;
  width:18px;
  text-align:left;
  font-size:16px;
  color:inherit !important;
}
.ath-offcanvas .ath-sheet-btn span{
  flex:1 1 auto;
  display:block;
  text-align:left !important;
  font-size:15px;
  font-weight:800;
  color:inherit !important;
}

@media (min-width: 920px){
  .ath-fab-menu{ display:none !important; }
  .ath-sheet{
    display:none !important;
  }
}
@media (max-width: 919px){
  .ath-fab-menu{ display:flex !important; }
  .ath-oc-backdrop,
  .ath-offcanvas,
  .top-user{
    display:none !important;
  }
}
@media (max-width: 560px){
  .ath-fab-menu{
    width:48px;
    height:48px;
    right:12px;
    bottom:calc(12px + env(safe-area-inset-bottom));
  }
  .ath-sheet{
    left:8px;
    right:8px;
    bottom:calc(8px + env(safe-area-inset-bottom));
    height:min(82vh, 620px);
  }
  .ath-sheet-btn{
    min-height:42px;
    padding:10px 11px;
    font-size:13px;
  }
  .ath-sheet-btn span{
    font-size:13px;
  }
  .ath-sheet-body::-webkit-scrollbar{
    width:3px;
  }
}

/* =========================
   Modal (bonitinho + responsivo)
========================= */
.modal-backdrop{
  position: fixed !important;
  inset: 0 !important;
  z-index: 9800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  background: rgba(2,6,23,0.55) !important;
  backdrop-filter: blur(6px);
}

.modal-backdrop .modal{
  position: relative !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  margin: 0 auto !important;
  width: min(560px, calc(100vw - 40px)) !important;
  max-width: 560px !important;
  max-height: min(86vh, 720px) !important;
  height: auto !important;
  transform: none !important;
  border-radius: 18px;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(2,6,23,0.10);
  box-shadow: 0 30px 110px rgba(2,6,23,0.45);
  overflow: auto;
  animation: modalIn .14s ease-out;
}

@keyframes modalIn{
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(2,6,23,0.08);
}

.modal-title{
  font-weight: 1000;
  font-size: 15px;
  line-height: 1.15;
}

.modal-close{
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: .75;
  padding: 6px 8px;
}
.modal-close:hover{ opacity: 1; }

.modal-body{
  padding: 12px 14px;
}

.modal-foot{
  display:flex;
  gap: 10px;
  justify-content:flex-end;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(2,6,23,0.08);
}

@media (max-width: 520px){
  .modal-foot{
    flex-direction: column-reverse;
  }
  .modal-foot .btn{
    width: 100%;
    justify-content:center;
  }
}

/* =========================
   Top user (desktop) + hide bottom bar on desktop
========================= */

/* por padrão (mobile): some o menu do topo */
.top-user{ display:none; }

/* botão do topo */
.top-user-btn{
  display:flex;
  align-items:center;
  gap: 10px;
  border: 1px solid rgba(2,6,23,0.10);
  background: rgba(255,255,255,0.70);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 8px 10px;
  cursor:pointer;
  box-shadow: 0 10px 24px rgba(15,23,42,0.06);
}
.top-user-btn:hover{
  background: rgba(255,255,255,0.85);
}
.top-user-text{
  display:flex;
  flex-direction:column;
  line-height: 1.05;
  text-align:right;
}
.top-user-name{
  font-weight: 1000;
  font-size: 13px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-user-email{
  font-size: 11px;
  color: var(--muted);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* desktop: mostra top-user e esconde bottom bar */
@media (min-width: 920px){
  .top-user{ display:block; }
  .ath-bottom-bar{ display:none !important; }
}

/* mobile: mantém bottom bar normal */
@media (max-width: 919px){
  .ath-bottom-bar{ display:block; }
}

/* =========================
   Top user (desktop) + Offcanvas
========================= */

/* por padrão (mobile): some o top-user */
.top-user{ display:none; }

/* texto separado do botão */
.top-user-text{
  display:flex;
  flex-direction:column;
  line-height: 1.05;
  text-align:right;
  margin-right: 10px;
}
.top-user-name{
  font-weight: 1000;
  font-size: 13px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-user-email{
  font-size: 11px;
  color: var(--muted);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* botão ícone menu */
.top-user-menu-btn{
  width: 40px;
  height: 40px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(2,6,23,0.10);
  background: rgba(255,255,255,0.70);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  cursor:pointer;
  box-shadow: 0 10px 24px rgba(15,23,42,0.06);
}
.top-user-menu-btn:hover{
  background: rgba(255,255,255,0.85);
}

/* desktop: mostra top-user e esconde bottom bar */
@media (min-width: 920px){
  .top-user{
    display:flex;
    align-items:center;
    gap: 0;
  }
  .ath-bottom-bar{ display:none !important; }
}

/* mobile: mantém bottom bar normal */
@media (max-width: 919px){
  .ath-bottom-bar{ display:block; }
}

/* =========================
   Offcanvas (desktop)
========================= */
.ath-oc-backdrop{
  position: fixed;
  inset: 0;
  z-index: 9650;
  background: rgba(2,6,23,0.55);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.ath-oc-backdrop.show{
  opacity: 1;
  pointer-events: auto;
}

.ath-offcanvas{
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(360px, 92vw);
  z-index: 9700;
  background: rgba(255,255,255,0.96);
  border-left: 1px solid rgba(2,6,23,0.10);
  box-shadow: -24px 0 80px rgba(2,6,23,0.30);
  transform: translateX(110%);
  transition: transform .20s ease;
  display:flex;
  flex-direction:column;
  padding-bottom: env(safe-area-inset-bottom);
}
.ath-offcanvas.show{
  transform: translateX(0);
}

.ath-oc-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(2,6,23,0.08);
}
.ath-oc-name{ font-weight: 1000; font-size: 14px; }
.ath-oc-close{
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: .75;
  padding: 6px 8px;
}
.ath-oc-close:hover{ opacity: 1; }

.ath-oc-body{
  padding: 12px 14px 14px;
  display:grid;
  gap: 10px;
}

/* offcanvas só faz sentido no desktop */
@media (max-width: 919px){
  .ath-oc-backdrop, .ath-offcanvas{ display:none !important; }
}

/* =========================
   CEP simples + alinhamento do cadastro
========================= */
#pZip{
  width: 100%;
}

.btn-inline-logout{
  min-width: 116px;
  justify-content: center;
}

#viewGate .page-head,
#viewProfile .page-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

#viewProfile .grid3{
  align-items: start;
}

#viewProfile .field{
  display: flex;
  flex-direction: column;
  align-self: start;
  height: 100%;
}

#viewProfile .field > span{
  display: block;
  min-height: 18px;
  margin-bottom: 6px;
}

#viewProfile .field > input,
#viewProfile .field > select{
  width: 100%;
}

#viewProfile .field > .muted.small{
  display: block;
  margin-top: 6px;
  min-height: 38px;
  line-height: 1.35;
}

.profile-save-bottom{
  margin-top: 14px;
}
.profile-save-bottom .btn{
  width: 100%;
  justify-content: center;
}

/* respiro extra para não colar no rodapé/menu */
#viewProfile .container{
  padding-bottom: 14px;
}

@media (max-width: 720px){
  #viewGate .page-head,
  #viewProfile .page-head{
    flex-direction: column;
    align-items: stretch;
  }

  .btn-inline-logout{
    width: 100%;
  }

  #viewProfile .field > .muted.small{
    min-height: 0;
  }
}

#viewProfile .grid3 > .field[style*="grid-column: span 2;"]{
  align-self: start;
}

.entity-access-card{
  margin-bottom: 14px;
  border: 1px solid rgba(15, 75, 140, 0.14);
  background:
    linear-gradient(180deg, rgba(15,75,140,.05), rgba(15,75,140,.02)),
    #fff;
}

.entity-access-head{
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.entity-access-icon{
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex: 0 0 52px;
  background: rgba(15, 75, 140, 0.10);
  color: #0f4b8c;
  font-size: 1.3rem;
}

.entity-access-body{
  min-width: 0;
}

.entity-access-label{
  font-size: .78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #0f4b8c;
  margin-bottom: 4px;
}

.entity-access-title{
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1.3;
  color: #0f172a;
  margin-bottom: 4px;
}

.entity-access-text{
  color: #475569;
  line-height: 1.5;
}

.entity-access-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.entity-access-actions .btn{
  min-width: 220px;
  justify-content: center;
}

/* respiro entre carteirinha e orientações do dashboard */
#cardCarteirinha{
  margin-bottom: 14px;
}

@media (max-width: 720px){
  .entity-access-head{
    flex-direction: column;
  }

  .entity-access-actions{
    flex-direction: column;
  }

  .entity-access-actions .btn{
    width: 100%;
    min-width: 0;
  }
}

/* =========================
   Gate - erro visual nos campos
========================= */
.field.field-error > input,
.field.field-error > select,
.field input.input-error,
.field select.input-error{
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
  background: rgba(220, 38, 38, 0.03);
}

.field.field-error > span{
  color: #b91c1c;
}

/* =========================
   Auth: senha com olho + validações
========================= */
.password-wrap{
  position: relative;
  width: 100%;
}

.password-wrap > input{
  width: 100%;
  padding-right: 44px;
}

.password-toggle{
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 10px;
  opacity: .9;
}

.password-toggle:hover{
  background: rgba(15,75,140,0.08);
  color: var(--text);
}

.password-toggle i{
  font-size: 16px;
  line-height: 1;
}

.field.field-error .password-wrap > input,
.password-wrap > input.input-error{
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
  background: rgba(220, 38, 38, 0.03);
}

/* =========================
   Busy overlay: ação de cancelar
========================= */
.busy-actions{
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.busy-actions .btn{
  min-width: 140px;
  justify-content: center;
}

/* =========================
   Scrollbar desktop invisível
========================= */
@media (min-width: 920px){
  html,
  body{
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar{
    width: 0;
    height: 0;
  }
}

@media (max-width: 919px){
  html,
  body{
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .app{
    min-height: 100dvh;
  }

  .view{
    min-height: auto;
  }
}

/* =========================
   Auth helper / perfis vinculados
========================= */
.auth-helper-toggle{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin-top:14px;
  padding:12px 14px;
  border:1px solid rgba(15,75,140,0.12);
  border-radius:16px;
  background:rgba(15,75,140,0.04);
  cursor:pointer;
}

.auth-helper-toggle input{
  width:18px;
  height:18px;
  margin-top:2px;
  accent-color: var(--brand);
}

.auth-helper-toggle span{
  font-size:13px;
  line-height:1.45;
  color:var(--text);
}

.auth-helper-toggle-inline{
  margin-top:0;
}

#authGuardianHintBox{
  margin-top:10px;
}

.linked-gate-help{
  border:1px solid rgba(15,75,140,0.12);
  background:rgba(15,75,140,0.04);
}

.linked-profiles-card{
  margin-bottom:14px;
  border:1px solid rgba(15,75,140,0.10);
  background:
    linear-gradient(180deg, rgba(15,75,140,.025), rgba(15,75,140,.01)),
    #fff;
}

.linked-inline-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.linked-inline-current{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1 1 320px;
  min-width:0;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(15,75,140,0.08);
  background:rgba(15,75,140,0.035);
}

.linked-inline-current i{
  font-size:16px;
  color:var(--brand);
  flex:0 0 auto;
}

.linked-inline-current span{
  min-width:0;
  color:var(--text);
  line-height:1.4;
}

.linked-inline-current b{
  color:var(--text);
}

.linked-inline-switch{
  min-width:180px;
  justify-content:center;
  white-space:nowrap;
}

.linked-modal-list{
  display:grid;
  gap:10px;
  margin-top:12px;
}

.linked-modal-item{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(2,6,23,0.08);
  background:rgba(255,255,255,0.82);
  box-shadow:0 10px 24px rgba(15,23,42,0.04);
}

.linked-modal-title{
  font-size:15px;
  font-weight:1000;
  line-height:1.2;
  color:var(--text);
}

.linked-modal-subtitle{
  margin-top:4px;
  font-size:12px;
  line-height:1.45;
  color:var(--muted);
  overflow-wrap:anywhere;
}

.linked-modal-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

@media (max-width: 780px){
  .linked-inline-row{
    align-items:stretch;
  }

  .linked-inline-current{
    width:100%;
  }

  .linked-inline-switch{
    width:100%;
    justify-content:center;
  }

  .linked-modal-item{
    flex-direction:column;
  }

  .linked-modal-actions{
    width:100%;
  }

  .linked-modal-actions .btn{
    width:100%;
    justify-content:center;
  }
}
