/* ==========================================================================
   BimmerManiacs — Estilos partilhados do sistema de Autenticação
   (Nav Registo/Login <-> Utilizador, Popup de boas-vindas, formulários)
   ========================================================================== */

/* ---- Slot do botão de autenticação no menu ---- */
.nav-auth {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ffffff !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  background: rgba(30, 144, 255, 0.12);
  border: 1px solid rgba(30, 144, 255, 0.35);
  padding: 4px 12px 4px 4px;
  border-radius: 20px;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.nav-user-chip:hover {
  background: rgba(30, 144, 255, 0.22);
  border-color: #1e90ff;
}
.nav-user-chip img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* ---- Popup "Bem-vindo de volta" ---- */
.bm-welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 5, 0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  animation: bmFadeIn 0.25s ease;
}
.bm-welcome-overlay.closing {
  animation: bmFadeOut 0.2s ease forwards;
}
@keyframes bmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes bmFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
.bm-welcome-box {
  background: #141820;
  border: 1px solid #1a2230;
  border-radius: 14px;
  max-width: 420px;
  width: 100%;
  padding: 40px 30px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  animation: bmPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bmPopIn {
  from { transform: scale(0.9) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.bm-welcome-stripes {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  display: flex;
}
.bm-welcome-stripes span { flex: 1; }
.bm-welcome-stripes span:nth-child(1) { background: #0066b2; }
.bm-welcome-stripes span:nth-child(2) { background: #151f6d; }
.bm-welcome-stripes span:nth-child(3) { background: #ce1226; }
.bm-welcome-icon { font-size: 34px; margin-bottom: 10px; }
.bm-welcome-box h3 { color: #fff; font-size: 21px; margin-bottom: 10px; line-height: 1.3; }
.bm-welcome-box p { color: #b3b3b3; font-size: 14px; margin-bottom: 24px; }
.bm-welcome-btn {
  background: #1e90ff;
  color: #fff;
  border: none;
  padding: 11px 28px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}
.bm-welcome-btn:hover { background: #63a4ff; transform: translateY(-2px); }

/* ---- Formulários de autenticação (Login / Registo / Recuperação) ---- */
.auth-card {
  background: #141820;
  border: 1px solid #1a2230;
  border-radius: 12px;
  padding: 40px 30px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}
.auth-card.auth-card-wide { max-width: 640px; }
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0066b2, #151f6d, #ce1226);
}
.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 144, 255, 0.12);
  color: #1e90ff;
  border: 1px solid rgba(30, 144, 255, 0.4);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 18px;
}
.auth-pulse-dot {
  width: 8px; height: 8px;
  background-color: #1e90ff;
  border-radius: 50%;
  box-shadow: 0 0 8px #1e90ff;
}
.auth-title { font-size: 24px; color: #fff; margin-bottom: 8px; font-weight: 800; text-align: center; }
.auth-desc { color: #b3b3b3; font-size: 14px; margin-bottom: 26px; line-height: 1.6; text-align: center; }

.auth-field { margin-bottom: 16px; text-align: left; }
.auth-field label { display: block; font-size: 12px; color: #b3b3b3; font-weight: 600; margin-bottom: 6px; }
.auth-field input,
.auth-field select,
.auth-field textarea {
  width: 100%;
  background: #0b0c10;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 12px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
}
.auth-field textarea { resize: vertical; min-height: 80px; }
.auth-field input:focus,
.auth-field select:focus,
.auth-field textarea:focus { border-color: #1e90ff; }
.auth-field-hint { font-size: 11px; color: #777; margin-top: 5px; }

.auth-password-wrap { position: relative; }
.auth-password-wrap input { padding-right: 46px; }
.auth-toggle-pass {
  position: absolute;
  right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #b3b3b3;
  cursor: pointer;
  font-size: 16px;
  padding: 8px;
  line-height: 1;
}
.auth-toggle-pass:hover { color: #1e90ff; }

.auth-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .auth-row-2 { grid-template-columns: 1fr; } }

.auth-forgot { text-align: right; margin: -8px 0 18px; }
.auth-forgot a { font-size: 12.5px; color: #1e90ff; text-decoration: none; }
.auth-forgot a:hover { text-decoration: underline; }

.auth-submit {
  width: 100%;
  background: #1e90ff;
  color: #fff;
  border: none;
  padding: 13px 20px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}
.auth-submit:hover { background: #63a4ff; transform: translateY(-2px); }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: #777; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: #1a2230; }

.auth-secondary-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: transparent;
  border: 2px solid #1e90ff;
  color: #1e90ff;
  padding: 11px 20px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}
.auth-secondary-btn:hover { background: #1e90ff; color: #fff; }

.auth-switch { text-align: center; margin-top: 14px; font-size: 13px; color: #b3b3b3; }
.auth-switch a { color: #1e90ff; text-decoration: none; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.auth-message {
  display: none;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 18px;
  text-align: left;
  line-height: 1.5;
}
.auth-message.show { display: block; }
.auth-message.error { background: rgba(206, 18, 38, 0.12); border: 1px solid rgba(206, 18, 38, 0.4); color: #ff8080; }
.auth-message.success { background: rgba(0, 200, 120, 0.1); border: 1px solid rgba(0, 200, 120, 0.4); color: #4ee6a8; }

/* ---- Avatar de upload (página de Registo) ---- */
.auth-avatar-box { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.auth-avatar-preview { width: 78px; height: 78px; border-radius: 50%; object-fit: cover; border: 2px solid #1e90ff; background: #0b0c10; flex-shrink: 0; }
.auth-avatar-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.auth-avatar-btn:hover { background: rgba(30, 144, 255, 0.2); border-color: #1e90ff; }

/* ---- Breadcrumb (ex: Comunidade > Eventos) ---- */
.bm-breadcrumb { max-width: 1200px; margin: 18px auto 0; padding: 0 20px; font-size: 13px; color: #b3b3b3; }
.bm-breadcrumb a { color: #1e90ff; text-decoration: none; }
.bm-breadcrumb a:hover { text-decoration: underline; }
@media (min-width: 768px) { .bm-breadcrumb { padding: 0 40px; } }
