/* =====================================================
   AUTH (Registro / Login)
   ===================================================== */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 20px 40px;
  background: #0a0a0a;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(10px);
  border: 2px solid var(--color-accent, #59058a);
  border-radius: 14px;
  padding: 35px 30px;
  box-shadow: 0 0 30px var(--color-accent-glow, rgba(89, 5, 138, 0.45));
  color: #fff;
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 8px;
  color: var(--color-primary, #00ff99);
  letter-spacing: 1px;
}

.auth-card .auth-sub {
  text-align: center;
  font-size: 0.9rem;
  color: #c8c8c8;
  margin-bottom: 25px;
}

.auth-form .form-group {
  margin-bottom: 16px;
}

.auth-form label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 6px;
  color: #d6d6d6;
  letter-spacing: 0.5px;
}

.auth-form input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 1rem;
  transition: border 0.2s, background 0.2s;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--color-primary, #00ff99);
  background: rgba(255, 255, 255, 0.1);
}

.auth-submit {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: var(--color-primary, #00ff99);
  color: #000;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--color-accent-glow, rgba(89, 5, 138, 0.35));
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-link {
  display: block;
  text-align: center;
  margin-top: 18px;
  color: #c8c8c8;
  font-size: 0.9rem;
}

.auth-link a {
  color: var(--color-primary, #00ff99);
  text-decoration: none;
  font-weight: bold;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* Mensajes */
.auth-msg {
  margin-bottom: 15px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}

.auth-msg.error {
  display: block;
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid rgba(220, 53, 69, 0.5);
  color: #ff8a93;
}

.auth-msg.ok {
  display: block;
  background: rgba(0, 255, 153, 0.12);
  border: 1px solid rgba(0, 255, 153, 0.45);
  color: #88ffc6;
}

/* Boton de registro/login en header (fallback si JS no carga) */
.header-btn {
  padding: 8px 16px;
  background: var(--color-primary, #00ff99);
  color: #000 !important;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.95rem !important;
  transition: transform 0.2s, box-shadow 0.2s;
}

.header-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px var(--color-accent-glow, rgba(89, 5, 138, 0.4));
  background: var(--color-primary, #00ff99) !important;
}

.header-btn.outline {
  background: transparent;
  color: var(--color-primary, #00ff99) !important;
  border: 1.5px solid var(--color-primary, #00ff99);
}

.header-btn.outline:hover {
  background: rgba(0, 255, 153, 0.1) !important;
}

/* ---------- MENU DESPLEGABLE DE USUARIO ---------- */
.user-menu {
  position: relative;
}

.user-menu-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
  padding: 0;
  overflow: hidden;
}

.user-menu-btn:hover {
  border-color: var(--color-accent, #59058a);
  background: rgba(0, 255, 153, 0.08);
  box-shadow: 0 0 10px var(--color-accent-glow, rgba(89, 5, 138, 0.3));
}

.user-menu-icon { font-size: 1.2rem; }

.user-menu-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-menu-initial {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #59058a, #1d4ed8);
  color: #fff;
  font-weight: bold;
  font-size: 1rem;
  border-radius: 50%;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: rgba(18, 18, 18, 0.98);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 2000;
}

.user-menu-dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dropdown-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-header b { color: #fff; font-size: 0.95rem; }
.dropdown-header span { color: #888; font-size: 0.78rem; }

.dropdown-item {
  display: block;
  padding: 10px 16px;
  color: #d0d0d0;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.dropdown-item.logout { color: #ff8a93; }
.dropdown-item.logout:hover { background: rgba(220, 53, 69, 0.1); }

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
  margin: 4px 0;
}

/* ---------- AVATAR EN HEADER ---------- */
.header-user-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}

.header-user-link:hover { background: rgba(255, 255, 255, 0.06); }

.header-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary, #00ff99);
}

.header-avatar-initial {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #59058a, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.header-username {
  color: #ddd;
  font-size: 0.88rem;
  font-weight: 500;
}

/* ---------- PAGINA DE PERFIL ---------- */
.perfil-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 100px 20px 60px;
}

.perfil-page h1 {
  color: var(--color-primary, #00ff99);
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.perfil-page .perfil-sub {
  color: #888;
  margin-bottom: 30px;
}

.perfil-card {
  background: rgba(15, 15, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 20px;
}

.perfil-card h2 {
  color: #fff;
  font-size: 1.15rem;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Avatar en perfil */
.perfil-avatar-section {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}

.perfil-avatar-preview {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--color-primary, #00ff99);
  flex-shrink: 0;
}

.perfil-avatar-initial {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #59058a, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 2.2rem;
  color: #fff;
  flex-shrink: 0;
}

.perfil-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.perfil-avatar-actions label {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #ccc;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.perfil-avatar-actions label:hover { border-color: var(--color-primary, #00ff99); color: #fff; }

.perfil-avatar-actions input[type="file"] { display: none; }

.perfil-avatar-actions .avatar-hint {
  color: #666;
  font-size: 0.78rem;
}

/* Info del perfil */
.perfil-info {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px 16px;
  font-size: 0.92rem;
}

.perfil-info .label { color: #888; }
.perfil-info .value { color: #eee; }

/* Formulario password */
.perfil-form .form-group {
  margin-bottom: 14px;
}

.perfil-form label {
  display: block;
  font-size: 0.82rem;
  color: #aaa;
  margin-bottom: 5px;
}

.perfil-form input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  font-size: 0.95rem;
}

.perfil-form input:focus {
  outline: none;
  border-color: var(--color-primary, #00ff99);
}

/* Mensajes */
.perfil-msg {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 14px;
  display: none;
}

.perfil-msg.error { display: block; background: rgba(220, 53, 69, 0.15); border: 1px solid rgba(220, 53, 69, 0.5); color: #ff8a93; }
.perfil-msg.ok    { display: block; background: rgba(0, 255, 153, 0.12); border: 1px solid rgba(0, 255, 153, 0.45); color: #88ffc6; }

/* ---------- BOTON VOLVER ARRIBA ---------- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-primary, #00ff99);
  color: #000;
  border: none;
  font-size: 1.4rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s, box-shadow 0.2s;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  box-shadow: 0 6px 24px rgba(0, 255, 153, 0.4);
}
