/* ==================================================================
   Páginas de autenticação · layout centrado com card
   ================================================================== */

body.auth-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--bg) 0%, #EDF0F4 100%);
}

.auth-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 44px;
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  width: 100%;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
}
.auth-brand .brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue) 0%, var(--teal) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-weight: 900;
  font-size: 20px;
}
.auth-brand .brand-mark::before { content: 'b'; }
.auth-brand-name {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.5px;
}

.auth-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-align: center;
  margin-bottom: 6px;
}
.auth-sub {
  font-size: 13.5px;
  color: var(--text-sec);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.55;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}
.auth-input {
  font-family: inherit;
  font-size: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--text);
  outline: none;
  transition: all .15s;
}
.auth-input:focus {
  border-color: var(--text);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(15,20,25,0.05);
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-sec);
  line-height: 1.5;
  margin: 4px 0;
}
.auth-check input {
  margin-top: 3px;
  width: 15px; height: 15px;
  accent-color: var(--teal);
  flex-shrink: 0;
}
.auth-check a { color: var(--teal); text-decoration: none; font-weight: 600; }
.auth-check a:hover { text-decoration: underline; }

.auth-submit {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 13px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--blue) 0%, var(--teal) 100%);
  color: #FFF;
  cursor: pointer;
  margin-top: 8px;
  transition: all .15s;
}
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(30,58,95,0.22); }
.auth-submit:active { transform: translateY(0); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

.auth-footer {
  text-align: center;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--text-sec);
}
.auth-footer a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 700;
}
.auth-footer a:hover { text-decoration: underline; }

.auth-alert {
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
  display: none;
}
.auth-alert.visible { display: block; }
.auth-alert.error { background: var(--red-soft); color: var(--red); border: 1px solid #F9CACA; }
.auth-alert.success { background: var(--green-soft); color: var(--green); border: 1px solid #BFE6D1; }
.auth-alert.info { background: #E0F2FE; color: #0369A1; border: 1px solid #BAE0F7; }

.auth-hint-link {
  display: inline-block;
  font-size: 12px;
  color: var(--teal);
  text-decoration: none;
  margin-top: 4px;
  font-weight: 600;
}
.auth-hint-link:hover { text-decoration: underline; }

.password-field-wrap { position: relative; }
.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-weak);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
}
.password-toggle:hover { color: var(--text); background: var(--surface-muted); }

.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}
.strength-bar {
  flex: 1;
  height: 4px;
  background: var(--border-soft);
  border-radius: 2px;
  transition: background .2s;
}
.strength-bar.active-1 { background: var(--red); }
.strength-bar.active-2 { background: var(--yellow); }
.strength-bar.active-3 { background: #0369A1; }
.strength-bar.active-4 { background: var(--green); }
.strength-hint {
  font-size: 11px;
  color: var(--text-weak);
  margin-top: 4px;
}

/* ==================================================================
   Topbar auth slot (usado nas páginas principais)
   ================================================================== */

.auth-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all .15s;
  border: 1px solid transparent;
}
.auth-btn-ghost {
  color: var(--text-sec);
  background: transparent;
}
.auth-btn-ghost:hover { color: var(--text); background: var(--surface-alt); }
.auth-btn-primary {
  background: var(--text);
  color: #FFF;
}
.auth-btn-primary:hover { background: #000; }

.user-menu { position: relative; }
.user-avatar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  border-radius: 99px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all .15s;
}
.user-avatar:hover { background: var(--surface-muted); }
.user-avatar-initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue) 0%, var(--teal) 100%);
  color: #FFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.user-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.user-avatar-name {
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-avatar svg { color: var(--text-weak); transition: transform .2s; }
.user-avatar[aria-expanded="true"] svg { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  min-width: 240px;
  overflow: hidden;
  z-index: 200;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: all .15s;
}
.user-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
.user-dropdown-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-alt);
}
.user-dropdown-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-dropdown-email {
  font-size: 11.5px;
  color: var(--text-sec);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.user-role-user { background: var(--surface-muted); color: var(--text-sec); }
.user-role-admin { background: var(--yellow-soft); color: var(--yellow); }
.user-role-super_admin { background: #E0F2FE; color: #0369A1; }

.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.user-dropdown-item:hover { background: var(--surface-alt); }
.user-dropdown-sep {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 0;
}
.user-dropdown-danger { color: var(--red); }
.user-dropdown-admin { color: var(--teal); font-weight: 700; }

@media (max-width: 640px) {
  .user-avatar-name { display: none; }
}
