/* Variáveis de Cores e Fonte */
:root {
  --pico-font-family-sans-serif: Roboto, Tahoma, Arial, system-ui, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --pico-form-element-spacing-vertical: 0.35rem;
  --pico-form-element-spacing-horizontal: 0.35rem;
  --app-header-bg: #0172ad;
  --pico-font-family: var(--pico-font-family-sans-serif);
}

.turnstile-container {
    margin: 12px 0 6px;
    min-height: 65px;
}

html, body, #app {
  background: var(--pico-background-color);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: max(env(safe-area-inset-top, 0px), 2px);
  background: var(--app-header-bg);
  pointer-events: none;
  z-index: 2000;
}

titulo {
   font-size: 1.2rem;
   font-weight: bold;
   color: var(--pico-primary);
   display: block;
   margin-bottom: 0.2rem;
}

article {
  padding: 0.6rem 0.6rem 0.6rem 0.6rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-radius: 8px; 
  overflow: hidden;
}

article > header h5 {
  margin: 0;
  line-height: 1.15;
}

article > header small {
  display: block;
  margin-top: 0.1rem;
  line-height: 1.15;
}

/* Área de Conteúdo Principal */
main {
  padding: 0.5rem 0.4rem 0.3rem 0.4rem;
}

/* Estilos globais para botões de ação em listas */
.acoes-mini {
  display: flex;
  gap: 0.25rem;
}

.linha {
  display: flex;
  gap: 0.4rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.topo {
  display: flex;
  gap: 6rem;
  flex-wrap: nowrap;
}


.linha button {
  flex: 0 0 auto;
  width: auto;
  min-width: 160px;
  padding: 0.5rem 0.9rem;
}

/* NO CELULAR: esconde o texto e deixa só o ícone */
@media (max-width: 768px) {
  .btn-text {
    display: none;
  }

  .linha button {
    min-width: 48px; 
    padding: 0.45rem 0.6rem;
  }
}

.btn-icon {
  padding-right: 0.6rem !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--pico-muted-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  width: auto !important;
  margin: 0 !important;
}

.btn-icon svg {
  width: 18px !important;
  height: 18px !important;
}

.btn-icon:hover {
  color: var(--pico-primary) !important;
  background: rgba(0, 0, 0, 0.05) !important;
  border-radius: 4px;
}

.btn-delete:hover {
  color: #ef4444 !important;
}

/* Reset para botões dentro de flexbox nos footers de modal */
dialog footer button {
  margin-bottom: 0 !important;
}

.raio {
  border-radius: 0.75rem;
  overflow: hidden;
  /* Garante que o conteúdo não "vaze" pelas pontas redondas */
}

/* Estilos Desktop (Media Query) */
@media (min-width: 768px) {

  .meu-container {
    max-width: 600px;
    margin: 0 auto;
  }
}

/* Login Container */
.login-container {
  max-width: 400px;
  margin: 4rem auto;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Ajuste de Modais para o topo no Mobile */
@media (max-width: 767px) {
  dialog.modal-top {
    align-items: flex-start !important;
    padding-top: 1rem !important;
  }
}

/* Esconder elementos condicionalmente */
.hidden {
  display: none !important;
}

.theme-options {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.theme-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-option {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: 0.5rem;
  cursor: pointer;
  color: var(--pico-muted-color);
  background: var(--pico-background-color);
  transition: all 0.2s ease;
}


.theme-option.active {
  border-color: var(--pico-primary);
  color: var(--pico-muted-color);

  background: color-mix(in srgb, var(--pico-primary) 10%, transparent);
}

.theme-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.context-option {
  margin-bottom: 0.2rem;
  width: 100%;
  text-align: left;
  padding: 0.2rem;
  background: var(--pico-primary);
}

.context-option.active {
  border-color: var(--pico-primary);
  color: var(--pico-primary);
  background: color-mix(in srgb, var(--pico-primary) 10%, transparent);
}

.context-current-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.08rem 0.35rem;
  border-radius: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.1;
  color: var(--pico-primary);
  border: 1px solid color-mix(in srgb, var(--pico-primary) 55%, transparent);
  background: color-mix(in srgb, var(--pico-primary) 13%, transparent);
  vertical-align: middle;
}

.perfil-account-body {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.perfil-avatar-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  background: color-mix(in srgb, var(--pico-primary) 16%, transparent);
  color: var(--pico-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#perfil-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#perfil-avatar {
  font-size: 1.5rem !important;
  font-weight: 700;
}

.perfil-error {
  color: #d32f2f;
  margin: 0.4rem 0 0 0;
}

@media (min-width: 768px) {
  .perfil-page {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .perfil-card-account {
    grid-column: 1 / -1;
  }
}
